Changeset 19556


Ignore:
Timestamp:
Jul 6, 2019, 6:11:06 PM (3 months ago)
Author:
tbretz
Message:
Added TNG_WEATHER/DATA
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/smartfact.cc

    r19386 r19556  
    10641064
    10651065        ofstream(fPath+"/tngdust.data") << out.str();
     1066
     1067        return GetCurrentState();
     1068    }
     1069
     1070    int HandleTngWeatherData(const EventImp &d)
     1071    {
     1072        if (!CheckDataSize(d, "TngWeather:Data", sizeof(TNGWeather::DimWeather)))
     1073            return GetCurrentState();
     1074
     1075        const auto &data = d.Ref<TNGWeather::DimWeather>();
     1076
     1077        ostringstream out;
     1078        out << d.GetJavaDate() << '\n';
     1079        out << HTML::kWhite << '\t' << data.fTemperature << '\n';
     1080        out << HTML::kWhite << '\t' << data.fTempTrend << '\n';
     1081        out << HTML::kWhite << '\t' << data.fDewPoint << '\n';
     1082        out << HTML::kWhite << '\t' << data.fHumidity << '\n';
     1083        out << HTML::kWhite << '\t' << data.fAirPressure << '\n';
     1084        out << HTML::kWhite << '\t' << data.fWindSpeed << '\n';
     1085        out << HTML::kWhite << '\t' << data.fWindDirection << '\n';
     1086        out << HTML::kWhite << '\t' << data.fDustTotal << '\n';
     1087        out << HTML::kWhite << '\t' << data.fSolarimeter << '\n';
     1088
     1089        ofstream(fPath+"/tngdata.data") << out.str();
    10661090
    10671091        return GetCurrentState();
     
    34153439        Subscribe("TNG_WEATHER/DUST")
    34163440            (bind(&StateMachineSmartFACT::HandleTngWeatherDust,      this, placeholders::_1));
     3441        Subscribe("TNG_WEATHER/DATA")
     3442            (bind(&StateMachineSmartFACT::HandleTngWeatherData,      this, placeholders::_1));
    34173443        Subscribe("RAIN_SENSOR/DATA")
    34183444            (bind(&StateMachineSmartFACT::HandleRainSensorData,      this, placeholders::_1));
Note: See TracChangeset for help on using the changeset viewer.