| 1 |
/** @file |
/** @file |
| 2 |
* $Source: /home/cvsmanager/yoda/techmodel/TabDumpReader.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/TabDumpReader.cpp,v $ |
| 3 |
* $Id: TabDumpReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $ |
* $Id: TabDumpReader.cpp,v 1.4 2004/08/24 16:01:57 kusanagi Exp $ |
| 4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
| 5 |
* |
* |
| 6 |
* Implementation of the TabDumpReader class. |
* Implementation of the TabDumpReader class. |
| 32 |
* Get a string with the version info of the algorithm. |
* Get a string with the version info of the algorithm. |
| 33 |
*/ |
*/ |
| 34 |
std::string TabDumpReader::GetVersionInfo(void) const { |
std::string TabDumpReader::GetVersionInfo(void) const { |
| 35 |
return "$Header: /home/cvsmanager/yoda/techmodel/TabDumpReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $\n"; |
return "$Header: /home/cvsmanager/yoda/techmodel/TabDumpReader.cpp,v 1.4 2004/08/24 16:01:57 kusanagi Exp $\n"; |
| 36 |
} |
} |
| 37 |
|
|
| 38 |
/** |
/** |
| 71 |
TabDumpRecord* rec; |
TabDumpRecord* rec; |
| 72 |
long int offset = 0; |
long int offset = 0; |
| 73 |
int i = 0; |
int i = 0; |
| 74 |
|
int size; |
| 75 |
TabDump->Records->Clear(); |
TabDump->Records->Clear(); |
| 76 |
TClonesArray &recs = *(TabDump->Records); |
TClonesArray &recs = *(TabDump->Records); |
| 77 |
while (offset < dataLength){ |
while (offset < dataLength){ |
| 78 |
rec = new(recs[i++]) TabDumpRecord(); //add a new TabDump |
rec = new(recs[i++]) TabDumpRecord(); //add a new TabDump |
| 79 |
rec->Tab_ID = ((UINT8)subData[offset])&0xFF; |
rec->Tab_ID = ((UINT8)subData[offset])&0xFF; |
| 80 |
rec->Nrow = ((UINT8)subData[offset+1])&0xFF; |
rec->Nrow = ((UINT8)subData[offset+1])&0xFF; |
| 81 |
rec->Ncol = ((UINT8)subData[offset+2])&0xFF; |
rec->Ncol = ((UINT8)subData[offset+2])&0xFF; |
| 82 |
memcpy(rec->Data, subData+offset+3, sizeof(UINT32)*((rec->Nrow)+(rec->Ncol))); |
//rec->Data = new UINT32[(rec->Nrow)*(rec->Ncol)]; |
| 83 |
offset = offset + (sizeof(UINT32)*((rec->Nrow)+(rec->Ncol))) + 3; |
size = sizeof(UINT32)*(rec->Nrow)*(rec->Ncol); |
| 84 |
|
rec->Data = new TArrayI((int)((rec->Nrow)*(rec->Ncol)), (int*)(subData+offset+3)); |
| 85 |
|
//memcpy(rec->Data, (UINT32*)(subData+offset+3), size); |
| 86 |
|
offset = offset + size + 3; |
| 87 |
} |
} |
|
free(subData); |
|
| 88 |
} else { |
} else { |
| 89 |
cat << log4cpp::Priority::ERROR |
cat << log4cpp::Priority::ERROR |
| 90 |
<< "Wrong CRC on Subpacket in TabDump Packet " |
<< "Wrong CRC on Subpacket in TabDump Packet " |
| 91 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
| 92 |
} |
} |
| 93 |
|
delete [] subData; |
| 94 |
} |
} |