1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvsmanager/yoda/event/PscuHeader.cpp,v $ |
* $Source: /home/cvsmanager/yoda/event/PscuHeader.cpp,v $ |
3 |
* $Id: PscuHeader.cpp,v 1.3 2004/07/29 16:18:54 kusanagi Exp $ |
* $Id: PscuHeader.cpp,v 2.2 2004/12/03 22:04:04 kusanagi Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the PscuHeader class. |
* Implementation of the PscuHeader class. |
7 |
*/ |
*/ |
8 |
#include <exception> |
#include <log4cxx/logger.h> |
|
#include <string> |
|
|
|
|
|
#include <log4cpp/Category.hh> |
|
|
|
|
9 |
#include "PscuHeader.h" |
#include "PscuHeader.h" |
|
#include "Exception.h" |
|
10 |
|
|
11 |
using namespace pamela; |
using namespace pamela; |
12 |
|
|
13 |
log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.PscuHeader"); |
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.PscuHeader")); |
14 |
|
//static std::stringstream oss; |
15 |
|
|
16 |
/** |
/** |
17 |
* Create an PscuHeader object. |
* Create an PscuHeader object. |
28 |
/** |
/** |
29 |
* Get the packet type of this header. |
* Get the packet type of this header. |
30 |
*/ |
*/ |
31 |
const PacketType* PscuHeader::GetPacketType(void) const throw (std::exception) { |
const PacketType* PscuHeader::GetPacketType(void) const throw (UnidentifiedPacketException) { |
32 |
switch (PacketId1) { |
switch (PacketId1) { |
33 |
case 0x07: return PacketType::PhysEndRun; |
case 0x07: return PacketType::PhysEndRun; |
34 |
case 0x08: return PacketType::CalibCalPulse1; |
case 0x08: return PacketType::CalibCalPulse1; |
50 |
case 0x25: return PacketType::InitTrailer; |
case 0x25: return PacketType::InitTrailer; |
51 |
case 0x30: return PacketType::EventTrk; |
case 0x30: return PacketType::EventTrk; |
52 |
case 0x40: return PacketType::TestTrk; |
case 0x40: return PacketType::TestTrk; |
53 |
|
case 0x41: return PacketType::TestTof; |
54 |
case 0x50: return PacketType::Log; |
case 0x50: return PacketType::Log; |
55 |
case 0x51: return PacketType::VarDump; |
case 0x51: return PacketType::VarDump; |
56 |
case 0x52: return PacketType::ArrDump; |
case 0x52: return PacketType::ArrDump; |
63 |
case 0x72: return PacketType::TrkInit; |
case 0x72: return PacketType::TrkInit; |
64 |
case 0x73: return PacketType::TofInit; |
case 0x73: return PacketType::TofInit; |
65 |
case 0x74: return PacketType::TrgInit; |
case 0x74: return PacketType::TrgInit; |
66 |
|
case 0x75: return PacketType::NdInit; |
67 |
|
case 0x76: return PacketType::S4Init; |
68 |
|
case 0x81: return PacketType::CalAlarm; |
69 |
|
case 0x82: return PacketType::AcAlarm; |
70 |
|
case 0x83: return PacketType::TrkAlarm; |
71 |
|
case 0x84: return PacketType::TrgAlarm; |
72 |
|
case 0x85: return PacketType::TofAlarm; |
73 |
|
case 0x86: return PacketType::S4Alarm; |
74 |
|
|
75 |
default: { |
default: { |
76 |
cat << log4cpp::Priority::ERROR |
throw UnidentifiedPacketException(PacketId1); |
|
<< "\n Unrecognized PacketType: " |
|
|
<< (int)PacketId1; |
|
|
throw Exception("Invalid Packed Id1"); |
|
77 |
} |
} |
78 |
} |
} |
79 |
} |
} |
81 |
|
|
82 |
ClassImp(PscuHeader) |
ClassImp(PscuHeader) |
83 |
|
|
84 |
|
|