--- yoda/techmodel/TmtcReader.cpp 2004/08/24 16:01:57 1.3 +++ yoda/techmodel/TmtcReader.cpp 2004/09/21 20:24:33 1.4 @@ -1,6 +1,6 @@ /** @file * $Source: /home/cvsmanager/yoda/techmodel/TmtcReader.cpp,v $ - * $Id: TmtcReader.cpp,v 1.2 2004/07/17 20:03:38 kusanagi Exp $ + * $Id: TmtcReader.cpp,v 1.3 2004/08/24 16:01:57 kusanagi Exp $ * $Author: kusanagi $ * * Implementation of the TmtcReader class. @@ -12,7 +12,7 @@ #include -#include +#include extern "C" { #include #include "CRC.h" @@ -27,16 +27,14 @@ using namespace pamela; using namespace pamela::techmodel; -static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.TmtcReader"); +static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.TmtcReader")); /** * Constructor. */ TmtcReader::TmtcReader(void): TechmodelAlgorithm(PacketType::Tmtc, "TechmodelTmtcReader") { - cat << log4cpp::Priority::DEBUG - << "Constructor " - << "\n " << log4cpp::CategoryStream::ENDLINE; + logger->debug(_T("Constructor")); Tmtc = new TmtcEvent(); } @@ -45,7 +43,7 @@ */ std::string TmtcReader::GetVersionInfo(void) const { return - "$Header: /home/cvsmanager/yoda/techmodel/TmtcReader.cpp,v 1.2 2004/07/17 20:03:38 kusanagi Exp $\n"; + "$Header: /home/cvsmanager/yoda/techmodel/TmtcReader.cpp,v 1.3 2004/08/24 16:01:57 kusanagi Exp $\n"; } /** @@ -121,17 +119,17 @@ rec->TM_BIL_DIAG_ACQ = subData[53]; 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 { - cat << log4cpp::Priority::ERROR - << "Wrong CRC on Subpacket int TMTC Packet starting at position " << start - << "\n " << log4cpp::CategoryStream::ENDLINE; + stringstream oss; + oss.flush(); + oss << "Wrong CRC on Subpacket int TMTC Packet starting at position" + << start; + logger->warn(oss.str().c_str()); } } InputFile->read(eventCRC, sizeof(eventCRC)); readCRC = (((UINT16)(eventCRC[0]<<8))&0xFF00) + (((UINT16)eventCRC[1])&0x00FF); if(!(partialCRC == readCRC)) { - cat << log4cpp::Priority::ERROR - << "The test of calculated CRC with one wrote on file FAILED!!" - << "\n " << log4cpp::CategoryStream::ENDLINE; + logger->warn(_T("The test of calculated CRC with one wrote on file FAILED!!")); } }