1 |
kusanagi |
1.1 |
/** @file |
2 |
kusanagi |
1.2 |
* $Source: /home/cvsmanager/yoda/event/PscuHeader.cpp,v $ |
3 |
|
|
* $Id: PscuHeader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $ |
4 |
|
|
* $Author: kusanagi $ |
5 |
kusanagi |
1.1 |
* |
6 |
|
|
* Implementation of the PscuHeader class. |
7 |
|
|
*/ |
8 |
|
|
#include <exception> |
9 |
|
|
#include <string> |
10 |
|
|
|
11 |
|
|
#include <log4cpp/Category.hh> |
12 |
|
|
|
13 |
|
|
#include "PscuHeader.h" |
14 |
|
|
#include "Exception.h" |
15 |
|
|
|
16 |
|
|
using namespace pamela; |
17 |
|
|
|
18 |
|
|
log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.Techmodel.PscuHeader"); |
19 |
|
|
|
20 |
|
|
/** |
21 |
|
|
* Create an PscuHeader object. |
22 |
|
|
*/ |
23 |
|
|
PscuHeader::PscuHeader(): |
24 |
|
|
OrbitalTime(0), |
25 |
|
|
PacketId1(0), |
26 |
|
|
PacketId2(0), |
27 |
|
|
Counter(0), |
28 |
|
|
PacketLenght(0) { } |
29 |
|
|
|
30 |
|
|
PscuHeader::~PscuHeader() { } |
31 |
|
|
|
32 |
|
|
/** |
33 |
|
|
* Get the packet type of this header. |
34 |
|
|
*/ |
35 |
|
|
const PacketType* PscuHeader::GetPacketType(void) const throw (std::exception) { |
36 |
|
|
switch (PacketId1) { |
37 |
|
|
case 0x10: return PacketType::Physics; |
38 |
|
|
case 0x11: return PacketType::ForcedPkt; |
39 |
kusanagi |
1.2 |
case 0x12: return PacketType::CalibTrk1; |
40 |
|
|
case 0x13: return PacketType::CalibTrk2; |
41 |
kusanagi |
1.1 |
case 0x14: return PacketType::CalibCal; |
42 |
|
|
case 0x15: return PacketType::CalibTrd; |
43 |
|
|
case 0x16: return PacketType::CalibTof; |
44 |
|
|
case 0x17: return PacketType::CalibS4; |
45 |
|
|
case 0x20: return PacketType::RunHeader; |
46 |
|
|
case 0x21: return PacketType::RunTrailer; |
47 |
|
|
case 0x30: return PacketType::Alarm; |
48 |
|
|
case 0x40: return PacketType::Khb; |
49 |
|
|
case 0x50: return PacketType::Log; |
50 |
|
|
case 0x51: return PacketType::VarDump; |
51 |
|
|
case 0x52: return PacketType::ArrDump; |
52 |
|
|
case 0x53: return PacketType::TabDump; |
53 |
|
|
case 0x54: return PacketType::Tmtc; |
54 |
|
|
case 0x55: return PacketType::Mcmd; |
55 |
|
|
case 0x56: return PacketType::HA_Header_E5; |
56 |
|
|
default: { |
57 |
|
|
cat << log4cpp::Priority::ERROR |
58 |
|
|
<< "\n Unrecognized PacketType: " |
59 |
|
|
<< (int)PacketId1; |
60 |
|
|
throw Exception("Invalid Packed Id1"); |
61 |
|
|
} |
62 |
|
|
} |
63 |
|
|
} |
64 |
|
|
|
65 |
|
|
|
66 |
|
|
ClassImp(PscuHeader) |
67 |
|
|
|