Changeset 19712
- Timestamp:
- 10/03/19 12:23:30 (5 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r19559 r19712 43 43 #include "HeadersRateControl.h" 44 44 #include "HeadersTNGWeather.h" 45 #include "HeadersGTC.h" 45 46 #include "HeadersMagicLidar.h" 46 47 #include "HeadersMagicWeather.h" … … 548 549 Time fTngWeatherDustTime; 549 550 551 deque<float> fGtcDustHist; 552 Time fGtcDustTime; 553 550 554 deque<float> fRainSensorDataHist; 551 555 Time fRainSensorDataTime; … … 638 642 DimDescribedState fDimMagicLidar; 639 643 DimDescribedState fDimTngWeather; 644 DimDescribedState fDimGtcDust; 640 645 DimDescribedState fDimTemperature; 641 646 DimDescribedState fDimRainSensor; … … 1030 1035 else 1031 1036 out << "\t\n"; 1037 out << HTML::kWhite << '\t'; 1038 if (!fGtcDustHist.empty()) 1039 out << fGtcDustHist.back() << '\t' << fGtcDustTime.GetAsStr("%H:%M") << '\n'; 1040 else 1041 out << "\t\n"; 1032 1042 1033 1043 ofstream(fPath+"/weather.data") << out.str(); … … 1092 1102 return GetCurrentState(); 1093 1103 } 1104 1105 int HandleGtcDustData(const EventImp &d) 1106 { 1107 if (!CheckDataSize(d, "GtcDust:Data", 4)) 1108 return GetCurrentState(); 1109 1110 fGtcDustTime = d.GetTime(); 1111 1112 fGtcDustHist.push_back(d.GetFloat()); 1113 if (fGtcDustHist.size()>300) 1114 fGtcDustHist.pop_front(); 1115 1116 const Statistics stat(fGtcDustHist); 1117 1118 const double scale = stat.max>0 ? pow(10, ceil(log10(stat.max))) : 0; 1119 1120 WriteHist(d, "hist-gtc-dust", fGtcDustHist, scale); 1121 1122 ostringstream out; 1123 out << d.GetJavaDate() << '\n'; 1124 1125 ofstream(fPath+"/gtcdust.data") << out.str(); 1126 1127 return GetCurrentState(); 1128 } 1129 1094 1130 1095 1131 int HandleRainSensorData(const EventImp &d) … … 2301 2337 Out() << fDimMagicWeather << endl; 2302 2338 Out() << fDimTngWeather << endl; 2339 Out() << fDimGtcDust << endl; 2303 2340 Out() << fDimMagicLidar << endl; 2304 2341 Out() << fDimTemperature << endl; … … 3268 3305 out << GetStateHtml(fDimMagicWeather, MagicWeather::State::kConnected); 3269 3306 out << GetStateHtml(fDimTngWeather, TNGWeather::State::kConnected); 3307 out << GetStateHtml(fDimGtcDust, GTC::State::kReceiving); 3270 3308 out << GetStateHtml(fDimMagicLidar, MagicLidar::State::kConnected); 3271 3309 out << GetStateHtml(fDimTemperature, Temperature::State::kValid); … … 3318 3356 fLastRunFinishedWithZeroEvents(false), 3319 3357 fTngWeatherDustTime(Time::none), 3358 fGtcDustTime(Time::none), 3320 3359 fBiasControlVoltageMed(0), 3321 3360 fBiasControlCurrentMed(0), … … 3337 3376 fDimMagicLidar ("MAGIC_LIDAR"), 3338 3377 fDimTngWeather ("TNG_WEATHER"), 3378 fDimGtcDust ("GTC_DUST"), 3339 3379 fDimTemperature ("TEMPERATURE"), 3340 3380 fDimRainSensor ("RAIN_SENSOR"), … … 3367 3407 fDimMagicLidar.Subscribe(*this); 3368 3408 fDimTngWeather.Subscribe(*this); 3409 fDimGtcDust.Subscribe(*this); 3369 3410 fDimTemperature.Subscribe(*this); 3370 3411 fDimRainSensor.Subscribe(*this); … … 3442 3483 Subscribe("TNG_WEATHER/DATA") 3443 3484 (bind(&StateMachineSmartFACT::HandleTngWeatherData, this, placeholders::_1)); 3485 Subscribe("GTC_DUST/DATA") 3486 (bind(&StateMachineSmartFACT::HandleGtcDustData, this, placeholders::_1)); 3444 3487 Subscribe("RAIN_SENSOR/DATA") 3445 3488 (bind(&StateMachineSmartFACT::HandleRainSensorData, this, placeholders::_1)); -
trunk/FACT++/www/smartfact/struct/status.page
r19557 r19712 24 24 |Magic Weather|$0| 25 25 |TNG Weather|$0|tngdata 26 |GTC Dust|$0|gtcdust 26 27 |Magic Lidar|$0| 27 28 |Temperature|$0|temperature -
trunk/FACT++/www/smartfact/struct/weather.page
r14623 r19712 10 10 |Wind direction|$0 11 11 |Dust (TNG)|$0 µg/m³ [$1]|tngdust 12 |Dust (GTC)|$0 µg/m³ [$1]|gtcdust 12 13
Note:
See TracChangeset
for help on using the changeset viewer.