Changeset 19584 for trunk/FACT++
- Timestamp:
- 09/01/19 11:27:41 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fscctrl.cc
r19458 r19584 32 32 bool fIsVerbose; 33 33 bool fIsAutoReconnect; 34 35 uint16_t fTempMin; 36 uint16_t fTempMax; 34 37 35 38 size_t fNumConsecutiveErrors; // Number of consecutive messages with errors … … 253 256 //970=-7.6 254 257 //1300=76 258 //DD 2019/09/01: changed from 970 to 980 as sensor 19 had values slighly larger than -7.6 255 259 for (int *pt=mapt; *pt>=0; pt++) 256 //temperatures.push_back(resist[*pt]>800&&resist[*pt]<2000 ? GetTempPT1000(resist[*pt]) : 0); 257 temperatures.push_back(resist[*pt]>970&&resist[*pt]<1300 ? GetTempPT1000(resist[*pt]) : 0); 258 //temperatures.push_back(resist[*pt]>1019&&resist[*pt]<1300 ? GetTempPT1000(resist[*pt]) : 0); 260 temperatures.push_back(resist[*pt]>=fTempMin && resist[*pt]<=fTempMax ? GetTempPT1000(resist[*pt]) : 0); 259 261 260 262 // 0 = 3-(3+0)%4 … … 440 442 { 441 443 for (size_t i=0; i<resist.size(); i++) 442 //if (resist[i]>800 && resist[i]<2000) 443 if (resist[i]>970 && resist[i]<1300) 444 //if (resist[i]>1019 && resist[i]<1300) 444 if (resist[i]>=fTempMin && resist[i]<=fTempMax) 445 445 Out() << setw(2) << i << " - " << setw(4) << (int)resist[i] << ": " << setprecision(1) << fixed << GetTempPT1000(resist[i]) << endl; 446 446 else … … 562 562 public: 563 563 ConnectionFSC(ba::io_service& ioservice, MessageImp &imp) : Connection(ioservice, imp()), 564 fIsVerbose(false), fIsAutoReconnect(false), f ReconnectTimeout(ioservice)564 fIsVerbose(false), fIsAutoReconnect(false), fTempMin(0), fTempMax(65535), fReconnectTimeout(ioservice) 565 565 { 566 566 SetLogStream(&imp); … … 580 580 { 581 581 fPositionsBias = vec; 582 } 583 584 void SetTempMin(const uint16_t &min) 585 { 586 fTempMin = min; 587 } 588 589 void SetTempMax(const uint16_t &max) 590 { 591 fTempMax = max; 582 592 } 583 593 … … 627 637 if (temp[i]!=0) 628 638 { 639 if (temp[i]<0) 640 Warn(Tools::Form("Temperature sensor %2d has negative temperature (%7.2f deg C)", i, temp[i])); 641 629 642 T.emplace_back(temp[i]); 630 643 xy.emplace_back(fPositionsSensors[i]); … … 636 649 if (T.size()==0) 637 650 { 638 Warn("No valid sensor temperatures.");651 Warn("No valid temperatures from compartment sensors."); 639 652 return; 640 653 } … … 649 662 const bool reject = rms>4 || (fabs(fLastRms[0]-fLastRms[1])<=cut_val && fabs(rms-fLastRms[0])>cut_val); 650 663 664 if (reject) 665 Warn(Tools::Form("RMS of compartment temperature suspicous: T[0]:%6.2f (n=%2d) T[1]:%6.2f T[2]:%6.2f... rejected.", rms, T.size(), fLastRms[0], fLastRms[1])); 666 651 667 fLastRms[1] = fLastRms[0]; 652 668 fLastRms[0] = rms; 653 669 654 670 if (reject) 655 {656 Warn("Suspicious temperature values rejecte for BIAS_TEMP.");657 671 return; 658 }659 672 660 673 // Create interpolator for the corresponding sensor positions … … 664 677 if (!inter.SetOutputGrid(fPositionsBias)) 665 678 { 666 Warn(" Temperature values rejecte for BIAS_TEMP (calculation of weights failed).");679 Warn("Interpolation for n="+to_string(xy.size())+" grid positions failed... rejected."); 667 680 return; 668 681 } … … 859 872 fFSC.SetVerbose(!conf.Get<bool>("quiet")); 860 873 874 fFSC.SetTempMin(conf.Get<uint16_t>("temp-adc-min")); 875 fFSC.SetTempMax(conf.Get<uint16_t>("temp-adc-max")); 876 861 877 const string fname1 = conf.GetPrefixedString("sensor-pos-file"); 862 878 const auto v1 = Interpolator2D::ReadGrid(fname1); … … 903 919 ("patch-pos-file", var<string>()->required(), "File with the positions of the 320 bias patches") 904 920 ("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 C)") 922 ("temp-adc-max", var<uint16_t>(uint16_t(1300)), "Maximum ADC value for allowed range of temperature ADCs (default ~ 76 deg C)") 905 923 ; 906 924
Note:
See TracChangeset
for help on using the changeset viewer.