Changeset 16087
- Timestamp:
- 05/23/13 19:08:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r16080 r16087 365 365 void add(const string &s, const Time &t=Time()) 366 366 { 367 while ( size()>0&& (front().time+deltat<t || size()>max))367 while (!empty() && (front().time+deltat<t || size()>max)) 368 368 pop_front(); 369 369 … … 579 579 void WriteBinaryVec(const Time &tm, const string &fname, const vector<T> &vec, double scale, double offset=0, const string &title="", const string &col="") 580 580 { 581 if (vec. size()==0)581 if (vec.empty()) 582 582 return; 583 583 … … 666 666 : min(0), max(0), med(0), avg(0) 667 667 { 668 if (t. size()==0)668 if (t.empty()) 669 669 return; 670 670 … … 907 907 out << HTML::kWhite << '\t' << GetDir(fMagicWeatherHist[kDir].back()) << '\n'; 908 908 out << HTML::kWhite << '\t'; 909 if ( fTngWeatherDustHist.size()>0)909 if (!fTngWeatherDustHist.empty()) 910 910 out << fTngWeatherDustHist.back() << '\t' << fTngWeatherDustTime.GetAsStr("%H:%M") << '\n'; 911 911 else … … 1161 1161 v[i] = d.Ptr<uint16_t>()[i] * 5000./4096; 1162 1162 1163 const bool cal = fFeedbackCalibration.size()>0 && fBiasControlVoltageVec.size()>0;1163 const bool cal = !fFeedbackCalibration.empty() && !fBiasControlVoltageVec.empty(); 1164 1164 1165 1165 double power_tot = 0; … … 1649 1649 rms = sqrt(rms/num-avg*avg); 1650 1650 1651 if ( fMagicWeatherHist[kTemp].size()>0)1651 if (!fMagicWeatherHist[kTemp].empty()) 1652 1652 { 1653 1653 fFscControlTemperatureHist.push_back(avg-fMagicWeatherHist[kTemp].back()); … … 2116 2116 2117 2117 /*const*/ pair<vector<float>, pair<Time, float>> vism = GetVisibility(0, now.JD()); 2118 if ( vism.first.size()>0)2118 if (!vism.first.empty()) 2119 2119 { 2120 2120 const Entry entry("Moon", vism.second.second, ccol); … … 2152 2152 2153 2153 /*const*/ pair<vector<float>, pair<Time, float>> vis = GetVisibility(&pos, now.JD()); 2154 if ( vis.first.size()>0)2154 if (!vis.first.empty()) 2155 2155 { 2156 2156 const Entry entry(name, vis.second.second, ccol); … … 2163 2163 2164 2164 /*const*/ pair<vector<float>, pair<Time, float>> lc = GetLightCondition(&pos, now.JD()); 2165 if ( lc.first.size()>0)2165 if (!lc.first.empty()) 2166 2166 { 2167 2167 const Entry entry2(name, lc.second.second, lcol); … … 2290 2290 fDimBiasControl.state()==BIAS::State::kVoltageOn; 2291 2291 2292 const bool haderr = fErrorList.size()>0;2292 const bool haderr = !fErrorList.empty(); 2293 2293 2294 2294 bool newerr = false; … … 2319 2319 2320 2320 2321 newerr |= SetError(bias_on && fFeedbackCalibration.size()>0&& fBiasControlCurrentMed>90,2321 newerr |= SetError(bias_on && !fFeedbackCalibration.empty() && fBiasControlCurrentMed>90, 2322 2322 "Median current exceeds 90µA/pix"); 2323 newerr |= SetError(bias_on && fFeedbackCalibration.size()>0&& fBiasControlCurrentMax>110,2323 newerr |= SetError(bias_on && !fFeedbackCalibration.empty() && fBiasControlCurrentMax>110, 2324 2324 "Maximum current exceeds 110µA/pix"); 2325 2325 … … 2327 2327 "Average camera humidity exceed 60%"); 2328 2328 2329 newerr |= SetError( fMagicWeatherHist[kHum].size()>0&& fMagicWeatherHist[kHum].back()>98 && data_taking,2329 newerr |= SetError(!fMagicWeatherHist[kHum].empty() && fMagicWeatherHist[kHum].back()>98 && data_taking, 2330 2330 "Outside humidity exceeds 98% during data-taking"); 2331 newerr |= SetError( fMagicWeatherHist[kGusts].size()>0&& fMagicWeatherHist[kGusts].back()>98 && (fDimDriveControl.state()==Drive::State::kTracking||fDimDriveControl.state()==Drive::State::kOnTrack),2331 newerr |= SetError(!fMagicWeatherHist[kGusts].empty() && fMagicWeatherHist[kGusts].back()>98 && (fDimDriveControl.state()==Drive::State::kTracking||fDimDriveControl.state()==Drive::State::kOnTrack), 2332 2332 "Wind gusts exceed 50km/h during tracking"); 2333 2333 2334 newerr |= SetError(fDimFscControl.state()>=FSC::State::kConnected && fFscControlTemperatureHist.size()>0&& fFscControlTemperatureHist.back()>9,2334 newerr |= SetError(fDimFscControl.state()>=FSC::State::kConnected && !fFscControlTemperatureHist.empty() && fFscControlTemperatureHist.back()>9, 2335 2335 "Sensor temperature exceeds outside temperature by more than 9°C"); 2336 2336 … … 2349 2349 fDimBiasControl.state()==BIAS::State::kVoltageOn && 2350 2350 fBiasControlVoltageMed>3 && 2351 fFeedbackCalibration. size()==0,2351 fFeedbackCalibration.empty(), 2352 2352 "Bias voltage switched on, but bias crate not calibrated"); 2353 2353 … … 2404 2404 2405 2405 out.str(""); 2406 out << Header(now) << '\t' << ( fErrorList.size()>0) << '\t' << (fDimControl.state()>0) << '\n';2406 out << Header(now) << '\t' << (!fErrorList.empty()) << '\t' << (fDimControl.state()>0) << '\n'; 2407 2407 out << setprecision(3); 2408 2408 out << HTML::kWhite << '\t'; … … 2411 2411 out << '\n'; 2412 2412 2413 if (haderr || fErrorList.size()>0)2413 if (haderr || !fErrorList.empty()) 2414 2414 ofstream(fPath+"/error.data") << out.str(); 2415 2415 … … 2417 2417 2418 2418 out.str(""); 2419 out << Header(now) << '\t' << ( fErrorList.size()>0) << '\t' << (fDimControl.state()>0) << '\n';2419 out << Header(now) << '\t' << (!fErrorList.empty()) << '\t' << (fDimControl.state()>0) << '\n'; 2420 2420 out << setprecision(3); 2421 2421 … … 2541 2541 if (fDimDNS.online() && fDimDriveControl.state()>=Drive::State::kArmed) // Armed, Moving, Tracking, OnTrack, Error 2542 2542 { 2543 const uint32_t dev = fDriveControlTrackingDevHist.size()>0? round(fDriveControlTrackingDevHist.back()) : 0;2543 const uint32_t dev = !fDriveControlTrackingDevHist.empty() ? round(fDriveControlTrackingDevHist.back()) : 0; 2544 2544 const State rc = fDimDriveControl.description(); 2545 2545 string col = HTML::kGreen; … … 2599 2599 2600 2600 // ------------------- FSC ------------------ 2601 if (fDimDNS.online() && fDimFscControl.state()>FSC::State::kDisconnected && fFscControlTemperatureHist.size()>0)2601 if (fDimDNS.online() && fDimFscControl.state()>FSC::State::kDisconnected && !fFscControlTemperatureHist.empty()) 2602 2602 { 2603 2603 string col = HTML::kGreen; … … 2613 2613 2614 2614 // --------------- MagicWeather ------------- 2615 if (fDimDNS.online() && fDimMagicWeather.state()==MagicWeather::State::kReceiving && fMagicWeatherHist[kWeatherBegin].size()>0)2615 if (fDimDNS.online() && fDimMagicWeather.state()==MagicWeather::State::kReceiving && !fMagicWeatherHist[kWeatherBegin].empty()) 2616 2616 { 2617 2617 /* … … 2645 2645 { 2646 2646 string col = HTML::kGreen; 2647 if ( fFtmControlTriggerRateHist.size()>0)2647 if (!fFtmControlTriggerRateHist.empty()) 2648 2648 { 2649 2649 if (fFtmControlTriggerRateHist.back()<15) … … 2692 2692 col = HTML::kRed; 2693 2693 2694 const bool cal = fFeedbackCalibration.size();2694 const bool cal = !fFeedbackCalibration.empty(); 2695 2695 2696 2696 // Feedback is currently calibrating => Blue … … 2732 2732 2733 2733 out.str(""); 2734 out << Header(now) << '\t' << ( fErrorList.size()>0) << '\t' << (fDimControl.state()>0) << '\n';2734 out << Header(now) << '\t' << (!fErrorList.empty()) << '\t' << (fDimControl.state()>0) << '\n'; 2735 2735 2736 2736 if (!fDimDNS.online())
Note:
See TracChangeset
for help on using the changeset viewer.