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

Diff of /yoda/event/PscuHeader.h

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

revision 2.1 by kusanagi, Fri Dec 3 22:04:04 2004 UTC revision 6.2 by mocchiut, Thu Nov 16 10:49:39 2006 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Source: /home/cvsmanager/yoda/event/PscuHeader.h,v $   * $Source: /afs/ba.infn.it/user/pamela/src/CVS/yoda/event/PscuHeader.h,v $
3   * $Id: PscuHeader.h,v 2.0 2004/09/21 20:49:57 kusanagi Exp $   * $Id: PscuHeader.h,v 6.1 2006/09/29 10:19:13 mocchiut Exp $
4   * $Author: kusanagi $   * $Author: mocchiut $
5   *   *
6   * Header file for the PscuHeader class.   * Header file for the PscuHeader class.
7   */   */
# Line 16  namespace pamela { Line 16  namespace pamela {
16     * Class containing the PSCU header and trailer information.     * Class containing the PSCU header and trailer information.
17     */     */
18    class PscuHeader: public pamela::SubPacket {    class PscuHeader: public pamela::SubPacket {
19    
20    private:    private:
21    
22    public:    public:
# Line 35  namespace pamela { Line 36  namespace pamela {
36      UINT32 FileOffset;      UINT32 FileOffset;
37            
38      PscuHeader();      PscuHeader();
39      virtual ~PscuHeader();      virtual ~PscuHeader(){};
40      const pamela::PacketType* GetPacketType(void) const throw(UnidentifiedPacketException);      const pamela::PacketType* GetPacketType(void) const throw(UnidentifiedPacketException);
41      /** Get the Header. */      /** Get the Header. */
42      int GetHeader(void) const { return Header; }      int GetHeader(void) const { return Header; }
# Line 67  namespace pamela { Line 68  namespace pamela {
68      /** Set the packet length. Intended to use by the raw reader. */      /** Set the packet length. Intended to use by the raw reader. */
69      void SetCRC(short var) { CRC = var; }      void SetCRC(short var) { CRC = var; }
70      /** Get the offset of the packet relative to the begin of the raw file. */      /** Get the offset of the packet relative to the begin of the raw file. */
71      int SetFileOffset(int var) { FileOffset = var; }      int SetFileOffset(unsigned long int var) { if ( var > numeric_limits<unsigned int>::max() ) var -= numeric_limits<unsigned int>::max() ;FileOffset = (unsigned int)var; return(0); }
72    
73      const char* Print(){      const char* Print(){
74          oss.str("");          oss.str("");
# Line 80  namespace pamela { Line 81  namespace pamela {
81          return oss.str().c_str();          return oss.str().c_str();
82      }      }
83    
84      ClassDef(PscuHeader, 1)    static const char* Print(char* buff){
85          static stringstream out;
86            out.str("");
87        out <<  "\n Packet Counter          : "  <<  hex << (((UINT32)buff[5]<<16)&0x00FF0000) + (((UINT32)buff[6]<<8)&0x0000FF00) + (((UINT32)buff[7])&0x000000FF)
88            <<  "\n Id1 - Id2               : "  <<  hex << (UINT16)buff[3] <<  " - " << hex << (UINT16)buff[4]
89            <<  "\n Orbital Time            : "  <<  hex << (((UINT32)buff[8]<<24)&0xFF000000) + (((UINT32)buff[9]<<16)&0x00FF0000) +  (((UINT32)buff[10]<<8)&0x0000FF00) + (((UINT32)buff[11])&0x000000FF)
90            <<  "\n Lenght                  : "  <<  hex << (((UINT32)buff[12]<<16)&0x00FF0000) +  (((UINT32)buff[13]<<8)&0x0000FF00) + (((UINT32)buff[14])&0x000000FF)
91            <<  "\n CRC                     : "  <<  hex << (UINT16)buff[15];
92        return out.str().c_str();
93      }
94            
95        ClassDef(PscuHeader, 1)
96    };    };
97  }  }
98    

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

  ViewVC Help
Powered by ViewVC 1.1.23