00001 00018 #ifndef _QELE_CHANNEL_CONFIG_HH_ 00019 #define _QELE_CHANNEL_CONFIG_HH_ 00020 00021 #include "QCuore.hh" 00022 #include <ostream> 00023 00024 class QEleChannelConfig { 00025 public: 00026 00028 QEleChannelConfig(); 00029 00031 QEleChannelConfig(const QEleChannelConfig& config); 00032 00034 virtual ~QEleChannelConfig(); 00035 00037 virtual QEleChannelConfig& operator=(const QEleChannelConfig& other); 00038 00041 00043 unsigned int GetLg() const { return fLgChannel; } 00044 00046 unsigned int GetBias() const { return fBias; } 00048 float GetRealBias() const; 00049 00051 unsigned int GetGain() const { return fGain; } 00053 float GetRealGain() const; 00054 00056 bool GetBiasPolarity() const { return fBiasPolarity; } 00057 00059 bool GetLoadResistance() const { return fLoadResistance; } 00061 float GetRealLoadResistance() const; 00062 00067 bool GetIsCold() const { return fIsCold; } 00068 00070 unsigned int GetOffsetDac() const { return fOffDac; } 00072 unsigned int GetOffsetHiBits() const { return fOffHiBits; } 00074 bool GetOffsetSBit() const { return fOffSBit; } 00076 bool GetOffsetPolarity() const { return fOffPolarity; } 00091 float GetRealOffset() const; 00092 00094 float GetExternalBias() const { return fExternalBias; } 00095 00097 float GetRealExternalBias() const { return fExternalBias; } 00098 00100 bool GetAdjustOffset() const { return fAdjustOffset; } 00101 00103 unsigned int GetId() const { return fConfigId; } 00104 00109 bool GetInput() const { return fInput; } 00110 00111 unsigned int GetTestSignalPos() const { return fTestSigPos; } 00112 unsigned int GetTestSignalNeg() const { return fTestSigNeg; } 00114 00115 00116 00117 00121 void SetId(unsigned int id) { fConfigId = id; } 00122 00124 bool SetLg(const unsigned int lg); 00125 00131 bool SetBias(const unsigned int bias); 00132 00138 bool SetGain(const unsigned int gain); 00139 00144 void SetBiasPolarity(const bool polarity) { fBiasPolarity = polarity; } 00145 00147 void InvertBiasPolarity() { fBiasPolarity = !fBiasPolarity; } 00148 00154 bool SetLoadResistance(const bool resistance); 00155 00162 void SetIsCold(bool isCold) 00163 { fIsCold = isCold; if(isCold) fLoadResistance = true; } 00164 00174 bool SetOffset(const unsigned int dacBits, 00175 const unsigned int hBits, 00176 const bool polarity, 00177 const bool sBit); 00178 00184 bool SetOffsetDac(unsigned int dacBits); 00185 00191 bool SetOffsetHiBits(unsigned int hiBits); 00192 00197 void SetOffsetPolarity(bool polarity) 00198 { fOffPolarity = polarity; fAdjustOffset = false; } 00199 00204 void SetOffsetSBit(bool sBit) 00205 { fOffSBit = sBit; fAdjustOffset = false; } 00206 00213 void SetAdjustOffset(); 00214 00216 void SetExternalBias(float externalBias) { fExternalBias = externalBias; } 00217 00219 void SetRealExternalBias(float realExtBias) 00220 { fRealExternalBias = realExtBias; } 00221 00226 void SetInput(bool input) { fInput = input; } 00227 00232 bool SetTestSignalPos(unsigned int posValue); 00237 bool SetTestSignalNeg(unsigned int negValue); 00242 void Dump(std::ostream& o) const; 00243 00245 bool operator<(const QEleChannelConfig& other) const 00246 { return this->fLgChannel < other.fLgChannel; } 00247 00254 bool operator==(const QEleChannelConfig& other) const; 00255 00256 protected: 00257 00258 unsigned int fLgChannel; 00259 unsigned int fConfigId; 00260 unsigned int fBias; 00261 unsigned int fGain; 00262 bool fBiasPolarity; 00263 bool fLoadResistance; 00264 unsigned int fOffDac; 00265 unsigned int fOffHiBits; 00270 bool fOffSBit; 00271 bool fOffPolarity; 00273 float fExternalBias; 00275 float fRealExternalBias; 00280 bool fAdjustOffset; 00281 00283 bool fInput; 00284 00285 unsigned int fTestSigPos; 00286 unsigned int fTestSigNeg; 00289 bool fIsCold; 00290 00291 }; 00292 #endif // _QELE_CHANNEL_CONFIG_HH_