1 |
kusanagi |
5.1 |
/** @file |
2 |
kusanagi |
5.2 |
* $Author: kusanagi $ |
3 |
kusanagi |
6.1 |
* $Date: 2006/02/07 17:11:09 $ |
4 |
|
|
* $Revision: 6.0 $ |
5 |
kusanagi |
5.1 |
* |
6 |
|
|
* Implementation of the AcAlarmReader class. |
7 |
|
|
*/ |
8 |
kusanagi |
1.1 |
|
9 |
|
|
|
10 |
|
|
#include <log4cxx/logger.h> |
11 |
|
|
#include "ReaderAlgorithms.h" |
12 |
|
|
|
13 |
|
|
using namespace pamela; |
14 |
|
|
using namespace pamela::techmodel; |
15 |
|
|
|
16 |
|
|
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.AcAlarmReader")); |
17 |
|
|
|
18 |
|
|
/** |
19 |
|
|
* Constructor. |
20 |
|
|
*/ |
21 |
|
|
AcAlarmReader::AcAlarmReader(void): |
22 |
|
|
TechmodelAlgorithm(PacketType::AcAlarm, "TechmodelAcAlarmReader") { |
23 |
|
|
logger->debug(_T("Constructor")); |
24 |
|
|
acAlarm = new AcAlarmEvent(); |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
/** |
28 |
|
|
* Get a string with the version info of the algorithm. |
29 |
|
|
*/ |
30 |
|
|
std::string AcAlarmReader::GetVersionInfo(void) const { |
31 |
|
|
return |
32 |
kusanagi |
5.3 |
"$Trailer: /home/cvsmanager/yoda/techmodel/acAlarmReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 Maurizio Nagni Exp $\n"; |
33 |
kusanagi |
1.1 |
} |
34 |
|
|
|
35 |
|
|
/** |
36 |
|
|
* Initialize the algorithm with a special run. This will initialize the |
37 |
|
|
* event reader routines for all packet types. |
38 |
|
|
*/ |
39 |
|
|
void AcAlarmReader::Init(PamelaRun *run) { |
40 |
|
|
SetInputStream(run); |
41 |
|
|
run->WriteSubPacket(this, &acAlarm, acAlarm->Class()); |
42 |
|
|
logger->debug(_T("Initialize")); |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
/** |
46 |
|
|
* Unpack the AcAlarm event from an input file. |
47 |
|
|
*/ |
48 |
kusanagi |
5.1 |
void AcAlarmReader::RunEvent(int EventNumber, long int dataLength) throw (WrongCRCException){ |
49 |
|
|
|
50 |
|
|
logger->warn(_T("Missing definition.... not read")); |
51 |
|
|
char subData[dataLength]; |
52 |
|
|
InputFile->read(subData, sizeof(unsigned char)*dataLength); |
53 |
|
|
|
54 |
|
|
|
55 |
kusanagi |
1.1 |
} |
56 |
|
|
|