X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FEnvironment%2Frealwx_ctrl.cxx;h=3db5d905845a8c08e5b93a4633935ae82a82e967;hb=24c1129140dd1a04ac8a9fe5d6b0a17387b49304;hp=087040486bb6ff2dc85339ec21669bcd1261a515;hpb=6cd0e5aac4b70bc927ad6f3d705a894ba3ee71ba;p=flightgear.git diff --git a/src/Environment/realwx_ctrl.cxx b/src/Environment/realwx_ctrl.cxx index 087040486..3db5d9058 100644 --- a/src/Environment/realwx_ctrl.cxx +++ b/src/Environment/realwx_ctrl.cxx @@ -1,7 +1,7 @@ // realwx_ctrl.cxx -- Process real weather data // // Written by David Megginson, started February 2002. -// Rewritten by Torsten Dreyer, August 2010 +// Rewritten by Torsten Dreyer, August 2010, August 2011 // // Copyright (C) 2002 David Megginson - david@megginson.com // @@ -25,56 +25,117 @@ #endif #include "realwx_ctrl.hxx" -#include "metarproperties.hxx" -#include "metarairportfilter.hxx" -#include "fgmetar.hxx" -#include
+#include +#include +#include #include #include #include -#include -#if defined(ENABLE_THREADS) -#include -#include -#endif +#include +#include +#include +#include +#include "metarproperties.hxx" +#include "metarairportfilter.hxx" +#include "fgmetar.hxx" +#include +#include
namespace Environment { + +/* -------------------------------------------------------------------------------- */ + +class MetarDataHandler { +public: + virtual void handleMetarData( const std::string & data ) = 0; +}; + +class MetarRequester { +public: + virtual void requestMetar( MetarDataHandler * metarDataHandler, const std::string & id ) = 0; +}; + /* -------------------------------------------------------------------------------- */ -class LiveMetarProperties : public MetarProperties { +class LiveMetarProperties : public MetarProperties, MetarDataHandler { public: - LiveMetarProperties( SGPropertyNode_ptr rootNode ); + LiveMetarProperties( SGPropertyNode_ptr rootNode, MetarRequester * metarRequester, int maxAge ); virtual ~LiveMetarProperties(); virtual void update( double dt ); virtual double getTimeToLive() const { return _timeToLive; } - virtual void setTimeToLive( double value ) { _timeToLive = value; } + virtual void resetTimeToLive() + { _timeToLive = 0.00; _pollingTimer = 0.0; } + + // implementation of MetarDataHandler + virtual void handleMetarData( const std::string & data ); + + static const unsigned MAX_POLLING_INTERVAL_SECONDS = 10; + static const unsigned DEFAULT_TIME_TO_LIVE_SECONDS = 900; + private: double _timeToLive; - + double _pollingTimer; + MetarRequester * _metarRequester; + int _maxAge; }; typedef SGSharedPtr LiveMetarProperties_ptr; -LiveMetarProperties::LiveMetarProperties( SGPropertyNode_ptr rootNode ) : +LiveMetarProperties::LiveMetarProperties( SGPropertyNode_ptr rootNode, MetarRequester * metarRequester, int maxAge ) : MetarProperties( rootNode ), - _timeToLive(0.0) + _timeToLive(0.0), + _pollingTimer(0.0), + _metarRequester(metarRequester), + _maxAge(maxAge) { _tiedProperties.Tie("time-to-live", &_timeToLive ); } LiveMetarProperties::~LiveMetarProperties() { + _tiedProperties.Untie(); } void LiveMetarProperties::update( double dt ) { _timeToLive -= dt; - if( _timeToLive < 0.0 ) _timeToLive = 0.0; + _pollingTimer -= dt; + if( _timeToLive <= 0.0 ) { + _timeToLive = 0.0; + std::string stationId = getStationId(); + if( stationId.empty() ) return; + if( _pollingTimer > 0.0 ) return; + _metarRequester->requestMetar( this, stationId ); + _pollingTimer = MAX_POLLING_INTERVAL_SECONDS; + } +} + +void LiveMetarProperties::handleMetarData( const std::string & data ) +{ + SG_LOG( SG_ENVIRONMENT, SG_DEBUG, "LiveMetarProperties::handleMetarData() received METAR for " << getStationId() << ": " << data ); + _timeToLive = DEFAULT_TIME_TO_LIVE_SECONDS; + + SGSharedPtr m; + try { + m = new FGMetar(data.c_str()); + } + catch( sg_io_exception ) { + SG_LOG( SG_ENVIRONMENT, SG_WARN, "Can't parse metar: " << data ); + return; + } + + if (_maxAge && (m->getAge_min() > _maxAge)) { + // METAR is older than max-age, ignore + SG_LOG( SG_ENVIRONMENT, SG_DEBUG, "Ignoring outdated METAR for " << getStationId()); + return; + } + + setMetar( m ); } /* -------------------------------------------------------------------------------- */ @@ -82,34 +143,80 @@ void LiveMetarProperties::update( double dt ) class BasicRealWxController : public RealWxController { public: - BasicRealWxController( SGPropertyNode_ptr rootNode ); + BasicRealWxController( SGPropertyNode_ptr rootNode, MetarRequester * metarRequester ); virtual ~BasicRealWxController (); virtual void init (); virtual void reinit (); - + virtual void shutdown (); + + /** + * Create a metar-property binding at the specified property path, + * and initiate a request for the specified station-ID (which may be + * empty). If the property path is already mapped, the station ID + * will be updated. + */ + void addMetarAtPath(const string& propPath, const string& icao); + + void removeMetarAtPath(const string& propPath); protected: void bind(); void unbind(); void update( double dt ); - virtual void update( bool first, double dt ) = 0; + void checkNearbyMetar(); long getMetarMaxAgeMin() const { return _max_age_n == NULL ? 0 : _max_age_n->getLongValue(); } SGPropertyNode_ptr _rootNode; - SGPropertyNode_ptr _longitude_n; - SGPropertyNode_ptr _latitude_n; SGPropertyNode_ptr _ground_elevation_n; SGPropertyNode_ptr _max_age_n; bool _enabled; - bool __enabled; + bool _wasEnabled; simgear::TiedPropertyList _tiedProperties; - ; typedef std::vector MetarPropertiesList; + typedef std::vector MetarPropertiesList; MetarPropertiesList _metarProperties; + MetarRequester* _requester; + }; +static bool commandRequestMetar(const SGPropertyNode* arg) +{ + SGSubsystemGroup* envMgr = (SGSubsystemGroup*) globals->get_subsystem("environment"); + if (!envMgr) { + return false; + } + + BasicRealWxController* self = (BasicRealWxController*) envMgr->get_subsystem("realwx"); + if (!self) { + return false; + } + + string icao(arg->getStringValue("station")); + boost::to_upper(icao); + string path = arg->getStringValue("path"); + self->addMetarAtPath(path, icao); + return true; +} + +static bool commandClearMetar(const SGPropertyNode* arg) +{ + SGSubsystemGroup* envMgr = (SGSubsystemGroup*) globals->get_subsystem("environment"); + if (!envMgr) { + return false; + } + + BasicRealWxController* self = (BasicRealWxController*) envMgr->get_subsystem("realwx"); + if (!self) { + return false; + } + + string path = arg->getStringValue("path"); + self->removeMetarAtPath(path); + return true; +} + /* -------------------------------------------------------------------------------- */ /* Properties @@ -117,40 +224,57 @@ Properties ~/metar[1..n]: string Target property path for metar data */ -BasicRealWxController::BasicRealWxController( SGPropertyNode_ptr rootNode ) : +BasicRealWxController::BasicRealWxController( SGPropertyNode_ptr rootNode, MetarRequester * metarRequester ) : _rootNode(rootNode), - _longitude_n( fgGetNode( "/position/longitude-deg", true )), - _latitude_n( fgGetNode( "/position/latitude-deg", true )), _ground_elevation_n( fgGetNode( "/position/ground-elev-m", true )), _max_age_n( fgGetNode( "/environment/params/metar-max-age-min", false ) ), _enabled(true), - __enabled(false) + _wasEnabled(false), + _requester(metarRequester) { - // at least instantiate MetarProperties for /environment/metar - _metarProperties.push_back( new LiveMetarProperties( - fgGetNode( rootNode->getStringValue("metar", "/environment/metar"), true ) ) ); - - PropertyList metars = rootNode->getChildren("metar"); - for( PropertyList::size_type i = 1; i < metars.size(); i++ ) { - SG_LOG( SG_ALL, SG_INFO, "Adding metar properties at " << metars[i]->getStringValue() ); - _metarProperties.push_back( new LiveMetarProperties( - fgGetNode( metars[i]->getStringValue(), true ))); - } + + globals->get_commands()->addCommand("request-metar", commandRequestMetar); + globals->get_commands()->addCommand("clear-metar", commandClearMetar); } BasicRealWxController::~BasicRealWxController() { + globals->get_commands()->removeCommand("request-metar"); + globals->get_commands()->removeCommand("clear-metar"); } void BasicRealWxController::init() { - __enabled = false; + _wasEnabled = false; + + // at least instantiate MetarProperties for /environment/metar + SGPropertyNode_ptr metarNode = fgGetNode( _rootNode->getStringValue("metar", "/environment/metar"), true ); + _metarProperties.push_back( new LiveMetarProperties(metarNode, + _requester, + getMetarMaxAgeMin())); + + BOOST_FOREACH( SGPropertyNode_ptr n, _rootNode->getChildren("metar") ) { + SGPropertyNode_ptr metarNode = fgGetNode( n->getStringValue(), true ); + addMetarAtPath(metarNode->getPath(), ""); + } + + checkNearbyMetar(); update(0); // fetch data ASAP + + globals->get_event_mgr()->addTask("checkNearbyMetar", this, + &BasicRealWxController::checkNearbyMetar, 60 ); } void BasicRealWxController::reinit() { - __enabled = false; + _wasEnabled = false; + checkNearbyMetar(); + update(0); // fetch data ASAP +} + +void BasicRealWxController::shutdown() +{ + globals->get_event_mgr()->removeTask("checkNearbyMetar"); } void BasicRealWxController::bind() @@ -165,301 +289,187 @@ void BasicRealWxController::unbind() } void BasicRealWxController::update( double dt ) -{ +{ if( _enabled ) { - bool firstIteration = !__enabled; // first iteration after being enabled? - + bool firstIteration = !_wasEnabled; // clock tick for every METAR in stock - for( MetarPropertiesList::iterator it = _metarProperties.begin(); - it != _metarProperties.end(); it++ ) { + BOOST_FOREACH(LiveMetarProperties* p, _metarProperties) { // first round? All received METARs are outdated - if( firstIteration ) (*it)->setTimeToLive( 0.0 ); - (*it)->update(dt); + if( firstIteration ) p->resetTimeToLive(); + p->update(dt); } - update( firstIteration, dt ); - __enabled = true; + _wasEnabled = true; } else { - __enabled = false; + _wasEnabled = false; } } -/* -------------------------------------------------------------------------------- */ - -class NoaaMetarRealWxController : public BasicRealWxController { -public: - NoaaMetarRealWxController( SGPropertyNode_ptr rootNode ); - virtual ~NoaaMetarRealWxController(); - virtual void update (bool first, double delta_time_sec); - virtual void shutdown (); - - class MetarLoadRequest { - public: - MetarLoadRequest( const string & stationId ) : - _stationId(stationId), - _proxyHost(fgGetNode("/sim/presets/proxy/host", true)->getStringValue()), - _proxyPort(fgGetNode("/sim/presets/proxy/port", true)->getStringValue()), - _proxyAuth(fgGetNode("/sim/presets/proxy/authentication", true)->getStringValue()) - {} - MetarLoadRequest( const MetarLoadRequest & other ) : - _stationId(other._stationId), - _proxyHost(other._proxyAuth), - _proxyPort(other._proxyPort), - _proxyAuth(other._proxyAuth) - {} - string _stationId; - string _proxyHost; - string _proxyPort; - string _proxyAuth; - private: - }; - - class MetarLoadResponse { - public: - MetarLoadResponse( const string & stationId, const string metar ) { - _stationId = stationId; - _metar = metar; - } - MetarLoadResponse( const MetarLoadResponse & other ) { - _stationId = other._stationId; - _metar = other._metar; - } - string _stationId; - string _metar; - }; -private: - double _positionTimeToLive; - double _requestTimer; - -#if defined(ENABLE_THREADS) - class MetarLoadThread : public OpenThreads::Thread { - public: - MetarLoadThread( long maxAge ); - virtual ~MetarLoadThread( ) { stop(); } - void requestMetar( const MetarLoadRequest & metarRequest, bool background = true ); - bool hasMetar() { return _responseQueue.size() > 0; } - MetarLoadResponse getMetar() { return _responseQueue.pop(); } - virtual void run(); - void stop(); - private: - void fetch( const MetarLoadRequest & ); - long _maxAge; - long _minRequestInterval; - volatile bool _stop; - SGBlockingQueue _requestQueue; - SGBlockingQueue _responseQueue; - }; - - MetarLoadThread * _metarLoadThread; -#endif -}; - -NoaaMetarRealWxController::NoaaMetarRealWxController( SGPropertyNode_ptr rootNode ) : - BasicRealWxController(rootNode), - _positionTimeToLive(0.0), - _requestTimer(0.0) -{ -#if defined(ENABLE_THREADS) - _metarLoadThread = new MetarLoadThread(getMetarMaxAgeMin()); - _metarLoadThread->start(); -#endif -} - -void NoaaMetarRealWxController::shutdown() +void BasicRealWxController::addMetarAtPath(const string& propPath, const string& icao) { -#if defined(ENABLE_THREADS) - if( _metarLoadThread ) { - delete _metarLoadThread; - _metarLoadThread = NULL; + // check for duplicate entries + BOOST_FOREACH( LiveMetarProperties_ptr p, _metarProperties ) { + if( p->get_root_node()->getPath() == propPath ) { + // already exists + if (p->getStationId() != icao) { + p->setStationId(icao); + p->resetTimeToLive(); + } + + return; } -#endif // ENABLE_THREADS -} + } // of exitsing metar properties iteration -NoaaMetarRealWxController::~NoaaMetarRealWxController() -{ + SGPropertyNode_ptr metarNode = fgGetNode(propPath, true); + SG_LOG( SG_ENVIRONMENT, SG_INFO, "Adding metar properties at " << propPath ); + LiveMetarProperties_ptr p(new LiveMetarProperties( metarNode, _requester, getMetarMaxAgeMin() )); + _metarProperties.push_back(p); + p->setStationId(icao); } -void NoaaMetarRealWxController::update( bool first, double dt ) +void BasicRealWxController::removeMetarAtPath(const string &propPath) { - _positionTimeToLive -= dt; - _requestTimer -= dt; - - if( _positionTimeToLive <= 0.0 ) { - // check nearest airport - SG_LOG(SG_ALL, SG_INFO, "NoaaMetarRealWxController::update(): (re) checking nearby airport with METAR" ); - _positionTimeToLive = 60.0; - - SGGeod pos = SGGeod::fromDeg(_longitude_n->getDoubleValue(), _latitude_n->getDoubleValue()); - - FGAirport * nearestAirport = FGAirport::findClosest(pos, 10000.0, MetarAirportFilter::instance() ); - if( nearestAirport == NULL ) { - SG_LOG(SG_ALL,SG_WARN,"RealWxController::update can't find airport with METAR within 10000NM" ); - return; - } - - SG_LOG(SG_ALL, SG_INFO, - "NoaaMetarRealWxController::update(): nearest airport with METAR is: " << nearestAirport->ident() ); - - // if it has changed, invalidate the associated METAR - if( _metarProperties[0]->getStationId() != nearestAirport->ident() ) { - SG_LOG(SG_ALL, SG_INFO, - "NoaaMetarRealWxController::update(): nearest airport with METAR has changed. Old: '" << - _metarProperties[0]->getStationId() << - "', new: '" << nearestAirport->ident() << "'" ); - _metarProperties[0]->setStationId( nearestAirport->ident() ); - _metarProperties[0]->setTimeToLive( 0.0 ); - } + MetarPropertiesList::iterator it = _metarProperties.begin(); + for (; it != _metarProperties.end(); ++it) { + LiveMetarProperties_ptr p(*it); + if( p->get_root_node()->getPath() == propPath ) { + _metarProperties.erase(it); + // final ref will drop, and delete the MetarProperties, when we return + return; } + } - 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 nearest 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 ); - } + SG_LOG(SG_ENVIRONMENT, SG_WARN, "no metar properties at " << propPath); +} + +void BasicRealWxController::checkNearbyMetar() +{ + try { + const SGGeod & pos = globals->get_aircraft_position(); + + // check nearest airport + SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "NoaaMetarRealWxController::update(): (re) checking nearby airport with METAR" ); + + FGAirport * nearestAirport = FGAirport::findClosest(pos, 10000.0, MetarAirportFilter::instance() ); + if( nearestAirport == NULL ) { + SG_LOG(SG_ENVIRONMENT,SG_WARN,"RealWxController::update can't find airport with METAR within 10000NM" ); + return; + } + + SG_LOG(SG_ENVIRONMENT, SG_DEBUG, + "NoaaMetarRealWxController::update(): nearest airport with METAR is: " << nearestAirport->ident() ); + + // if it has changed, invalidate the associated METAR + if( _metarProperties[0]->getStationId() != nearestAirport->ident() ) { + SG_LOG(SG_ENVIRONMENT, SG_INFO, + "NoaaMetarRealWxController::update(): nearest airport with METAR has changed. Old: '" << + _metarProperties[0]->getStationId() << + "', new: '" << nearestAirport->ident() << "'" ); + _metarProperties[0]->setStationId( nearestAirport->ident() ); + _metarProperties[0]->resetTimeToLive(); + } } - - // pick all the received responses from the result queue and update the associated - // property tree - while( _metarLoadThread->hasMetar() ) { - MetarLoadResponse metar = _metarLoadThread->getMetar(); - SG_LOG( SG_ALL, SG_INFO, "NoaaMetarRwalWxController::update() received METAR for " << metar._stationId << ": " << metar._metar ); - for( MetarPropertiesList::iterator it = _metarProperties.begin(); - it != _metarProperties.end(); it++ ) { - if( (*it)->getStationId() != metar._stationId ) - continue; - (*it)->setTimeToLive(900); - (*it)->setMetar( metar._metar ); - } + catch( sg_exception & ) { + return; } + } /* -------------------------------------------------------------------------------- */ -#if defined(ENABLE_THREADS) -NoaaMetarRealWxController::MetarLoadThread::MetarLoadThread( long maxAge ) : - _maxAge(maxAge), - _minRequestInterval(2000), - _stop(false) -{ -} +class NoaaMetarRealWxController : public BasicRealWxController, MetarRequester { +public: + NoaaMetarRealWxController( SGPropertyNode_ptr rootNode ); -void NoaaMetarRealWxController::MetarLoadThread::requestMetar( const MetarLoadRequest & metarRequest, bool background ) -{ - if( background ) { - if( _requestQueue.size() > 10 ) { - SG_LOG(SG_ALL,SG_ALERT, - "NoaaMetarRealWxController::MetarLoadThread::requestMetar() more than 10 outstanding METAR requests, dropping " - << metarRequest._stationId ); - return; - } + // implementation of MetarRequester + virtual void requestMetar( MetarDataHandler * metarDataHandler, const std::string & id ); - _requestQueue.push( metarRequest ); - } else { - fetch( metarRequest ); + virtual ~NoaaMetarRealWxController() + { } -} +private: + +}; -void NoaaMetarRealWxController::MetarLoadThread::stop() +NoaaMetarRealWxController::NoaaMetarRealWxController( SGPropertyNode_ptr rootNode ) : + BasicRealWxController(rootNode, this ) { - // set stop flag and wake up the thread with an empty request - _stop = true; - MetarLoadRequest request(""); - requestMetar(request); - join(); } -void NoaaMetarRealWxController::MetarLoadThread::run() +void NoaaMetarRealWxController::requestMetar +( + MetarDataHandler* metarDataHandler, + const std::string& id +) { - SGTimeStamp lastRun = SGTimeStamp::fromSec(0); - for( ;; ) { - SGTimeStamp dt = SGTimeStamp::now() - lastRun; - - long delayMs = _minRequestInterval - dt.getSeconds() * 1000; - while (( delayMs > 0 ) && !_stop) + static const std::string NOAA_BASE_URL = + "http://weather.noaa.gov/pub/data/observations/metar/stations/"; + class NoaaMetarGetRequest: + public simgear::HTTP::MemoryRequest + { + public: + NoaaMetarGetRequest( MetarDataHandler* metarDataHandler, + const std::string& stationId ): + MemoryRequest(NOAA_BASE_URL + stationId + ".TXT"), + _metarDataHandler(metarDataHandler) + { + std::ostringstream buf; + buf << globals->get_time_params()->get_cur_time(); + requestHeader("X-TIME") = buf.str(); + } + + virtual void onDone() + { + if( responseCode() != 200 ) { - // sleep no more than 3 seconds at a time, otherwise shutdown response is too slow - long sleepMs = (delayMs>3000) ? 3000 : delayMs; - microSleep( sleepMs * 1000 ); - delayMs -= sleepMs; + SG_LOG + ( + SG_ENVIRONMENT, + SG_WARN, + "metar download failed:" << url() << ": reason:" << responseReason() + ); + return; } - if (_stop) - break; - - lastRun = SGTimeStamp::now(); - - const MetarLoadRequest request = _requestQueue.pop(); - - if (( request._stationId.size() == 0 ) || _stop) - break; - - fetch( request ); - } -} - -void NoaaMetarRealWxController::MetarLoadThread::fetch( const MetarLoadRequest & request ) -{ - SGSharedPtr result = NULL; - - try { - result = new FGMetar( request._stationId, request._proxyHost, request._proxyPort, request._proxyAuth ); - _minRequestInterval = 2000; - } catch (const sg_io_exception& e) { - SG_LOG( SG_GENERAL, SG_WARN, "NoaaMetarRealWxController::fetchMetar(): can't get METAR for " - << request._stationId << ":" << e.getFormattedMessage().c_str() ); - _minRequestInterval += _minRequestInterval/2; - if( _minRequestInterval > 30000 ) - _minRequestInterval = 30000; - return; - } + _metarDataHandler->handleMetarData + ( + simgear::strutils::simplify(responseBody()) + ); + } - string reply = result->getData(); - std::replace(reply.begin(), reply.end(), '\n', ' '); - string metar = simgear::strutils::strip( reply ); + virtual void onFail() + { + SG_LOG(SG_ENVIRONMENT, SG_INFO, "metar download failure"); + } - if( metar.empty() ) { - SG_LOG( SG_GENERAL, SG_WARN, "NoaaMetarRealWxController::fetchMetar(): dropping empty METAR for " - << request._stationId ); - return; - } - - if( _maxAge && result->getAge_min() > _maxAge ) { - SG_LOG( SG_GENERAL, SG_ALERT, "NoaaMetarRealWxController::fetchMetar(): dropping outdated METAR " - << metar ); - return; - } - - MetarLoadResponse response( request._stationId, metar ); - _responseQueue.push( response ); + private: + MetarDataHandler * _metarDataHandler; + }; + + string upperId = boost::to_upper_copy(id); + + SG_LOG + ( + SG_ENVIRONMENT, + SG_INFO, + "NoaaMetarRealWxController::update(): " + "spawning load request for station-id '" << upperId << "'" + ); + FGHTTPClient* http = static_cast(globals->get_subsystem("http")); + if (http) { + http->makeRequest(new NoaaMetarGetRequest(metarDataHandler, upperId)); + } } -#endif /* -------------------------------------------------------------------------------- */ - + RealWxController * RealWxController::createInstance( SGPropertyNode_ptr rootNode ) { -// string dataSource = rootNode->getStringValue("data-source", "noaa" ); -// if( dataSource == "nwx" ) { -// return new NwxMetarRealWxController( rootNode ); -// } else { - return new NoaaMetarRealWxController( rootNode ); -// } + return new NoaaMetarRealWxController( rootNode ); +} + +RealWxController::~RealWxController() +{ } /* -------------------------------------------------------------------------------- */