]> git.mxchange.org Git - flightgear.git/commitdiff
Add the ability to set the minimum allowed age for metar reports.
authorehofman <ehofman>
Tue, 22 Feb 2005 18:12:32 +0000 (18:12 +0000)
committerehofman <ehofman>
Tue, 22 Feb 2005 18:12:32 +0000 (18:12 +0000)
src/Environment/environment_ctrl.cxx
src/Environment/environment_ctrl.hxx

index 21fb708e671a5315898b672ca1d380f6994150a1..4a7b2473260071b30a30f1fa36a876dca3e870a4 100644 (file)
@@ -324,6 +324,7 @@ FGMetarEnvironmentCtrl::FGMetarEnvironmentCtrl ()
       proxy_host( fgGetNode("/sim/presets/proxy/host", true) ),
       proxy_port( fgGetNode("/sim/presets/proxy/port", true) ),
       proxy_auth( fgGetNode("/sim/presets/proxy/authentication", true) ),
+      metar_max_age( fgGetNode("/environment/params/metar-max-age-min", true) ),
       _error_count( 0 ),
       _error_dt( 0.0 )
 {
@@ -543,7 +544,8 @@ FGMetarEnvironmentCtrl::fetch_data( const string &icao )
         string port = proxy_port->getStringValue();
         result.m = new FGMetar( icao, host, port, auth);
 
-        if (result.m->getAge_min() > 4 * 60) {
+        long max_age = metar_max_age->getLongValue();
+        if (max_age && result.m->getAge_min() > max_age) {
             SG_LOG( SG_GENERAL, SG_WARN, "METAR data too old");
             delete result.m;
             result.m = NULL;
index b48ee5f96cd125e6d0c3a05e8c561037dd8e96bb..a08c11a9a11ae835a96c190b15e226f24bbc266e 100644 (file)
@@ -177,6 +177,7 @@ private:
     SGPropertyNode *proxy_host;
     SGPropertyNode *proxy_port;
     SGPropertyNode *proxy_auth;
+    SGPropertyNode *metar_max_age;
 
     FGMetarResult fetch_data( const string &icao );
     virtual void update_metar_properties( FGMetar *m );