/[PAMELA software]/yoda/techmodel/McmdReader.cpp
ViewVC logotype

Diff of /yoda/techmodel/McmdReader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by kusanagi, Tue Sep 21 20:24:33 2004 UTC revision 6.0 by kusanagi, Tue Feb 7 17:11:09 2006 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Source: /home/cvsmanager/yoda/techmodel/McmdReader.cpp,v $   * $Source: /home/cvsmanager/yoda/techmodel/McmdReader.cpp,v $
3   * $Id: McmdReader.cpp,v 1.4 2004/08/26 08:21:31 kusanagi Exp $   * $Id: McmdReader.cpp,v 5.1 2006/02/04 12:37:45 kusanagi Exp $
4   * $Author: kusanagi $   * $Author: kusanagi $
5   *   *
6   * Implementation of the McmdReader class.   * Implementation of the McmdReader class.
# Line 39  McmdReader::McmdReader(void): Line 39  McmdReader::McmdReader(void):
39   */   */
40  std::string McmdReader::GetVersionInfo(void) const {  std::string McmdReader::GetVersionInfo(void) const {
41    return    return
42      "$Header: /home/cvsmanager/yoda/techmodel/McmdReader.cpp,v 1.4 2004/08/26 08:21:31 kusanagi Exp $\n";      "$Header: /home/cvsmanager/yoda/techmodel/McmdReader.cpp,v 5.1 2006/02/04 12:37:45 kusanagi Exp $\n";
43  }  }
44    
45  /**  /**
# Line 75  void McmdReader::Init(PamelaRun *run) { Line 75  void McmdReader::Init(PamelaRun *run) {
75   * @Event Number   * @Event Number
76   * @length is the size in bytes of the event (or packet)   * @length is the size in bytes of the event (or packet)
77   */   */
78  void McmdReader::RunEvent(int EventNumber, long int length) {  void McmdReader::RunEvent(int EventNumber, long int length) throw (WrongCRCException){
79        
80    int i = 0;    int i = 0;
81    char OBT[4];    char OBT[4];
# Line 166  void McmdReader::RunEvent(int EventNumbe Line 166  void McmdReader::RunEvent(int EventNumbe
166          rec->endID           = (BYTE)subTrailer[1];          rec->endID           = (BYTE)subTrailer[1];
167    
168          rec->McmdData        = new TArrayC(dataLength, subData);          rec->McmdData        = new TArrayC(dataLength, subData);
         //memcpy(rec->McmdData, (BYTE*)subData, sizeof(rec->McmdData));  
         //rec->setMcmdData((BYTE*)&subData);  
169          delete [] subData;          delete [] subData;
170      } else {      } else {
171              oss.flush();              oss.str("");
172              oss << "Wrong CRC on Subpacket internal to TMTC Packet starting at position"              oss << "Wrong CRC on Subpacket internal to TMTC Packet starting at position"
173                  << start;                  << start;
174              logger->warn(oss.str().c_str());              logger->warn(oss.str().c_str());
# Line 180  void McmdReader::RunEvent(int EventNumbe Line 178  void McmdReader::RunEvent(int EventNumbe
178      InputFile->read(eventCRC, sizeof(eventCRC));      InputFile->read(eventCRC, sizeof(eventCRC));
179      readCRC = (((UINT16)(eventCRC[0]<<8))&0xFF00) + (((UINT16)eventCRC[1])&0x00FF);      readCRC = (((UINT16)(eventCRC[0]<<8))&0xFF00) + (((UINT16)eventCRC[1])&0x00FF);
180            
181      if(!(partialCRC == readCRC)) {      if(partialCRC != readCRC) throw WrongCRCException(" Wrong Global CRC for MCMD Packet ");
182          logger->warn(_T("The test of calculated CRC with one wrote on file FAILED!!"));      /*if(!(partialCRC == readCRC)) {
183      }          throw WrongCRCException();
184        }*/
185  }  }
186    
187    

Legend:
Removed from v.1.5  
changed lines
  Added in v.6.0

  ViewVC Help
Powered by ViewVC 1.1.23