00001 00019 #ifndef _QLC_SLOW_CONFIG_HH_ 00020 #define _QLC_SLOW_CONFIG_HH_ 00021 00022 #include "QCuore.hh" 00023 #include <ostream> 00024 00025 class QLCSlowConfig { 00026 public: 00027 00029 QLCSlowConfig(); 00030 00031 QLCSlowConfig(const QLCSlowConfig& config); 00032 00034 virtual ~QLCSlowConfig(); 00035 00036 00039 00041 unsigned short GetLg() const { return fLgChannel; } 00042 00044 unsigned short GetBias() const { return fBias; } 00046 float GetRealBias() const; 00047 00049 unsigned short GetGain() const { return fGain; } 00051 float GetRealGain() const; 00052 00054 bool GetBiasPolarity() const { return fBiasPolarity; } 00055 00057 bool GetLoadResistance() const { return fLoadResistance; } 00059 float GetRealLoadResistance() const; 00060 00062 unsigned short GetOffsetDac() const { return fOffDac; } 00064 unsigned short GetOffsetHiBits() const { return fOffHiBits; } 00066 bool GetOffsetSBit() const { return fOffSBit; } 00068 bool GetOffsetPolarity() const { return fOffPolarity; } 00083 float GetRealOffset() const; 00084 00086 float GetExternalBias() const { return fExternalBias; } 00087 00089 float GetRealExternalBias() const { return fExternalBias; } 00090 00091 bool GetAdjustOffset() const { return fAdjustOffset; } 00092 00094 unsigned int GetId() const { return fConfigId; } 00095 00097 bool GetInput() const { return fInput; } 00098 00100 00101 00102 00103 00106 00108 bool SetLg(const unsigned short lg); 00109 00111 bool SetBias(const unsigned short bias); 00112 00117 bool SetGain(const unsigned short gain); 00118 00123 void SetBiasPolarity(const bool polarity) { fBiasPolarity = polarity; } 00124 00126 void SetLoadResistance(const bool resistance) 00127 { fLoadResistance = resistance; } 00128 00138 bool SetOffset(const unsigned short dacBits, 00139 const unsigned short hBits, 00140 const bool polarity, 00141 const bool sBit); 00142 00149 void SetAdjustOffset(); 00150 00152 void SetExternalBias(float externalBias) { fExternalBias = externalBias; } 00153 00155 void SetRealExternalBias(float realExtBias) 00156 { fRealExternalBias = realExtBias; } 00158 00160 void SetInput(bool input) { fInput = input; } 00162 void Dump(std::ostream& o) const; 00163 00165 bool operator<(const QLCSlowConfig& other) const { return this->fLgChannel < other.fLgChannel; } 00166 00168 bool operator==(const QLCSlowConfig& other) const; 00169 00170 protected: 00171 00172 unsigned short fLgChannel; 00174 unsigned int fConfigId; 00176 unsigned short fBias; 00177 unsigned short fGain; 00178 bool fBiasPolarity; 00179 bool fLoadResistance; 00180 unsigned short fOffDac; 00181 unsigned short fOffHiBits; 00188 bool fOffSBit; 00189 bool fOffPolarity; 00191 float fExternalBias; 00193 float fRealExternalBias; 00198 bool fAdjustOffset; 00199 00200 /* put the FE to the ground resistances false = BOLO, true = TEST*/ 00201 bool fInput; 00202 00203 friend class QLCSlowConfigHandler; 00204 friend class QWPSlowConfigHandler; 00205 }; 00206 #endif // _QLC_SLOW_CONFIG_HH_