+ SGPropertyNode_ptr rootNode = new SGPropertyNode;
+ readProperties(path.str(), rootNode);
+ readILSData(rootNode);
+ cache->stampCacheFile(path);
+
+// we loaded data, tell the caller it might need to reload things
+ return true;
+}
+
+void FGAirport::readILSData(SGPropertyNode* aRoot)
+{
+ NavDataCache* cache = NavDataCache::instance();
+
+ // find the entry matching the runway
+ SGPropertyNode* runwayNode, *ilsNode;
+ for (int i=0; (runwayNode = aRoot->getChild("runway", i)) != NULL; ++i) {
+ for (int j=0; (ilsNode = runwayNode->getChild("ils", j)) != NULL; ++j) {
+ // must match on both nav-ident and runway ident, to support the following:
+ // - runways with multiple distinct ILS installations (KEWD, for example)
+ // - runways where both ends share the same nav ident (LFAT, for example)
+ PositionedID ils = cache->findILS(guid(), ilsNode->getStringValue("rwy"),
+ ilsNode->getStringValue("nav-id"));
+ if (ils == 0) {
+ SG_LOG(SG_GENERAL, SG_INFO, "reading ILS data for " << ident() <<
+ ", couldn;t find runway/navaid for:" <<
+ ilsNode->getStringValue("rwy") << "/" <<
+ ilsNode->getStringValue("nav-id"));
+ continue;
+ }
+
+ double hdgDeg = ilsNode->getDoubleValue("hdg-deg"),
+ lon = ilsNode->getDoubleValue("lon"),
+ lat = ilsNode->getDoubleValue("lat"),
+ elevM = ilsNode->getDoubleValue("elev-m");
+
+ cache->updateILS(ils, SGGeod::fromDegM(lon, lat, elevM), hdgDeg);
+ } // of ILS iteration
+ } // of runway iteration