diff --git a/src/Environment/metarproperties.cxx b/src/Environment/metarproperties.cxx index 632bdefa4..97b94da0a 100644 --- a/src/Environment/metarproperties.cxx +++ b/src/Environment/metarproperties.cxx @@ -190,6 +190,10 @@ MetarProperties::~MetarProperties() delete _magneticVariation; } +void MetarProperties::invalidate() +{ + _metarValidNode->setBoolValue(false); +} static const double thickness_value[] = { 0, 65, 600, 750, 1000 }; diff --git a/src/Environment/metarproperties.hxx b/src/Environment/metarproperties.hxx index 319f479f9..6404642f3 100644 --- a/src/Environment/metarproperties.hxx +++ b/src/Environment/metarproperties.hxx @@ -44,6 +44,7 @@ public: virtual const std::string & getStationId() const { return _station_id; } virtual void setStationId( const std::string & value ); virtual void setMetar(SGSharedPtr m); + virtual void invalidate(); private: const char * get_metar() const; diff --git a/src/Environment/realwx_ctrl.cxx b/src/Environment/realwx_ctrl.cxx index afa41c62b..04d79ab38 100644 --- a/src/Environment/realwx_ctrl.cxx +++ b/src/Environment/realwx_ctrl.cxx @@ -112,6 +112,7 @@ void LiveMetarProperties::update( double dt ) _pollingTimer -= dt; if( _timeToLive <= 0.0 ) { _timeToLive = 0.0; + invalidate(); std::string stationId = getStationId(); if( stationId.empty() ) return; if( _pollingTimer > 0.0 ) return;