1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvspamela/yoda/techmodel/ArrDumpReader.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/ArrDumpReader.cpp,v $ |
3 |
* $Id: ArrDumpReader.cpp,v 1.7 2004/05/11 10:12:35 nagni Exp $ |
* $Id: ArrDumpReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $ |
4 |
* $Author: nagni $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the ArrDumpReader class. |
* Implementation of the ArrDumpReader class. |
7 |
*/ |
*/ |
33 |
* Get a string with the version info of the algorithm. |
* Get a string with the version info of the algorithm. |
34 |
*/ |
*/ |
35 |
std::string ArrDumpReader::GetVersionInfo(void) const { |
std::string ArrDumpReader::GetVersionInfo(void) const { |
36 |
return "$Header: /home/cvspamela/yoda/techmodel/ArrDumpReader.cpp,v 1.7 2004/05/11 10:12:35 nagni Exp $\n"; |
return "$Header: /home/cvsmanager/yoda/techmodel/ArrDumpReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $\n"; |
37 |
} |
} |
38 |
|
|
39 |
/** |
/** |
67 |
InputFile->read(eventCRC, sizeof(eventCRC)); |
InputFile->read(eventCRC, sizeof(eventCRC)); |
68 |
readCRC = (((UINT16)(eventCRC[0]<<8))&0xFF00) + (((UINT16)eventCRC[1])&0x00FF); |
readCRC = (((UINT16)(eventCRC[0]<<8))&0xFF00) + (((UINT16)eventCRC[1])&0x00FF); |
69 |
|
|
|
if(!(subCRC == readCRC)) { |
|
|
cat << log4cpp::Priority::ERROR |
|
|
<< "The test of calculated CRC with one wrote on file FAILED!!" |
|
|
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
|
|
} |
|
|
|
|
70 |
//finally check if the RecordCRC is correct and finally update the partialCRC |
//finally check if the RecordCRC is correct and finally update the partialCRC |
71 |
if (subCRC == readCRC){ |
if (subCRC == readCRC){ |
72 |
/**************************************************************************** |
ArrDumpRecord* rec; |
73 |
---------------------TBD read the data--------------------------- |
long int offset = 0; |
74 |
****************************************************************************/ |
int i = 0; |
75 |
|
ArrDump->Records->Clear(); |
76 |
|
TClonesArray &recs = *(ArrDump->Records); |
77 |
|
while (offset < dataLength){ |
78 |
|
rec = new(recs[i++]) ArrDumpRecord(); //add a new TmtcRecord |
79 |
|
rec->Arr_ID = ((UINT8)subData[offset])&0xFF; |
80 |
|
rec->Arr_len = (((UINT16)subData[offset+1]<<8)&0xFF00) + ((UINT16)subData[offset+2])&0x00FF; |
81 |
|
memcpy(rec->Data, subData+offset+3, sizeof(UINT32)*(rec->Arr_len)); |
82 |
|
offset = offset + (sizeof(UINT32)*(rec->Arr_len)) + 2; |
83 |
|
} |
84 |
free(subData); |
free(subData); |
85 |
} else { |
} else { |
86 |
cat << log4cpp::Priority::ERROR |
cat << log4cpp::Priority::ERROR |