$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_FESlowControlsChannel_h_ 00002 #define _ots_FESlowControlsChannel_h_ 00003 00004 #include <iostream> 00005 #include <string> 00006 00007 namespace ots 00008 { 00009 class FESlowControlsChannel 00010 { 00011 public: 00012 FESlowControlsChannel(const std::string& interfaceUID, 00013 const std::string& channelName, 00014 const std::string& dataType, 00015 unsigned int universalDataSize, 00016 unsigned int universalAddressSize, 00017 const std::string& universalAddress, 00018 unsigned int universalDataBitOffset, 00019 bool readAccess, 00020 bool writeAccess, 00021 bool monitoringEnabled, 00022 bool recordChangesOnly, 00023 time_t delayBetweenSamples, 00024 bool saveEnabled, 00025 const std::string& savePath, 00026 const std::string& saveFileRadix, 00027 bool saveBinaryFormat, 00028 bool alarmsEnabled, 00029 bool latchAlarms, 00030 const std::string& lolo, 00031 const std::string& lo, 00032 const std::string& hi, 00033 const std::string& hihi); 00034 00035 ~FESlowControlsChannel(); 00036 00037 char* getUniversalAddress() { return &universalAddress_[0]; } 00038 void handleSample(const std::string& universalReadValue, 00039 std::string& txBuffer, 00040 FILE* fpAggregate = 0, 00041 bool aggregateIsBinaryFormat = false); 00042 void clearAlarms(int targetAlarm = -1); // default to all 00043 00044 static std::string underscoreString(const std::string& str); 00045 00046 private: 00047 void extractSample(const std::string& universalReadValue); 00048 char checkAlarms(std::string& txBuffer); 00049 void convertStringToBuffer(const std::string& inString, 00050 std::string& buffer, 00051 bool useDataType = false); 00052 00053 public: 00054 const std::string interfaceUID_; 00055 const std::string channelName_; 00056 const std::string fullChannelName_; 00057 const std::string dataType_; 00058 00059 private: 00060 std::string universalAddress_; // get size from parent FE interface 00061 unsigned int sizeOfDataTypeBits_; // defines the size of all data string buffers, 00062 // must be less than or equal to universalDataSize 00063 unsigned int sizeOfDataTypeBytes_; 00064 unsigned int universalDataBitOffset_; 00065 unsigned char txPacketSequenceNumber_; 00066 00067 public: 00068 const bool readAccess_, writeAccess_, monitoringEnabled_; 00069 const bool recordChangesOnly_; 00070 const time_t delayBetweenSamples_; 00071 00072 const bool saveEnabled_; 00073 const std::string savePath_; 00074 const std::string saveFileRadix_; 00075 const bool saveBinaryFormat_; 00076 00077 const bool alarmsEnabled_, latchAlarms_; 00078 00079 private: 00080 std::string sample_, lastSample_; 00081 std::string lolo_, lo_, hi_, hihi_; 00082 time_t lastSampleTime_; 00083 bool loloAlarmed_, loAlarmed_, hiAlarmed_, hihiAlarmed_; 00084 00085 std::string saveFullFileName_; 00086 }; 00087 00088 } // namespace ots 00089 00090 #endif