/**
* reload the ILS data from XML if required.
- * @result true if the data was refreshed, false if no data was loaded
- * or previously cached data is still correct.
*/
- bool validateILSData();
+ void validateILSData();
SGGeod getTowerLocation() const;
bool hasHelipadWithIdent(const std::string& aIdent) const;
FGRunwayRef getRunwayByIdent(const std::string& aIdent) const;
FGHelipadRef getHelipadByIdent(const std::string& aIdent) const;
- FGRunwayRef findBestRunwayForHeading(double aHeading) const;
+
+ struct FindBestRunwayForHeadingParams {
+ FindBestRunwayForHeadingParams() {
+ lengthWeight = 0.01;
+ widthWeight = 0.01;
+ surfaceWeight = 10;
+ deviationWeight = 1;
+ ilsWeight = 0;
+ }
+ double lengthWeight;
+ double widthWeight;
+ double surfaceWeight;
+ double deviationWeight;
+ double ilsWeight;
+ };
+ FGRunwayRef findBestRunwayForHeading(double aHeading, struct FindBestRunwayForHeadingParams * parms = NULL ) const;
/**
* return the most likely target runway based on a position.
* matches in a format suitable for use by a puaList.
*/
static char** searchNamesAndIdents(const std::string& aFilter);
-
+
+
+ /**
+ * Sort an FGPositionedList of airports by size (number of runways + length)
+ * this is meant to prioritise more important airports.
+ */
+ static void sortBySize(FGPositionedList&);
+
flightgear::CommStationList commStationsOfType(FGPositioned::Type aTy) const;
flightgear::CommStationList commStations() const;
* Helper to parse property data loaded from an ICAO.twr.xml file
*/
void readTowerData(SGPropertyNode* aRoot);
-
+
+ PositionedIDVec itemsOfType(FGPositioned::Type ty) const;
+
std::string _name;
bool _has_metar;
FGAirportDynamics *_dynamics;
void loadProcedures() const;
mutable bool mTowerDataLoaded;
+ mutable SGGeod mTowerPosition;
+
mutable bool mRunwaysLoaded;
mutable bool mHelipadsLoaded;
mutable bool mTaxiwaysLoaded;
mutable bool mProceduresLoaded;
+
+ mutable bool mThresholdDataLoaded;
bool mILSDataLoaded;
+
+ mutable std::vector<FGRunwayRef> mRunways;
- mutable PositionedIDVec mRunways;
mutable PositionedIDVec mHelipads;
mutable PositionedIDVec mTaxiways;
PositionedIDVec mPavements;