-
- if( !valid ) {
- if( _minimumRequestInterval <= 0 && stationId.length() > 0 ) {
- MetarLoadRequest request( stationId );
- // load the first metar in the foreground to make sure a metar is received
- // before the automatic runway selection code runs. All subsequent calls
- // run in the background
- _metarLoadThread->requestMetar( request, !first );
- _minimumRequestInterval = 10;
+
+ if( _requestTimer <= 0.0 ) {
+ _requestTimer = 10.0;
+
+ for( MetarPropertiesList::iterator it = _metarProperties.begin();
+ it != _metarProperties.end(); it++ ) {
+
+ if( (*it)->getTimeToLive() > 0.0 ) continue;
+ const std::string & stationId = (*it)->getStationId();
+ if( stationId.empty() ) continue;
+
+ SG_LOG(SG_ALL, SG_INFO,
+ "NoaaMetarRealWxController::update(): spawning load request for station-id '" << stationId << "'" );
+
+ MetarLoadRequest request( stationId );
+ // load the metar for the neares airport in the foreground if the fdm is uninitialized
+ // to make sure a metar is received
+ // before the automatic runway selection code runs. All subsequent calls
+ // run in the background
+ bool background = fgGetBool("/sim/fdm-initialized", false ) || it != _metarProperties.begin();
+ _metarLoadThread->requestMetar( request, background );