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 3.0 2005/03/04 15:54:11 kusanagi Exp $ |
* $Id: TabDumpReader.cpp,v 6.1 2006/05/30 19:10:02 kusanagi Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the TabDumpReader class. |
* Implementation of the TabDumpReader class. |
7 |
*/ |
*/ |
8 |
|
|
|
#include <string> |
|
|
#include <log4cxx/logger.h> |
|
|
#include <fstream> |
|
|
#include "stdio.h" |
|
9 |
extern "C" { |
extern "C" { |
10 |
#include "CRC.h" |
#include "CRC.h" |
11 |
} |
} |
12 |
#include "ReaderAlgorithms.h" |
#include "ReaderAlgorithms.h" |
|
|
|
|
using namespace pamela; |
|
13 |
using namespace pamela::techmodel; |
using namespace pamela::techmodel; |
14 |
|
|
15 |
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.TabDumpReader")); |
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.TabDumpReader")); |
27 |
* Get a string with the version info of the algorithm. |
* Get a string with the version info of the algorithm. |
28 |
*/ |
*/ |
29 |
std::string TabDumpReader::GetVersionInfo(void) const { |
std::string TabDumpReader::GetVersionInfo(void) const { |
30 |
return "$Header: /home/cvsmanager/yoda/techmodel/TabDumpReader.cpp,v 3.0 2005/03/04 15:54:11 kusanagi Exp $\n"; |
return "$Header: /home/cvsmanager/yoda/techmodel/TabDumpReader.cpp,v 6.1 2006/05/30 19:10:02 kusanagi Exp $\n"; |
31 |
} |
} |
32 |
|
|
33 |
/** |
/** |
54 |
subCRC = CM_Compute_CRC16(0, (UINT8*)subData, dataLength); |
subCRC = CM_Compute_CRC16(0, (UINT8*)subData, dataLength); |
55 |
readCRC = (((UINT16)(subData[length - 2]<<8))&0xFF00) + (((UINT16)subData[length - 1])&0x00FF); |
readCRC = (((UINT16)(subData[length - 2]<<8))&0xFF00) + (((UINT16)subData[length - 1])&0x00FF); |
56 |
|
|
57 |
//if (subCRC != readCRC) throw WrongCRCException(" Wrong CRC for TabDump Packet "); |
if (subCRC != readCRC) throw WrongCRCException(" Wrong CRC for TabDump Packet "); |
58 |
if (subCRC != readCRC) { |
/*if (subCRC != readCRC) { |
59 |
logger->error("WRONG CRC FOR TabDump PACKET. Processed anyway for CPU debugging"); |
logger->error("WRONG CRC FOR TabDump PACKET. Processed anyway for CPU debugging"); |
60 |
} |
}*/ |
61 |
|
|
62 |
TabDumpRecord* rec; |
TabDumpRecord* rec; |
63 |
TabDump->PARAMETER_STAMP = (((UINT32)subData[0]<<24)&0xFF000000) + (((UINT32)subData[1]<<16)&0x00FF0000) + (((UINT32)subData[2]<<8)&0x0000FF00) + (((UINT32)subData[3])&0x000000FF); |
TabDump->PARAMETER_STAMP = (((UINT32)subData[0]<<24)&0xFF000000) + (((UINT32)subData[1]<<16)&0x00FF0000) + (((UINT32)subData[2]<<8)&0x0000FF00) + (((UINT32)subData[3])&0x000000FF); |