OtherMonitorHk.cxx
1 
9 #include "OtherMonitorHk.h"
10 #include "AnitaPacketUtil.h"
11 #include <iostream>
12 #include <fstream>
13 #include <cstring>
14 
15 ClassImp(OtherMonitorHk);
16 
18 {
19  //Default Constructor
20 }
21 
23  //Default Destructor
24 }
25 
26 
27 OtherMonitorHk::OtherMonitorHk(Int_t trun, Int_t trealTime, OtherMonitorStruct_t *otherPtr)
28 {
29  simplePacketCheck(&(otherPtr->gHdr),PACKET_OTHER_MONITOR);
30  run=trun;
31  realTime=trealTime;
32  payloadTime=otherPtr->unixTime;
33  ramDiskInodes=otherPtr->ramDiskInodes;
34  runStartTime=otherPtr->runStartTime;
35  runStartEventNumber=otherPtr->runStartEventNumber;
36  runNumber=otherPtr->runNumber;
37  memcpy(dirFiles,otherPtr->dirFiles,sizeof(UShort_t)*3);
38  memcpy(dirLinks,otherPtr->dirLinks,sizeof(UShort_t)*3);
39  processBitMask=otherPtr->processBitMask;
40  reserved=otherPtr->reserved;
41 
42 }
43 
44 
45 const char *OtherMonitorHk::getDirName(int dirInd)
46 {
47  const char *dirNames[3]={"acqd","eventd","prioritizerd"};
48  if(dirInd<0 || dirInd>2)
49  return "unknown";
50  return dirNames[dirInd];
51 
52 }
53 
54 const char *OtherMonitorHk::getProcName(int procInd)
55 {
56 
57  const char *procName[16]=
58  {"Acqd","Archived","Calibd","Cmdd","Eventd","GPSd","Hkd","LOSd",
59  "Prioritizerd","SIPd","Monitord","Playbackd","Logwatchd","Neobrickd",
60  "n/a","n/a"};
61  if(procInd<0 || procInd>15)
62  return "No Proc";
63  return procName[procInd];
64 }
65 
67 {
68 
69  if(procInd<0 || procInd>15)
70  return 0;
71 
72  return (processBitMask&(1<<procInd) ? 1 : 0) ;
73 
74 }
UShort_t processBitMask
A bit mask of the flight software processes currently running.
UInt_t runStartEventNumber
Start eventNumber of the current run.
OtherMonitorHk()
Default constructor.
const char * getDirName(int dirInd)
Returns dir name.
int isInProcessMask(int procInd)
Returns 1 or 0 if process is in mask.
UShort_t reserved
Reserved.
UInt_t runStartTime
Start time of the current run.
const char * getProcName(int procInd)
Returns process name (using 0 as the index of the first bit).
OtherMonitorStruct_t – Yes.
UShort_t dirLinks[3]
UInt_t ramDiskInodes
Inodes remaining on ramdisk.
UInt_t runNumber
Current run number.
Int_t run
Run number, assigned offline.
UShort_t dirFiles[3]
Number of files in /tmp/anita/acqd /tmp/anita/eventd /tmp/anita/prioritizerd.
UInt_t payloadTime
Time in unixTime.
UInt_t realTime
Time in unixTime.
int simplePacketCheck(GenericHeader_t *gHdr, PacketCode_t code)
simplePacketCheck – utility function
~OtherMonitorHk()
Destructor.
OtherMonitorHk – The other CPU Monitor data.