#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 *DIM_Name; DimService *DIM_ID; DimService *DIM_Temp; DimService *DIM_ROI; DimService *DIM_DAC; 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; short Data[NChips][NChannels][NBins]; short Baseline[NChips][NChannels][NBins]; double Gain[NChips][NChannels][NBins]; float ACalibTemp; time_t ACalibTime; long int 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