/* * UConnBiasChannel.hh * * Created on: Apr 28, 2013 * Author: * * This class provides interface that EPICS support will use to monitor * and control bias voltage channels on UCon Tagger Microscope detector. * All methods, including accessors, need to be thread-safe since they * may be executing simultaneously on multiple threads. * */ #ifndef _UCONN_BIAS_CHANNEL_HH_ #define _UCONN_BIAS_CHANNEL_HH_ #include #include #include #include #include class UConnBiasChannel { protected: double ubcSetPoint; double ubcMaxVoltage; double ubcTemp; double ubcRampUp; double ubcRampDown; unsigned ubcStatus; bool ubcEnabled; string ubcAddress; string ubcBoardAddress; // Prevent copying boards UConnBiasChannel( const UConnBiasChannel& chan ) ; UConnBiasChannel& operator=( const UConnBiasChannel& chan ){}; public: // Constructor of a channel with geo-address chanAddress on boards with an // address boardAddress UConnBiasChannel( const std::string boardAddress, const std::string chanAddress ): ubcSetPoint(70), ubcMaxVoltage(100), ubcTemp(22), ubcRampUp(2), ubcRampDown(10), ubcEnabled(false), ubcAddress(chanAddress), ubcBoardAddress(boardAddress) { return ;}; // Destructor ~UConnBiasChannel(){}; // Set and get the setpoints for bias voltage void SetVoltageSetPoint( double voltage ){ubcSetPoint = voltage;}; double GetVoltageSetPoint(){ return ubcSetPoint ;}; // Set and read the firmware limit on bias voltage void SetMaxVoltage( double maxVoltage) { ubcMaxVoltage = maxVoltage;}; double GetMaxVoltage(){ return ubcMaxVoltage;}; // Set and read the ramp-up rate for bias voltage void SetRampUpRate( double rate ){ ubcRampUp = rate; }; double GetRampUpRate(){ return ubcRampUp; }; // Set and read the ramp-down rate for bias voltage void SetRampDownRate( double rate ){ubcRampDown = rate;}; double GetRampDownRate(){ return ubcRampDown; }; // Read the 32-bit status word for this channel uint32_t GetStatus(){ return ubcStatus; }; // Enable, disable this bias channel void Enable(){ ubcEnabled = 1; }; void Disable(){ ubcEnabled = 0; }; bool IsEnabled(){ return ubcEnabled ; }; // Read the temperature value double GetTemperature(){ return ubcTemp ; }; // Get the board address to which this channel belongs to std::string GetBoardAddress(){ return ubcBoardAddress; }; // Get the geographical address of this channel std::string GetChannelAddress(){ return ubcAddress; }; }; #endif /* _UCONN_BIAS_CHANNEL_HH_ */