/** @file * $Source: /home/cvspamela/yoda/event/PscuHeader.h,v $ * $Id: PscuHeader.h,v 1.7 2004/04/28 09:01:27 nagni Exp $ * $Author: nagni $ * * Header file for the PscuHeader class. */ #ifndef PSCU_HEADER_H #define PSCU_HEADER_H #define UINT32 unsigned int #define UINT16 unsigned short #define UINT8 unsigned char #include #include "PacketType.h" #include "SubPacket.h" namespace pamela { /** * Class containing the PSCU header and trailer information. */ class PscuHeader: public pamela::SubPacket { private: unsigned int Header; /**< Packet type header (must be 0xFAFEDE) */ UINT8 PacketId1; /**< Packet type first byte */ UINT8 PacketId2; /**< Packet type second byte */ UINT32 Counter; /**< PSCU event counter */ UINT32 OrbitalTime; /**< Raw Orbital time */ UINT32 PacketLenght; UINT8 CRC; /**< PSCU Header Checksum */ public: PscuHeader(); virtual ~PscuHeader(); const pamela::PacketType* GetPacketType(void) const throw (std::exception); /** Get the Header. */ int GetHeader(void) const { return Header; } /** Get packet id 1. */ unsigned char GetPacketId1(void) const { return PacketId1; } /** Get packet id 2. */ unsigned char GetPacketId2(void) const { return PacketId2; } /** Get the PSCU event counter. */ int GetCounter(void) const { return Counter; } /** Get the orbital time. */ int GetOrbitalTime(void) const { return OrbitalTime; } /** Get the header CRC. */ unsigned char GetCRC(void) const { return CRC; } /** Get the packet length for this packet. */ int GetPacketLenght(void) const { return PacketLenght; } /** Set the orbital time. Intended to use by the raw reader. */ void SetHeader(int var) { Header = var; } /** Set the packet id. Intended to use by the raw reader. */ void SetPacketId(short var1, short var2) { PacketId1 = var1; PacketId2 = var2; } /** Set the counter. Intended to use by the raw reader. */ void SetCounter(int var) { Counter = var; } /** Set the orbital time. Intended to use by the raw reader. */ void SetOrbitalTime(int var) { OrbitalTime = var; } /** Set the packet length. Intended to use by the raw reader. */ void SetPacketLenght(int var) { PacketLenght = var; } /** Set the packet length. Intended to use by the raw reader. */ void SetCRC(short var) { CRC = var; } ClassDef(PscuHeader, 1) }; } #endif /* PSCU_HEADER_H */