1
0
Fork 0

publish the metar date/time to metarproperties

This commit is contained in:
Torsten Dreyer 2014-02-21 16:23:10 +01:00
parent 0473607731
commit 16869d0362
2 changed files with 12 additions and 0 deletions

View file

@ -134,6 +134,9 @@ MetarProperties::MetarProperties( SGPropertyNode_ptr rootNode ) :
_hail(0.0), _hail(0.0),
_snow(0.0), _snow(0.0),
_snow_cover(false), _snow_cover(false),
_day(0),
_hour(0),
_minute(0),
_magneticVariation(new MagneticVariation()) _magneticVariation(new MagneticVariation())
{ {
// Hack to avoid static initialization order problems on OSX // Hack to avoid static initialization order problems on OSX
@ -174,6 +177,9 @@ MetarProperties::MetarProperties( SGPropertyNode_ptr rootNode ) :
_tiedProperties.Tie("hail-norm", &_hail ); _tiedProperties.Tie("hail-norm", &_hail );
_tiedProperties.Tie("snow-norm", &_snow); _tiedProperties.Tie("snow-norm", &_snow);
_tiedProperties.Tie("snow-cover", &_snow_cover ); _tiedProperties.Tie("snow-cover", &_snow_cover );
_tiedProperties.Tie("day", &_day );
_tiedProperties.Tie("hour", &_hour );
_tiedProperties.Tie("minute", &_minute );
_tiedProperties.Tie("decoded", this, &MetarProperties::get_decoded ); _tiedProperties.Tie("decoded", this, &MetarProperties::get_decoded );
} }
@ -404,6 +410,9 @@ void MetarProperties::setMetar( SGSharedPtr<FGMetar> m )
_hail = m->getHail(); _hail = m->getHail();
_snow = m->getSnow(); _snow = m->getSnow();
_snow_cover = m->getSnowCover(); _snow_cover = m->getSnowCover();
_day = m->getDay();
_hour = m->getHour();
_minute = m->getMinute();
_metarValidNode->setBoolValue(true); _metarValidNode->setBoolValue(true);
} }

View file

@ -92,6 +92,9 @@ private:
double _snow; double _snow;
bool _snow_cover; bool _snow_cover;
std::string _decoded; std::string _decoded;
int _day;
int _hour;
int _minute;
protected: protected:
simgear::TiedPropertyList _tiedProperties; simgear::TiedPropertyList _tiedProperties;
MagneticVariation * _magneticVariation; MagneticVariation * _magneticVariation;