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 )
{
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;
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 );