1 |
kusanagi |
1.1 |
|
2 |
|
|
// Implementation of the CalAlarmReader class. |
3 |
|
|
|
4 |
|
|
#include "ReaderAlgorithms.h" |
5 |
|
|
|
6 |
|
|
using namespace pamela::techmodel; |
7 |
|
|
|
8 |
|
|
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalAlarmReader")); |
9 |
|
|
|
10 |
|
|
/** |
11 |
|
|
* Constructor. |
12 |
|
|
*/ |
13 |
|
|
CalAlarmReader::CalAlarmReader(void): |
14 |
|
|
TechmodelAlgorithm(PacketType::CalAlarm, "TechmodelCalAlarmReader") { |
15 |
|
|
logger->debug(_T("Constructor")); |
16 |
|
|
calAlarm = new CalAlarmEvent(); |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
/** |
20 |
|
|
* Get a string with the version info of the algorithm. |
21 |
|
|
*/ |
22 |
|
|
std::string CalAlarmReader::GetVersionInfo(void) const { |
23 |
|
|
return |
24 |
kusanagi |
5.3 |
"$Trailer: /home/cvsmanager/yoda/techmodel/CalAlarmReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 Maurizio Nagni Exp $\n"; |
25 |
kusanagi |
1.1 |
} |
26 |
|
|
|
27 |
|
|
/** |
28 |
|
|
* Initialize the algorithm with a special run. This will initialize the |
29 |
|
|
* event reader routines for all packet types. |
30 |
|
|
*/ |
31 |
|
|
void CalAlarmReader::Init(PamelaRun *run) { |
32 |
|
|
SetInputStream(run); |
33 |
|
|
run->WriteSubPacket(this, &calAlarm, calAlarm->Class()); |
34 |
|
|
logger->debug(_T("Initialize")); |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
/** |
38 |
|
|
* Unpack the CalAlarm event from an input file. |
39 |
kusanagi |
5.1 |
* The CPU does not add any CRC control at the packet end. |
40 |
|
|
* @param EventNumber |
41 |
|
|
* @param dataLength |
42 |
kusanagi |
1.1 |
*/ |
43 |
kusanagi |
5.1 |
void CalAlarmReader::RunEvent(int EventNumber, long int dataLength) throw (WrongCRCException){ |
44 |
|
|
char subData[dataLength]; |
45 |
mocchiut |
6.1 |
memset(subData, 0, dataLength*sizeof(char)); |
46 |
kusanagi |
5.1 |
InputFile->read(subData, sizeof(subData)); |
47 |
|
|
calAlarm->calAlarmData = new TArrayC(dataLength, subData); |
48 |
kusanagi |
1.1 |
} |
49 |
|
|
|