# include "config.h"
#endif
+#include <cstdio>
+
#include <simgear/misc/sg_path.hxx>
#include <simgear/xml/easyxml.hxx>
#include <simgear/misc/strutils.hxx>
#include "runwayprefloader.hxx"
#include "dynamics.hxx"
-#include "simple.hxx"
+#include "airport.hxx"
#include "runwayprefs.hxx"
#include <Navaids/NavDataCache.hxx>
return;
}
- flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
- if (!cache->isCachedFileModified(path)) {
- return;
- }
-
- SG_LOG(SG_GENERAL, SG_INFO, "reading groundnet data from " << path);
+ SG_LOG(SG_NAVAID, SG_INFO, "reading groundnet data from " << path);
SGTimeStamp t;
+ t.stamp();
try {
- cache->beginTransaction();
- t.stamp();
- {
FGAirportDynamicsXMLLoader visitor(d);
readXML(path.str(), visitor);
- } // ensure visitor is destroyed so its destructor runs
- cache->stampCacheFile(path);
- cache->commitTransaction();
} catch (sg_exception& e) {
- cache->abortTransaction();
+ SG_LOG(SG_NAVAID, SG_INFO, "parsing groundnet XML failed:" << e.getFormattedMessage());
}
- SG_LOG(SG_GENERAL, SG_INFO, "parsing XML took " << t.elapsedMSec());
+ SG_LOG(SG_NAVAID, SG_INFO, "parsing groundnet XML took " << t.elapsedMSec());
}
void XMLLoader::load(FGRunwayPreference* p) {
{
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;
}