/** @file * $Source: /home/cvspamela/yoda/event/PscuHeader.cpp,v $ * $Id: PscuHeader.cpp,v 1.8 2004/06/09 23:18:20 nagni Exp $ * $Author: nagni $ * * Implementation of the PscuHeader class. */ #include #include #include #include "PscuHeader.h" #include "Exception.h" using namespace pamela; log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.Techmodel.PscuHeader"); /** * Create an PscuHeader object. */ PscuHeader::PscuHeader(): OrbitalTime(0), PacketId1(0), PacketId2(0), Counter(0), PacketLenght(0) { } PscuHeader::~PscuHeader() { } /** * Get the packet type of this header. */ const PacketType* PscuHeader::GetPacketType(void) const throw (std::exception) { switch (PacketId1) { case 0x10: return PacketType::Physics; case 0x11: return PacketType::ForcedPkt; case 0x12: return PacketType::CalibTrk; case 0x13: return PacketType::CalibTrg; case 0x14: return PacketType::CalibCal; case 0x15: return PacketType::CalibTrd; case 0x16: return PacketType::CalibTof; case 0x17: return PacketType::CalibS4; case 0x20: return PacketType::RunHeader; case 0x21: return PacketType::RunTrailer; case 0x30: return PacketType::Alarm; case 0x40: return PacketType::Khb; case 0x50: return PacketType::Log; case 0x51: return PacketType::VarDump; case 0x52: return PacketType::ArrDump; case 0x53: return PacketType::TabDump; case 0x54: return PacketType::Tmtc; case 0x55: return PacketType::Mcmd; case 0x56: return PacketType::HA_Header_E5; default: { cat << log4cpp::Priority::ERROR << "\n Unrecognized PacketType: " << (int)PacketId1; throw Exception("Invalid Packed Id1"); } } } ClassImp(PscuHeader)