16#include <simgear/compiler.h>
17#include <simgear/misc/sg_path.hxx>
41 const std::string&
name,
bool has_metar,
Type aType,
54 const std::string&
getName()
const {
return _name; }
75 virtual const std::string&
name()
const
89 void setMetar(
bool value) { _has_metar = value; }
253 const std::vector<flightgear::STAR*>& aStars,
254 const std::vector<flightgear::Approach*>& aApproaches);
338 void loadSceneryDefinitions()
const;
343 void readThresholdData(SGPropertyNode* aRoot);
344 void processThreshold(SGPropertyNode* aThreshold);
346 void readILSData(SGPropertyNode* aRoot);
348 void validateTowerData()
const;
353 void readTowerData(SGPropertyNode* aRoot);
358 void parseRunwayRenameData(SGPropertyNode* aRoot);
363 bool _has_metar =
false;
364 const SGPath _sceneryPath;
366 void loadRunways()
const;
367 void loadHelipads()
const;
368 void loadTaxiways()
const;
369 void loadProcedures()
const;
370 void loadRunwayRenames()
const;
372 mutable bool mTowerDataLoaded;
373 mutable bool mHasTower;
374 mutable SGGeod mTowerPosition;
376 mutable bool mRunwaysLoaded;
377 mutable bool mHelipadsLoaded;
378 mutable bool mTaxiwaysLoaded;
379 mutable bool mProceduresLoaded;
380 mutable bool mRunwayRenamesLoaded =
false;
382 mutable bool mThresholdDataLoaded;
385 mutable std::vector<FGRunwayRef> mRunways;
389 std::vector<FGPavementRef> mPavements;
390 std::vector<FGPavementRef> mBoundary;
391 std::vector<FGPavementRef> mLineFeatures;
393 typedef SGSharedPtr<flightgear::SID> SIDRef;
394 typedef SGSharedPtr<flightgear::STAR> STARRef;
395 typedef SGSharedPtr<flightgear::Approach> ApproachRef;
397 std::vector<SIDRef> mSIDs;
398 std::vector<STARRef> mSTARs;
399 std::vector<ApproachRef> mApproaches;
401 mutable std::unique_ptr<FGGroundNetwork> _groundNetwork;
403 using RunwayRenameMap = std::map<std::string, std::string>;
405 RunwayRenameMap _renamedRunways;
const FGAirport * fgFindAirportID(const std::string &id)
double fgGetAirportElev(const std::string &id)
std::map< std::string, FGRunwayRef > FGRunwayMap
SGSharedPtr< FGTaxiway > FGTaxiwayRef
SGSharedPtr< FGAirportDynamics > FGAirportDynamicsRef
std::vector< FGRunwayRef > FGRunwayList
SGSharedPtr< FGHelipad > FGHelipadRef
SGSharedPtr< FGPavement > FGPavementRef
std::vector< FGPavementRef > FGPavementList
std::map< std::string, FGHelipadRef > FGHelipadMap
SGSharedPtr< FGAirport > FGAirportRef
SGSharedPtr< FGRunway > FGRunwayRef
std::vector< FGTaxiwayRef > FGTaxiwayList
virtual bool pass(FGPositioned *aPos) const
Over-rideable filter method.
virtual Type maxType() const
virtual bool passAirport(FGAirport *aApt) const
virtual Type minType() const
HardSurfaceFilter(double minLengthFt=-1)
virtual bool passAirport(FGAirport *aApt) const override
Filter which passes heliports and seaports in addition to airports.
virtual Type maxType() const override
virtual FGPositioned::Type maxType() const override
bool fromTypeString(const std::string &type)
Construct from string containing type (airport, seaport or heliport)
virtual FGPositioned::Type minType() const override
virtual bool pass(FGPositioned *pos) const override
Over-rideable filter method.
double _min_runway_length_ft
FGAirportDynamicsRef getDynamics() const
SGPath sceneryPath() const
unsigned int numRunways() const
FGPavementRef getPavementByIndex(unsigned int aIndex) const
void testSuiteInjectProceduresXML(const SGPath &path)
std::string findAPTRunwayForNewName(const std::string &newIdent) const
flightgear::STAR * getSTARByIndex(unsigned int aIndex) const
FGRunwayRef findBestRunwayForHeading(double aHeading, struct FindBestRunwayForHeadingParams *parms=NULL) const
FGPavementList getLineFeatures() const
bool isClosed() const
is the airport closed (disused)?
void setProcedures(const std::vector< flightgear::SID * > &aSids, const std::vector< flightgear::STAR * > &aStars, const std::vector< flightgear::Approach * > &aApproaches)
FGHelipadRef getHelipadByIndex(unsigned int aIndex) const
FGRunwayRef findBestRunwayForPos(const SGGeod &aPos) const
return the most likely target runway based on a position.
void validateILSData()
reload the ILS data from XML if required.
unsigned int numApproaches() const
unsigned int numSIDs() const
unsigned int numTaxiways() const
FGRunwayRef getRunwayByIndex(unsigned int aIndex) const
FGRunwayList getRunwaysWithoutReciprocals() const
Retrieve all runways at the airport, but excluding the reciprocal runways.
double getElevation() const
double getLatitude() const
double getLongitude() const
FGRunwayRef getRunwayByIdent(const std::string &aIdent) const
void addLineFeature(FGPavementRef linefeature)
static void sortBySize(FGPositionedList &)
Sort an FGPositionedList of airports by size (number of runways + length) this is meant to prioritise...
flightgear::Transition * selectSIDByEnrouteTransition(FGPositioned *enroute) const
flightgear::CommStationList commStationsOfType(FGPositioned::Type aTy) const
std::string toString() const
bool hasHardRunwayOfLengthFt(double aLengthFt) const
Useful predicate for FMS/GPS/NAV displays and similar - check if this airport has a hard-surfaced run...
FGPavementList getPavements() const
static FGAirportRef findClosest(const SGGeod &aPos, double aCuttofNm, Filter *filter=NULL)
Syntactic wrapper around FGPositioned::findClosest - find the closest match for filter,...
unsigned int numLineFeatures() const
flightgear::Approach * getApproachByIndex(unsigned int aIndex) const
static void clearAirportsCache()
unsigned int numHelipads() const
void setMetar(bool value)
flightgear::Transition * selectSTARByTransition(const FGRunway *runway, const std::string &aIdent) const
static FGAirportRef findByIdent(const std::string &aIdent)
Helper to look up an FGAirport instance by unique ident.
flightgear::STAR * findSTARWithIdent(const std::string &aIdent) const
bool hasHelipadWithIdent(const std::string &aIdent) const
void addSID(flightgear::SID *aSid)
void addPavement(FGPavementRef pavement)
static char ** searchNamesAndIdents(const std::string &aFilter)
Specialised helper to implement the AirportList dialog.
virtual const std::string & name() const
Return the name of this positioned.
FGPavementRef getBoundaryIndex(unsigned int aIndex) const
FGTaxiwayList getTaxiways() const
bool hasRunwayWithIdent(const std::string &aIdent) const
void testSuiteInjectGroundnetXML(const SGPath &path)
flightgear::ApproachList getApproaches(flightgear::ProcedureType type=flightgear::PROCEDURE_INVALID) const
flightgear::Transition * selectSTARByEnrouteTransition(FGPositioned *enroute) const
FGPavementList getBoundary() const
unsigned int numPavements() const
FGRunwayRef longestRunway() const
void addSTAR(flightgear::STAR *aStar)
FGTaxiwayRef getTaxiwayByIndex(unsigned int aIndex) const
FGRunwayList getRunways() const
Retrieve all runways at the airport.
flightgear::CommStationList commStations() const
const std::string & getName() const
flightgear::STARList getSTARs() const
void addApproach(flightgear::Approach *aApp)
const std::string & getId() const
SGGeod getTowerLocation() const
FGAirport(PositionedID aGuid, const std::string &id, const SGGeod &location, const std::string &name, bool has_metar, Type aType, SGPath sceneryPath=SGPath())
flightgear::Approach * findApproachWithIdent(const std::string &aIdent) const
static bool isType(FGPositioned::Type ty)
void addBoundary(FGPavementRef boundary)
FGRunwayMap getRunwayMap() const
unsigned int numBoundary() const
flightgear::SID * findSIDWithIdent(const std::string &aIdent) const
FGHelipadRef getHelipadByIdent(const std::string &aIdent) const
unsigned int numSTARs() const
flightgear::SID * getSIDByIndex(unsigned int aIndex) const
FGRunwayRef getActiveRunwayForUsage() const
FGHelipadMap getHelipadMap() const
flightgear::Transition * selectSIDByTransition(const FGRunway *runway, const std::string &aIdent) const
FGGroundNetwork * groundNetwork() const
flightgear::SIDList getSIDs() const
static FGAirportRef getByIdent(const std::string &aIdent)
Helper to look up an FGAirport instance by unique ident.
Predicate class to support custom filtering of FGPositioned queries Default implementation of this pa...
FGPositioned(PositionedID aGuid, Type ty, const std::string &aIdent, const SGGeod &aPos)
const std::string & ident() const
Describe an approach procedure, including the missed approach segment.
Encapsulate a transition segment.
std::vector< Approach * > ApproachList
std::vector< CommStationRef > CommStationList
std::vector< STAR * > STARList
std::vector< flightgear::SID * > SIDList
std::map< std::string, FGAirport * > AirportCache
std::vector< PositionedID > PositionedIDVec
std::vector< FGPositionedRef > FGPositionedList
FindBestRunwayForHeadingParams()