#ifndef FADBoard_H_SEEN #define FADBoard_H_SEEN #include #include #include #include #include #include #include #include #include #include #include #include #include "FAD.h" #include "FADFormat.h" const unsigned int READ_BUFFER_SIZE = 1000000; class FADBoard { class FAD *m; int Socket; char *Name; pthread_t Thread; pthread_mutex_t Mutex; DimService *NameService; DimService *IDService; DimService *TempService; DimService *ROIService; DimService *DACService; void ReadLoop(); static void LaunchThread(class FADBoard *); public: FADBoard(std::string, unsigned short, class FAD *, unsigned int); ~FADBoard(); struct BoardStatus { unsigned short BoardID; unsigned long TriggerID; unsigned char TriggerType; unsigned short TriggerCell[NChips]; unsigned short ROI[NChips][NChannels]; unsigned short DAC[NDAC]; float Temp[NTemp]; struct timeval Update; } Status; unsigned short Data[NChips][NChannels][NBins]; double Baseline[NChips][NChannels][NBins]; double Gain[NChips][NChannels][NBins]; float ACalibTemp; time_t ACalibTime; double Sum[NChips][NChannels][NBins]; unsigned int NumForSum; bool DoSum; void Send(const void *, size_t); void Send(unsigned short); struct BoardStatus GetStatus(); void AccumulateSum(unsigned int); void Lock(); void Unlock(); bool InitOK; bool CommError; bool Active; }; #endif