Changeset 19585 for trunk/FACT++
- Timestamp:
- 09/01/19 12:23:53 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fscctrl.cc
r19584 r19585 61 61 } 62 62 63 p rivate:63 public: 64 64 // 65 65 // From: http://de.wikipedia.org/wiki/Pt100 66 66 // 67 double GetTempPT1000(double R) const67 static double GetTempPT1000(double R) 68 68 { 69 69 // This is precise within the range 5degC and 25degC … … 83 83 } 84 84 85 private: 85 86 bool CheckChecksum() 86 87 { … … 252 253 humidities.push_back((volt[*ph]-offrh[idx])*0.0313); 253 254 255 254 256 //1019=4.8 255 257 //1005=1.3 … … 257 259 //1300=76 258 260 //DD 2019/09/01: changed from 970 to 980 as sensor 19 had values slighly larger than -7.6 261 262 const auto min = GetTempPT1000(fTempMin); 263 259 264 for (int *pt=mapt; *pt>=0; pt++) 260 temperatures.push_back(resist[*pt]>=fTempMin && resist[*pt]<=fTempMax ? GetTempPT1000(resist[*pt]) : 0); 265 { 266 const bool valid = resist[*pt]>=fTempMin && resist[*pt]<=fTempMax; 267 temperatures.push_back(valid ? GetTempPT1000(resist[*pt]) : 0); 268 269 if (valid && temperatures.back()<min+1) 270 Warn(Tools::Form("Temperature sensor %2d has reading (%d=%.2f degC) closer than 1K to lower limit (%d=%.2f degC)", 271 temperatures.size()-1, resist[*pt], temperatures.back(), fTempMin, min)); 272 273 } 261 274 262 275 // 0 = 3-(3+0)%4 … … 592 605 } 593 606 607 uint16_t GetTempMin() const 608 { 609 return fTempMin; 610 } 611 612 uint16_t GetTempMax() const 613 { 614 return fTempMax; 615 } 616 594 617 bool IsOpen() const 595 618 { … … 637 660 if (temp[i]!=0) 638 661 { 639 if (temp[i]<0)640 Warn(Tools::Form("Temperature sensor %2d has negative temperature (%7.2f deg C)", i, temp[i]));641 642 662 T.emplace_back(temp[i]); 643 663 xy.emplace_back(fPositionsSensors[i]); … … 875 895 fFSC.SetTempMax(conf.Get<uint16_t>("temp-adc-max")); 876 896 897 T::Info(Tools::Form("Accepting temperatures between %.2f degC (%d) and %.2f degC (%d)", 898 S::GetTempPT1000(fFSC.GetTempMin()), fFSC.GetTempMin(), 899 S::GetTempPT1000(fFSC.GetTempMax()), fFSC.GetTempMax())); 900 877 901 const string fname1 = conf.GetPrefixedString("sensor-pos-file"); 878 902 const auto v1 = Interpolator2D::ReadGrid(fname1); … … 919 943 ("patch-pos-file", var<string>()->required(), "File with the positions of the 320 bias patches") 920 944 ("quiet,q", po_bool(true), "Disable printing contents of all received messages (except dynamic data) in clear text.") 921 ("temp-adc-min", var<uint16_t>(uint16_t(980)), "Minimum ADC value for allowed range of temperature ADCs (default ~ -7.4 deg 922 ("temp-adc-max", var<uint16_t>(uint16_t(1300)), "Maximum ADC value for allowed range of temperature ADCs (default ~ 76 deg 945 ("temp-adc-min", var<uint16_t>(uint16_t(980)), "Minimum ADC value for allowed range of temperature ADCs (default ~ -7.4 degC)") 946 ("temp-adc-max", var<uint16_t>(uint16_t(1300)), "Maximum ADC value for allowed range of temperature ADCs (default ~ 76 degC)") 923 947 ; 924 948
Note:
See TracChangeset
for help on using the changeset viewer.