#include <ATC/CommStation.hxx>
using std::vector;
+using std::pair;
+
using namespace flightgear;
// magic import of a helper which uses FGPositioned internals
return type() == HELIPORT;
}
+bool FGAirport::isAirportType(FGPositioned* pos)
+{
+ if (!pos) {
+ return false;
+ }
+
+ return (pos->type() >= AIRPORT) && (pos->type() <= SEAPORT);
+}
+
FGAirportDynamics * FGAirport::getDynamics()
{
- if (_dynamics != 0) {
+ if (_dynamics) {
return _dynamics;
- } else {
- //cerr << "Trying to load dynamics for " << _id << endl;
- _dynamics = new FGAirportDynamics(this);
- XMLLoader::load(_dynamics);
-
- FGRunwayPreference rwyPrefs(this);
- XMLLoader::load(&rwyPrefs);
- _dynamics->setRwyUse(rwyPrefs);
+ }
+
+ _dynamics = new FGAirportDynamics(this);
+ XMLLoader::load(_dynamics);
- //FGSidStar SIDs(this);
- XMLLoader::load(_dynamics->getSIDs());
- }
+ FGRunwayPreference rwyPrefs(this);
+ XMLLoader::load(&rwyPrefs);
+ _dynamics->setRwyUse(rwyPrefs);
+ XMLLoader::load(_dynamics->getSIDs());
+
return _dynamics;
}
void FGAirport::loadSceneryDefinitions() const
{
- // allow users to disable the scenery data in the short-term
- // longer term, this option can probably disappear
- if (!fgGetBool("/sim/paths/use-custom-scenery-data")) {
- return;
- }
-
SGPath path;
SGPropertyNode_ptr rootNode = new SGPropertyNode;
if (XMLLoader::findAirportData(ident(), "threshold", path)) {
// first, let's identify the current runway
string id(aThreshold->getStringValue("rwy"));
if (!hasRunwayWithIdent(id)) {
- SG_LOG(SG_GENERAL, SG_WARN, "FGAirport::processThreshold: "
+ SG_LOG(SG_GENERAL, SG_DEBUG, "FGAirport::processThreshold: "
"found runway not defined in the global data:" << ident() << "/" << id);
return;
}
<< (aRwy ? aRwy->ident() : "no runway preference"));
}
- return make_pair(sid, enroute);
+ return std::make_pair(sid, enroute);
}
pair<STAR*, WayptRef>
}
} // of STAR iteration
- return make_pair(star, enroute);
+ return std::make_pair(star, enroute);
}