]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/xmlloader.cxx
Interim windows build fix
[flightgear.git] / src / Airports / xmlloader.cxx
index 8b35cabd5b03bab346f5df79fd9f2ec9f8a83219..cdd36271437846b9cff945ead136771715e2a51b 100644 (file)
 #  include "config.h"
 #endif
 
+#include <cstdio>
+
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/xml/easyxml.hxx>
 #include <simgear/misc/strutils.hxx>
+#include <simgear/timing/timestamp.hxx>
 
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
 #include "runwayprefloader.hxx"
 
 #include "dynamics.hxx"
-#include "simple.hxx"
+#include "airport.hxx"
 #include "runwayprefs.hxx"
 
+#include <Navaids/NavDataCache.hxx>
+
 using std::string;
 
 XMLLoader::XMLLoader() {}
@@ -39,10 +44,22 @@ XMLLoader::~XMLLoader() {}
 
 void XMLLoader::load(FGAirportDynamics* d)
 {
-  FGAirportDynamicsXMLLoader visitor(d);
-  if(loadAirportXMLDataIntoVisitor(d->parent()->ident(), "groundnet", visitor)) {
-    d->init();
+  SGPath path;
+  if (!findAirportData(d->parent()->ident(), "groundnet", path)) {
+    return;
   }
+
+  SG_LOG(SG_NAVAID, SG_INFO, "reading groundnet data from " << path);
+  SGTimeStamp t;
+  t.stamp();
+  try {
+      FGAirportDynamicsXMLLoader visitor(d);
+      readXML(path.str(), visitor);
+  } catch (sg_exception& e) {
+    SG_LOG(SG_NAVAID, SG_INFO, "parsing groundnet XML failed:" << e.getFormattedMessage());
+  }
+
+  SG_LOG(SG_NAVAID, SG_INFO, "parsing groundnet XML took " << t.elapsedMSec());
 }
 
 void XMLLoader::load(FGRunwayPreference* p) {
@@ -84,7 +101,7 @@ bool XMLLoader::loadAirportXMLDataIntoVisitor(const string& aICAO,
 {
   SGPath path;
   if (!findAirportData(aICAO, aFileName, path)) {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "loadAirportXMLDataIntoVisitor: failed to find data for " << aICAO << "/" << aFileName);
+    SG_LOG(SG_NAVAID, SG_DEBUG, "loadAirportXMLDataIntoVisitor: failed to find data for " << aICAO << "/" << aFileName);
     return false;
   }