/[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 2.1 by kusanagi, Fri Sep 24 11:57:32 2004 UTC revision 2.2 by kusanagi, Fri Dec 3 22:04:04 2004 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 2.0 2004/09/21 20:49:57 kusanagi Exp $   * $Id: PscuHeader.cpp,v 2.1 2004/09/24 11:57:32 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;
# Line 77  const PacketType* PscuHeader::GetPacketT Line 71  const PacketType* PscuHeader::GetPacketT
71      case 0x85: return PacketType::TofAlarm;      case 0x85: return PacketType::TofAlarm;
72        
73    default: {    default: {
74      oss.flush();      throw UnidentifiedPacketException(PacketId1);
     oss <<  "\n Unrecognized PacketType: "  
         <<  (int)PacketId1;  
     logger->error(oss.str().c_str());  
     throw Exception("Invalid Packed Id1");  
75    }    }
76    }    }
77  }  }

Legend:
Removed from v.2.1  
changed lines
  Added in v.2.2

  ViewVC Help
Powered by ViewVC 1.1.23