]> git.mxchange.org Git - flightgear.git/commitdiff
Live weather: ensure valid flag is set correctly
authorTorsten Dreyer <torsten@ŧ3r.de>
Mon, 9 Mar 2015 11:24:36 +0000 (12:24 +0100)
committerTorsten Dreyer <torsten@ŧ3r.de>
Mon, 9 Mar 2015 11:24:36 +0000 (12:24 +0100)
src/Environment/metarproperties.cxx
src/Environment/metarproperties.hxx
src/Environment/realwx_ctrl.cxx

index 632bdefa4e2ee8b35f7d3aaa14d3572a7c137448..97b94da0a8ae940f56ad1e6df287a1cc8c337489 100644 (file)
@@ -190,6 +190,10 @@ MetarProperties::~MetarProperties()
   delete _magneticVariation;
 }
 
+void MetarProperties::invalidate()
+{
+  _metarValidNode->setBoolValue(false);
+}
 
 static const double thickness_value[] = { 0, 65, 600, 750, 1000 };
 
index 319f479f90ab916642e492aae829d3dbee052fb8..6404642f327675bd1fcd9072194a106d65af31ff 100644 (file)
@@ -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<FGMetar> m);
+    virtual void invalidate();
 
 private:
     const char * get_metar() const;
index afa41c62b123798c634d420b3808e7a29f9a9044..04d79ab38d30d638c134cb02acb428c1ee191648 100644 (file)
@@ -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;