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

Diff of /yoda/techmodel/EventReader.cpp

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

revision 2.9 by kusanagi, Thu Jan 13 08:20:26 2005 UTC revision 2.10 by kusanagi, Wed Feb 9 22:21:24 2005 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Author: kusanagi $   * $Author: kusanagi $
3   * $Date: 2005/01/11 14:59:31 $   * $Date: 2005/01/13 08:20:26 $
4   * $Revision: 2.8 $   * $Revision: 2.9 $
5   *   *
6   * Implementation of the functions of a sample Algorithm class.   * Implementation of the functions of a sample Algorithm class.
7   * This file can be used as a templace to develop your own algorithm.   * This file can be used as a templace to develop your own algorithm.
# Line 88  EventReader::EventReader(int packetsLimi Line 88  EventReader::EventReader(int packetsLimi
88   */   */
89  std::string EventReader::GetVersionInfo(void) const {  std::string EventReader::GetVersionInfo(void) const {
90    return    return
91      "$Header: /home/cvsmanager/yoda/techmodel/EventReader.cpp,v 2.8 2005/01/11 14:59:31 kusanagi Exp $\n";      "$Header: /home/cvsmanager/yoda/techmodel/EventReader.cpp,v 2.9 2005/01/13 08:20:26 kusanagi Exp $\n";
92  }  }
93    
94  /**  /**
# Line 177  void EventReader::RunEvent(int EventNumb Line 177  void EventReader::RunEvent(int EventNumb
177        logger->error("Couldn't read the event. Skipping to the next header. \n");        logger->error("Couldn't read the event. Skipping to the next header. \n");
178      }      }
179      if ((step%1000) == 0) std::cout << step/1000 << "K \n";      if ((step%1000) == 0) std::cout << step/1000 << "K \n";
180        oss.str("");
181        oss << "----endPck " << Header->GetPscuHeader()->GetCounter() << "\n";
182        logger->info(oss.str().c_str());
183    }    }
184      Header->GetCounter()->PrintCounters();      Header->GetCounter()->PrintCounters();
185  }  }
# Line 208  void EventReader::UnpackPscuHeader(void) Line 211  void EventReader::UnpackPscuHeader(void)
211    if (Counter < prevPckCounter){    if (Counter < prevPckCounter){
212      oss.str("");      oss.str("");
213      oss << "Packet counter is less than before of " << (prevPckCounter - Counter);      oss << "Packet counter is less than before of " << (prevPckCounter - Counter);
214      logger->warn(oss.str().c_str());      logger->error(oss.str().c_str());
215      }
216    
217      if (Counter > prevPckCounter + 1){
218        oss.str("");
219        oss << "Packet counter is greater than before of " << (Counter - prevPckCounter);
220        logger->error(oss.str().c_str());
221    }    }
222    
223    if (OrbitalTime < prevPckOBT){    if (OrbitalTime < prevPckOBT){
224      oss.str("");      oss.str("");
225      oss << " Onboard Time is less than before of " << (prevPckOBT - OrbitalTime);      oss << " Onboard Time is less than before of " << (prevPckOBT - OrbitalTime);
226      logger->warn(oss.str().c_str());      logger->error(oss.str().c_str());
227    }    }
228    
229    if (((BYTE)CM_Compute_CRC16(0, (BYTE*)&buff, 15) == (BYTE)buff[15]) && (PacketId1 == PacketId2)){    if (((BYTE)CM_Compute_CRC16(0, (BYTE*)&buff, 15) == (BYTE)buff[15]) && (PacketId1 == PacketId2)){
# Line 240  void EventReader::UnpackPscuHeader(void) Line 249  void EventReader::UnpackPscuHeader(void)
249              }              }
250          if (finalPos > 0 && finalPos < 64) {          if (finalPos > 0 && finalPos < 64) {
251              oss.str("");              oss.str("");
252              oss << "\n Correct packet length: Padded of " << finalPos << " bytes";              oss << "Correct packet length: Padded of " << finalPos << " bytes";
253              logger->debug(oss.str().c_str());              logger->debug(oss.str().c_str());
254          }          }
255          if (finalPos > 64){          if (finalPos > 64){
256              oss.str("");              oss.str("");
257              oss << "\n The begin of the next packet is far more than 64 byte from the end of the previous."              oss << "\n The begin of the next packet is far more than 64 byte from the end of the previous."
258                  << Header->GetPscuHeader()->Print();                  << "\n Below the is the now unpacking packet";
259              logger->error(oss.str().c_str());              logger->error(oss.str().c_str());
260                logger->error(Header->GetPscuHeader()->Print());
261              //throw LengthException("The begin of the next packet is far more than 64 byte from the end of the previous.");              //throw LengthException("The begin of the next packet is far more than 64 byte from the end of the previous.");
262          }          }
263      }      }

Legend:
Removed from v.2.9  
changed lines
  Added in v.2.10

  ViewVC Help
Powered by ViewVC 1.1.23