1 |
/** @file |
2 |
* $Source: /home/cvspamela/yoda/event/PscuHeader.h,v $ |
3 |
* $Id: PscuHeader.h,v 1.7 2004/04/28 09:01:27 nagni Exp $ |
4 |
* $Author: nagni $ |
5 |
* |
6 |
* Header file for the PscuHeader class. |
7 |
*/ |
8 |
#ifndef PSCU_HEADER_H |
9 |
#define PSCU_HEADER_H |
10 |
#define UINT32 unsigned int |
11 |
#define UINT16 unsigned short |
12 |
#define UINT8 unsigned char |
13 |
#include <exception> |
14 |
|
15 |
#include "PacketType.h" |
16 |
#include "SubPacket.h" |
17 |
|
18 |
namespace pamela { |
19 |
/** |
20 |
* Class containing the PSCU header and trailer information. |
21 |
*/ |
22 |
class PscuHeader: public pamela::SubPacket { |
23 |
private: |
24 |
unsigned int Header; /**< Packet type header (must be 0xFAFEDE) */ |
25 |
UINT8 PacketId1; /**< Packet type first byte */ |
26 |
UINT8 PacketId2; /**< Packet type second byte */ |
27 |
UINT32 Counter; /**< PSCU event counter */ |
28 |
UINT32 OrbitalTime; /**< Raw Orbital time */ |
29 |
UINT32 PacketLenght; |
30 |
UINT8 CRC; /**< PSCU Header Checksum */ |
31 |
public: |
32 |
PscuHeader(); |
33 |
virtual ~PscuHeader(); |
34 |
const pamela::PacketType* GetPacketType(void) const throw (std::exception); |
35 |
/** Get the Header. */ |
36 |
int GetHeader(void) const { return Header; } |
37 |
/** Get packet id 1. */ |
38 |
unsigned char GetPacketId1(void) const { return PacketId1; } |
39 |
/** Get packet id 2. */ |
40 |
unsigned char GetPacketId2(void) const { return PacketId2; } |
41 |
/** Get the PSCU event counter. */ |
42 |
int GetCounter(void) const { return Counter; } |
43 |
/** Get the orbital time. */ |
44 |
int GetOrbitalTime(void) const { return OrbitalTime; } |
45 |
/** Get the header CRC. */ |
46 |
unsigned char GetCRC(void) const { return CRC; } |
47 |
/** Get the packet length for this packet. */ |
48 |
int GetPacketLenght(void) const { return PacketLenght; } |
49 |
|
50 |
/** Set the orbital time. Intended to use by the raw reader. */ |
51 |
void SetHeader(int var) { Header = var; } |
52 |
/** Set the packet id. Intended to use by the raw reader. */ |
53 |
void SetPacketId(short var1, short var2) { PacketId1 = var1; PacketId2 = var2; } |
54 |
/** Set the counter. Intended to use by the raw reader. */ |
55 |
void SetCounter(int var) { Counter = var; } |
56 |
/** Set the orbital time. Intended to use by the raw reader. */ |
57 |
void SetOrbitalTime(int var) { OrbitalTime = var; } |
58 |
/** Set the packet length. Intended to use by the raw reader. */ |
59 |
void SetPacketLenght(int var) { PacketLenght = var; } |
60 |
/** Set the packet length. Intended to use by the raw reader. */ |
61 |
void SetCRC(short var) { CRC = var; } |
62 |
|
63 |
ClassDef(PscuHeader, 1) |
64 |
}; |
65 |
} |
66 |
|
67 |
#endif /* PSCU_HEADER_H */ |