1 #include <simgear/misc/sg_path.hxx>
2 #include <Main/globals.hxx>
4 #include "xmlloader.hxx"
5 #include "dynamicloader.hxx"
6 #include "runwayprefloader.hxx"
8 #include "dynamics.hxx"
9 #include "runwayprefs.hxx"
11 XMLLoader::XMLLoader() {}
12 XMLLoader::~XMLLoader() {}
14 void XMLLoader::load(FGAirportDynamics* d) {
15 FGAirportDynamicsXMLLoader visitor(d);
17 SGPath parkpath( globals->get_fg_root() );
18 parkpath.append( "/AI/Airports/" );
19 parkpath.append( d->getId() );
20 parkpath.append( "parking.xml" );
22 if (parkpath.exists()) {
24 readXML(parkpath.str(), visitor);
26 } catch (const sg_exception &e) {
27 //cerr << "unable to read " << parkpath.str() << endl;
33 void XMLLoader::load(FGRunwayPreference* p) {
34 FGRunwayPreferenceXMLLoader visitor(p);
36 SGPath rwyPrefPath( globals->get_fg_root() );
37 rwyPrefPath.append( "AI/Airports/" );
38 rwyPrefPath.append( p->getId() );
39 rwyPrefPath.append( "rwyuse.xml" );
41 //if (ai_dirs.find(id.c_str()) != ai_dirs.end()
42 // && rwyPrefPath.exists())
43 if (rwyPrefPath.exists()) {
45 readXML(rwyPrefPath.str(), visitor);
46 } catch (const sg_exception &e) {
47 //cerr << "unable to read " << rwyPrefPath.str() << endl;