+void BasicRealWxController::addMetarAtPath(const string& propPath, const string& icao)
+{
+ // 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->setTimeToLive(0.0);
+ }
+
+ return;
+ }
+ } // of exitsing metar properties iteration
+
+ SGPropertyNode_ptr metarNode = fgGetNode(propPath, true);
+ SG_LOG( SG_ENVIRONMENT, SG_INFO, "Adding metar properties at " << propPath );
+ LiveMetarProperties_ptr p(new LiveMetarProperties( metarNode, _requester ));
+ _metarProperties.push_back(p);
+ p->setStationId(icao);
+}
+
+void BasicRealWxController::removeMetarAtPath(const string &propPath)
+{
+ 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;
+ }
+ }
+
+ SG_LOG(SG_ENVIRONMENT, SG_WARN, "no metar properties at " << propPath);
+}
+