00001 #ifndef BASE_SYSCOREPROC_H 00002 #define BASE_SYSCOREPROC_H 00003 00004 #include "base/StreamProc.h" 00005 00006 namespace base { 00007 00015 class SysCoreProc : public base::StreamProc { 00016 00017 protected: 00018 unsigned fBrdId; 00019 00020 unsigned fSyncSource; // 0,1: SYNC0,1 used for synchronization, >=2: local time used for time stamp 00021 unsigned fTriggerSignal; // 0 .. 3 is AUXs, 10-11 is SYNCs 00022 00023 int fNumPrintMessages; 00024 double fPrintLeft; 00025 double fPrintRight; 00026 bool fAnyPrinted; 00027 00028 base::H1handle fMsgPerBrd; 00029 base::H1handle fALLt; 00030 base::H1handle fAUXt[4]; 00031 base::H1handle fSYNCt[2]; 00032 00033 static unsigned fMaxBrdId; 00034 00037 virtual bool doTriggerSelection() const { return (fTriggerSignal < 4) || (fTriggerSignal==10) || (fTriggerSignal==11); } 00038 00039 void CreateBasicHistograms(); 00040 00041 void FillMsgPerBrdHist(unsigned cnt) { FillH1(fMsgPerBrd, GetBoardId(), cnt); } 00042 00043 public: 00044 00045 SysCoreProc(const char* name, unsigned brdid); 00046 virtual ~SysCoreProc(); 00047 00049 unsigned GetBoardId() const { return fBrdId; } 00050 00054 void SetSyncSource(unsigned id) 00055 { 00056 fSyncSource = id; 00057 fIsSynchronisationRequired = fSyncSource < 2; 00058 } 00059 00063 void SetNoSyncSource() { SetSyncSource(0xff); } 00064 00068 void SetTriggerSignal(unsigned id) { fTriggerSignal = id; } 00069 00071 void SetNoTriggerSignal() { fTriggerSignal = 99; } 00072 00073 00077 void SetPrint(int nummsg, double left = -1., double right = -1.) 00078 { 00079 fNumPrintMessages = nummsg; 00080 fPrintLeft = left; 00081 fPrintRight = right; 00082 fAnyPrinted = false; 00083 } 00084 00086 static void SetMaxBrdId(unsigned max) { fMaxBrdId = max; } 00087 00088 }; 00089 } 00090 00091 #endif