/** @file * $Source: /home/cvsmanager/yoda/event/PscuHeader.h,v $ * $Id: PscuHeader.h,v 1.2 2004/08/25 10:14:22 kusanagi Exp $ * $Author: kusanagi $ * * 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 */ /* This parameter represent the offset of the header relative to the begin * of the file it has been extracted. It's purpose is to * check whenever the CPU (for error) store the same packet more than one time. * It's not clear if it will be mantained or not in the definitive release. */ UINT32 FileOffset; 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; } /** Get the offset of the packet relative to the begin of the raw file. */ int GetFileOffset(void) const { return FileOffset; } /** 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; } /** Get the offset of the packet relative to the begin of the raw file. */ int SetFileOffset(int var) { FileOffset = var; } ClassDef(PscuHeader, 1) }; } #endif /* PSCU_HEADER_H */