--- yoda/techmodel/TmtcReader.cpp 2004/09/21 20:24:33 1.4 +++ yoda/techmodel/TmtcReader.cpp 2004/12/03 22:08:01 2.1 @@ -1,6 +1,6 @@ /** @file * $Source: /home/cvsmanager/yoda/techmodel/TmtcReader.cpp,v $ - * $Id: TmtcReader.cpp,v 1.3 2004/08/24 16:01:57 kusanagi Exp $ + * $Id: TmtcReader.cpp,v 2.0 2004/09/21 20:50:54 kusanagi Exp $ * $Author: kusanagi $ * * Implementation of the TmtcReader class. @@ -8,9 +8,6 @@ * Control the CRC for the entire data Packet not just for single records */ - - - #include #include extern "C" { @@ -43,7 +40,7 @@ */ std::string TmtcReader::GetVersionInfo(void) const { return - "$Header: /home/cvsmanager/yoda/techmodel/TmtcReader.cpp,v 1.3 2004/08/24 16:01:57 kusanagi Exp $\n"; + "$Header: /home/cvsmanager/yoda/techmodel/TmtcReader.cpp,v 2.0 2004/09/21 20:50:54 kusanagi Exp $\n"; } /** @@ -58,7 +55,7 @@ /** * Unpack the Tmtc event from an input file. */ -void TmtcReader::RunEvent(int EventNumber, long int length) { +void TmtcReader::RunEvent(int EventNumber, long int length) throw (WrongCRCException){ /* //Just to test crc @@ -120,7 +117,7 @@ rec->TM_CC_DIAG_ACQ = (((UINT32)subData[54]<<24)&0xFF000000) + (((UINT32)subData[55]<<16)&0x00FF0000) + (((UINT32)subData[56]<<8)&0x0000FF00) + ((UINT32)subData[57])&0x000000FF; } else { stringstream oss; - oss.flush(); + oss.str(""); oss << "Wrong CRC on Subpacket int TMTC Packet starting at position" << start; logger->warn(oss.str().c_str()); @@ -128,9 +125,7 @@ } InputFile->read(eventCRC, sizeof(eventCRC)); readCRC = (((UINT16)(eventCRC[0]<<8))&0xFF00) + (((UINT16)eventCRC[1])&0x00FF); - if(!(partialCRC == readCRC)) { - logger->warn(_T("The test of calculated CRC with one wrote on file FAILED!!")); - } + if(partialCRC != readCRC) throw WrongCRCException(" Wrong Global CRC for TMTC Packet "); }