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