| 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.4 2004/08/24 16:01:57 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.4 2004/08/24 16:01:57 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 |
free(subData); |
int size; |
| 76 |
|
ArrDump->Records->Clear(); |
| 77 |
|
TClonesArray &recs = *(ArrDump->Records); |
| 78 |
|
while (offset < dataLength){ |
| 79 |
|
rec = new(recs[i++]) ArrDumpRecord(); //add a new TmtcRecord |
| 80 |
|
rec->Arr_ID = ((UINT8)subData[offset])&0xFF; |
| 81 |
|
rec->Arr_len = (((UINT16)subData[offset+1]<<8)&0xFF00) + ((UINT16)subData[offset+2])&0x00FF; |
| 82 |
|
//rec->Data = new UINT32[rec->Arr_len]; |
| 83 |
|
size = sizeof(UINT32)*(rec->Arr_len); |
| 84 |
|
rec->Data = new TArrayI((int)rec->Arr_len, (int*)(subData+offset+3)); |
| 85 |
|
//memcpy(rec->Data, (UINT32*)(subData+offset+3), size); |
| 86 |
|
offset = offset + size + 3; |
| 87 |
|
} |
| 88 |
} else { |
} else { |
| 89 |
cat << log4cpp::Priority::ERROR |
cat << log4cpp::Priority::ERROR |
| 90 |
<< "Wrong CRC on Subpacket in ArrDump Packet " |
<< "Wrong CRC on Subpacket in ArrDump Packet " |
| 91 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
| 92 |
} |
} |
| 93 |
|
delete [] subData; |
| 94 |
} |
} |