Changeset 17520
- Timestamp:
- 01/20/14 16:14:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r17397 r17520 1632 1632 1633 1633 max[idx] += v/4; 1634 } */1635 1636 vector<float> max(1440);1634 } */ 1635 1636 vector<float> val(1440); 1637 1637 for (int i=0; i<1440; i++) 1638 max[i] = dat[i%9==8 ? i-2 : i]/1000; 1638 val[i] = dat[i%9==8 ? i-2 : i]/1000; 1639 1640 vector<float> sorted(val); 1641 nth_element(sorted.begin(), sorted.begin()+3, sorted.end(), 1642 std::greater<float>()); 1639 1643 1640 1644 const uint32_t trig = d.GetQoS() & FAD::EventHeader::kLPext; … … 1645 1649 if (trig&FAD::EventHeader::kLPext) 1646 1650 scale = 1; 1647 if (trig ==0 || (trig&FAD::EventHeader::kPedestal))1651 if (trig&FAD::EventHeader::kPedestal) 1648 1652 scale = 0.25; 1653 if (trig==0) 1654 scale = max(0.25f, sorted[3]); 1649 1655 1650 1656 // assume it is drs-gain … … 1652 1658 // min = 0.75; 1653 1659 1654 WriteCam(d, "cam-fadcontrol-eventdata", max, scale, min);1660 WriteCam(d, "cam-fadcontrol-eventdata", val, scale, min); 1655 1661 1656 1662 return GetCurrentState(); … … 2511 2517 "Average camera humidity exceed 60%"); 2512 2518 2513 newerr |= SetError(!fMagicWeatherHist[kHum].empty() && fMagicWeatherHist[kHum].back()>98 && data_taking,2514 "Outside humidity exceeds 98% during data-taking");2519 newerr |= SetError(!fMagicWeatherHist[kHum].empty() && fMagicWeatherHist[kHum].back()>98 && fDimLidControl.state()==Lid::State::kOpen, 2520 "Outside humidity exceeds 98% while lid is open"); 2515 2521 newerr |= SetError(!fMagicWeatherHist[kGusts].empty() && fMagicWeatherHist[kGusts].back()>50 && (fDimDriveControl.state()==Drive::State::kTracking||fDimDriveControl.state()==Drive::State::kOnTrack), 2516 2522 "Wind gusts exceed 50km/h during tracking"); … … 2844 2850 } 2845 2851 2846 if ( fDimBiasControl.state()==BIAS::State::kVoltageOn)2847 out << " (" << fFtmPatchThresholdMed << ')';2852 if (bias_on) 2853 out << " (" << setprecision(4) << fFtmPatchThresholdMed << ')'; 2848 2854 out << '\n'; 2849 2855 } … … 2859 2865 2860 2866 string col = fBiasControlVoltageMed>3?HTML::kGreen:HTML::kWhite; 2861 if ( !fDimBiasControl.state()==BIAS::State::kVoltageOn)2867 if (bias_on) 2862 2868 { 2863 2869 if (fBiasControlCurrentMed>70 || fBiasControlCurrentMax>90) … … 2889 2895 out << col << '\t'; 2890 2896 out << setprecision(fBiasControlCurrentMed<100?2:3); 2891 out << (bias_off ? 0 : fBiasControlCurrentMed) << '\t';2897 out << (bias_off ? 0 : (fBiasControlCurrentMed<10?fBiasControlCurrentMed:floor(fBiasControlCurrentMed))) << '\t'; 2892 2898 if (bias_oc) 2893 2899 out << "(OC) "; … … 2897 2903 { 2898 2904 out << setprecision(fBiasControlCurrentMax<100?2:3); 2899 out << (bias_off ? 0 : fBiasControlCurrentMax);2905 out << (bias_off ? 0 : (fBiasControlCurrentMax<10?fBiasControlCurrentMax:floor(fBiasControlCurrentMax))); 2900 2906 } 2901 2907 else … … 2903 2909 } 2904 2910 out << '\t'; 2905 out << setprecision(3);2906 2911 } 2907 2912 if (cal && fDimFeedback.state()!=Feedback::State::kCalibrating) 2908 out << setprecision(2) << fBiasControlPowerTot << " W" << setprecision(3);2913 out << setprecision(2) << fBiasControlPowerTot << " W"; 2909 2914 else 2910 out << (bias_off ? 0 : fBiasControlVoltageMed) << " V";2915 out << setprecision(3) << (bias_off ? 0 : fBiasControlVoltageMed) << " V"; 2911 2916 out << '\n'; 2912 2917 }
Note:
See TracChangeset
for help on using the changeset viewer.