Changeset 13553 for trunk/FACT++/src
- Timestamp:
- 05/03/12 22:51:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/feedback.cc
r13482 r13553 204 204 205 205 // Convert from DAC counts to uA 206 const double conv = 5000 e-6/4096;206 const double conv = 5000./4096; 207 207 208 208 // 3900 Ohm/n + 1000 Ohm + 1100 Ohm (with n=4 or n=5) … … 237 237 238 238 // Average measured current 239 const double Im = double(fCurrentsAvg[i])/fCursorCur * conv; // [ A]239 const double Im = double(fCurrentsAvg[i])/fCursorCur * conv; // [uA] 240 240 241 241 // Group index (0 or 1) of the of the pixel (4 or 5 pixel patch) … … 258 258 // Offset at the calibration point (make sure that the calibration is 259 259 // valid (Im[i]>Iavg[i]) and we operate above the calibration point) 260 const double I = Im>Iavg[i] ? Im - Iavg[i] *1e-6 : 0; // [A]260 const double I = Im>Iavg[i] ? Im - Iavg[i] : 0; // [uA] 261 261 262 262 // Make sure that the averaged resistor is valid 263 const double dU = Ravg[i]>0 ? r*(I +dI) : 0;263 const double dU = Ravg[i]>0 ? r*(I*1e-6+dI) : 0; 264 264 265 265 vec[i+BIAS::kNumChannels] += dU; … … 872 872 } 873 873 874 void WarnState(bool needfsc, bool needfad) 875 { 876 const bool bias = fStatusBias.second >= BIAS::kConnecting; 877 const bool fsc = fStatusFSC.second >= 2; 878 const bool fad = fStatusFAD.second >= FAD::kConnected; 879 880 if (!bias) 881 Warn("Bias control not yet ready."); 882 if (needfsc && !fsc) 883 Warn("FSC control not yet ready."); 884 if (needfad && !fad) 885 Warn("FAD control not yet ready."); 886 } 887 874 888 int SetConstant(const EventImp &evt, int constant) 875 889 { … … 934 948 return kSM_FatalError; 935 949 950 WarnState(false, true); 951 936 952 ResetData(evt.GetShort()); 937 953 … … 946 962 return kSM_FatalError; 947 963 964 WarnState(false, true); 965 948 966 ResetData(evt.GetShort()); 949 967 … … 957 975 if (!CheckEventSize(evt.GetSize(), "StartTempCtrl", 4)) 958 976 return kSM_FatalError; 977 978 WarnState(true, false); 959 979 960 980 fBiasOffset = evt.GetFloat(); … … 981 1001 return GetCurrentState(); 982 1002 } 1003 1004 WarnState(true, false); 983 1005 984 1006 ResetData(0); … … 1067 1089 } 1068 1090 1091 WarnState(true, false); 1092 1069 1093 ostringstream out; 1070 out << "Starting temperature feedback for calibration with an offset of -2V";1094 out << "Starting temperature feedback for calibration with an offset of " << fCalibrationOffset << "V"; 1071 1095 Message(out); 1072 1096
Note:
See TracChangeset
for help on using the changeset viewer.