/[PAMELA software]/yoda/event/PscuHeader.cpp
ViewVC logotype

Diff of /yoda/event/PscuHeader.cpp

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

revision 1.5 by kusanagi, Tue Sep 21 20:23:37 2004 UTC revision 4.1 by kusanagi, Sat May 28 08:30:01 2005 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Source: /home/cvsmanager/yoda/event/PscuHeader.cpp,v $   * $Source: /home/cvsmanager/yoda/event/PscuHeader.cpp,v $
3   * $Id: PscuHeader.cpp,v 1.4 2004/08/19 15:24:10 kusanagi Exp $   * $Id: PscuHeader.cpp,v 4.0 2005/03/06 04:33:01 kusanagi Exp $
4   * $Author: kusanagi $   * $Author: kusanagi $
5   *   *
6   * Implementation of the PscuHeader class.   * Implementation of the PscuHeader class.
7   */   */
 #include <exception>  
 #include <string>  
 #include <sstream>  
   
8  #include <log4cxx/logger.h>  #include <log4cxx/logger.h>
   
9  #include "PscuHeader.h"  #include "PscuHeader.h"
 #include "Exception.h"  
10    
11  using namespace pamela;  using namespace pamela;
12    
13  static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.PscuHeader"));  static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.PscuHeader"));
14  static std::stringstream oss;  //static std::stringstream oss;
15    
16  /**  /**
17   * Create an PscuHeader object.   * Create an PscuHeader object.
# Line 34  PscuHeader::~PscuHeader() { } Line 28  PscuHeader::~PscuHeader() { }
28  /**  /**
29   * Get the packet type of this header.   * Get the packet type of this header.
30   */   */
31  const PacketType* PscuHeader::GetPacketType(void) const throw (std::exception) {  const PacketType* PscuHeader::GetPacketType(void) const throw (UnidentifiedPacketException) {
32    switch (PacketId1) {    switch (PacketId1) {
33      case 0x07: return PacketType::PhysEndRun;      case 0x07: return PacketType::PhysEndRun;
34      case 0x08: return PacketType::CalibCalPulse1;      case 0x08: return PacketType::CalibCalPulse1;
35      case 0x09: return PacketType::CalibCalPulse2;      case 0x09: return PacketType::CalibCalPulse2;
36      case 0x10: return PacketType::Physics;      case 0x10: return PacketType::Physics;
     case 0x11: return PacketType::CalibTrkBoth;  
37      case 0x12: return PacketType::CalibTrk1;      case 0x12: return PacketType::CalibTrk1;
38      case 0x13: return PacketType::CalibTrk2;      case 0x13: return PacketType::CalibTrk2;
     case 0x15: return PacketType::CalibTrd;  
39      case 0x16: return PacketType::CalibTof;      case 0x16: return PacketType::CalibTof;
40      case 0x17: return PacketType::CalibS4;      case 0x17: return PacketType::CalibS4;
41      case 0x18: return PacketType::CalibCalPed;      case 0x18: return PacketType::CalibCalPed;
42      case 0x19: return PacketType::CalibAc;      case 0x19: return PacketType::Calib1_Ac1;
43        case 0x1A: return PacketType::Calib2_Ac1;
44        case 0x1B: return PacketType::Calib1_Ac2;
45        case 0x1C: return PacketType::Calib2_Ac2;
46      case 0x20: return PacketType::RunHeader;      case 0x20: return PacketType::RunHeader;
47      case 0x21: return PacketType::RunTrailer;      case 0x21: return PacketType::RunTrailer;
48      case 0x22: return PacketType::CalibHeader;      case 0x22: return PacketType::CalibHeader;
# Line 64  const PacketType* PscuHeader::GetPacketT Line 59  const PacketType* PscuHeader::GetPacketT
59      case 0x54: return PacketType::Tmtc;      case 0x54: return PacketType::Tmtc;
60      case 0x55: return PacketType::Mcmd;      case 0x55: return PacketType::Mcmd;
61      case 0x60: return PacketType::ForcedFECmd;      case 0x60: return PacketType::ForcedFECmd;
62      case 0x70: return PacketType::AcInit;      case 0x70: return PacketType::Ac1Init;
63      case 0x71: return PacketType::CalInit;      case 0x71: return PacketType::CalInit;
64      case 0x72: return PacketType::TrkInit;      case 0x72: return PacketType::TrkInit;
65      case 0x73: return PacketType::TofInit;      case 0x73: return PacketType::TofInit;
66      case 0x74: return PacketType::TrgInit;      case 0x74: return PacketType::TrgInit;
67        case 0x75: return PacketType::NdInit;
68        case 0x76: return PacketType::S4Init;
69        case 0x77: return PacketType::Ac2Init;
70      case 0x81: return PacketType::CalAlarm;      case 0x81: return PacketType::CalAlarm;
71      case 0x82: return PacketType::AcAlarm;      case 0x82: return PacketType::AcAlarm;
72      case 0x83: return PacketType::TrkAlarm;      case 0x83: return PacketType::TrkAlarm;
73      case 0x84: return PacketType::TrgAlarm;      case 0x84: return PacketType::TrgAlarm;
74      case 0x85: return PacketType::TofAlarm;      case 0x85: return PacketType::TofAlarm;
75        case 0x86: return PacketType::S4Alarm;
76        case 0xA1: return PacketType::TsbT;
77        case 0xAB: return PacketType::TsbB;
78        
79    default: {    default: {
80      oss.flush();      throw UnidentifiedPacketException(PacketId1);
     oss <<  "\n Unrecognized PacketType: "  
         <<  (int)PacketId1;  
     logger->error(oss.str().c_str());  
     throw Exception("Invalid Packed Id1");  
81    }    }
82    }    }
83  }  }
# Line 88  const PacketType* PscuHeader::GetPacketT Line 85  const PacketType* PscuHeader::GetPacketT
85    
86  ClassImp(PscuHeader)  ClassImp(PscuHeader)
87    
88    

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

  ViewVC Help
Powered by ViewVC 1.1.23