--- yoda/techmodel/ForcedFECmdReader.cpp 2004/08/19 15:24:46 1.1 +++ yoda/techmodel/ForcedFECmdReader.cpp 2006/09/29 10:19:23 6.1 @@ -1,35 +1,23 @@ +/** @file + * $Author: kusanagi $ + * $Date: 2006/02/07 17:11:09 $ + * $Revision: 6.0 $ + * + * Implementation of the ForcedFECmdReader class. + */ -// Implementation of the ForcedFECmdReader class. - - -#define UINT unsigned int -#define BYTE unsigned char -#include -#include -extern "C" { -#include -#include "CRC.h" -} - -#include -#include "stdio.h" #include "ReaderAlgorithms.h" -#include "event/ForcedFECmdEvent.h" - -using namespace pamela; using namespace pamela::techmodel; -static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.ForcedFECmdReader"); +static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.ForcedFECmdReader")); /** * Constructor. */ ForcedFECmdReader::ForcedFECmdReader(void): TechmodelAlgorithm(PacketType::ForcedFECmd, "TechmodelForcedFECmdReader") { - cat << log4cpp::Priority::DEBUG - << "Constructor " - << "\n " << log4cpp::CategoryStream::ENDLINE; + logger->debug(_T("Constructor")); forcedFECmd = new ForcedFECmdEvent(); } @@ -38,7 +26,7 @@ */ std::string ForcedFECmdReader::GetVersionInfo(void) const { return - "$Trailer: /home/cvsmanager/yoda/techmodel/ForcedFECmdReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $\n"; + "$Trailer: /home/cvsmanager/yoda/techmodel/ForcedFECmdReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 Maurizio Nagni Exp $\n"; } /** @@ -46,15 +34,21 @@ * event reader routines for all packet types. */ void ForcedFECmdReader::Init(PamelaRun *run) { + logger->debug(_T("Initialize")); SetInputStream(run); run->WriteSubPacket(this, &forcedFECmd, forcedFECmd->Class()); } /** * Unpack the ForcedFECmd event from an input file. + * The CPU does not add any CRC control at the packet end. + * @param EventNumber + * @param dataLength */ -void ForcedFECmdReader::RunEvent(int EventNumber, long int length) { - - +void ForcedFECmdReader::RunEvent(int EventNumber, long int dataLength) throw (WrongCRCException){ + char subData[dataLength]; + memset(subData, 0, dataLength*sizeof(char)); + InputFile->read(subData, sizeof(subData)); + forcedFECmd->forcedFECmdData = new TArrayC(dataLength, subData); }