2013-02-21 11:32:02 +00:00
|
|
|
// airport.hxx -- a really simplistic class to manage airport ID,
|
2006-07-10 11:36:38 +00:00
|
|
|
// lat, lon of the center of one of it's runways, and
|
1998-08-25 17:19:13 +00:00
|
|
|
// elevation in feet.
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started April 1998.
|
2005-02-10 09:01:51 +00:00
|
|
|
// Updated by Durk Talsma, started December 2004.
|
1998-08-25 17:19:13 +00:00
|
|
|
//
|
2004-11-19 22:10:41 +00:00
|
|
|
// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
|
1998-08-25 17:19:13 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
2006-02-21 01:16:04 +00:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
1998-08-25 17:19:13 +00:00
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
|
2003-08-28 20:53:08 +00:00
|
|
|
#ifndef _FG_SIMPLE_HXX
|
|
|
|
#define _FG_SIMPLE_HXX
|
1998-08-25 17:19:13 +00:00
|
|
|
|
2000-02-15 03:30:01 +00:00
|
|
|
#include <simgear/compiler.h>
|
|
|
|
|
2008-07-25 18:38:29 +00:00
|
|
|
#include <string>
|
2003-11-27 23:37:03 +00:00
|
|
|
#include <vector>
|
2012-11-24 12:42:31 +01:00
|
|
|
#include <map>
|
2016-01-10 22:11:32 -06:00
|
|
|
#include <memory>
|
2000-05-27 05:54:02 +00:00
|
|
|
|
2009-05-14 20:55:09 +00:00
|
|
|
#include <Navaids/positioned.hxx>
|
2013-03-04 16:31:37 +01:00
|
|
|
#include <Navaids/procedure.hxx>
|
2009-10-11 12:37:13 +01:00
|
|
|
|
2013-03-04 16:31:37 +01:00
|
|
|
#include "airports_fwd.hxx"
|
|
|
|
#include "runways.hxx"
|
2009-10-11 12:37:13 +01:00
|
|
|
|
2016-01-10 16:38:01 -06:00
|
|
|
class FGGroundNetwork;
|
|
|
|
|
2005-10-18 18:44:37 +00:00
|
|
|
/***************************************************************************************
|
|
|
|
*
|
|
|
|
**************************************************************************************/
|
James Turner:
Trivial patch, but an important milestone:
Convert FGAirport to inherit FGPositioned. This concludes the first phase of the FGPositioned changes, and hopefully the most intrusive ones - adding in the base class. There's lots (and lots) of further work to do on the indexing and querying side, as well as cleaning up the accessors, but that will happen in single source files, or a group of related files at a time.
As a trivial note, this patch does fix a bug where the very last airport in apt.dat would get an invalid type. So for all you people who just love to fly to EHYB (Ypenburg, The Hague), things may work a little more sanely.
I'll intentionally let the dust settle after this patch, so any weird behaviour I may potentially have introduced shows up. Just to re-iterate, so far there should be absolutely no user-visible change in the behaviour of anything - navaids, position init, the route manager, AI flight plans, etc. If there is, please let me know and I'll fix it ASAP.
2008-09-13 08:07:22 +00:00
|
|
|
class FGAirport : public FGPositioned
|
|
|
|
{
|
2013-03-04 23:14:26 +01:00
|
|
|
public:
|
2012-08-28 00:26:36 +01:00
|
|
|
FGAirport(PositionedID aGuid, const std::string& id, const SGGeod& location,
|
James Turner:
Trivial patch, but an important milestone:
Convert FGAirport to inherit FGPositioned. This concludes the first phase of the FGPositioned changes, and hopefully the most intrusive ones - adding in the base class. There's lots (and lots) of further work to do on the indexing and querying side, as well as cleaning up the accessors, but that will happen in single source files, or a group of related files at a time.
As a trivial note, this patch does fix a bug where the very last airport in apt.dat would get an invalid type. So for all you people who just love to fly to EHYB (Ypenburg, The Hague), things may work a little more sanely.
I'll intentionally let the dust settle after this patch, so any weird behaviour I may potentially have introduced shows up. Just to re-iterate, so far there should be absolutely no user-visible change in the behaviour of anything - navaids, position init, the route manager, AI flight plans, etc. If there is, please let me know and I'll fix it ASAP.
2008-09-13 08:07:22 +00:00
|
|
|
const std::string& name, bool has_metar, Type aType);
|
2006-07-10 11:36:38 +00:00
|
|
|
~FGAirport();
|
|
|
|
|
2018-05-07 16:40:38 +01:00
|
|
|
static bool isType(FGPositioned::Type ty)
|
|
|
|
{ return (ty >= FGPositioned::AIRPORT) && (ty <= FGPositioned::SEAPORT); }
|
|
|
|
|
James Turner:
Trivial patch, but an important milestone:
Convert FGAirport to inherit FGPositioned. This concludes the first phase of the FGPositioned changes, and hopefully the most intrusive ones - adding in the base class. There's lots (and lots) of further work to do on the indexing and querying side, as well as cleaning up the accessors, but that will happen in single source files, or a group of related files at a time.
As a trivial note, this patch does fix a bug where the very last airport in apt.dat would get an invalid type. So for all you people who just love to fly to EHYB (Ypenburg, The Hague), things may work a little more sanely.
I'll intentionally let the dust settle after this patch, so any weird behaviour I may potentially have introduced shows up. Just to re-iterate, so far there should be absolutely no user-visible change in the behaviour of anything - navaids, position init, the route manager, AI flight plans, etc. If there is, please let me know and I'll fix it ASAP.
2008-09-13 08:07:22 +00:00
|
|
|
const std::string& getId() const { return ident(); }
|
2008-08-14 18:13:39 +00:00
|
|
|
const std::string& getName() const { return _name; }
|
2013-03-04 19:24:47 +01:00
|
|
|
std::string toString() const { return "an airport " + ident(); }
|
|
|
|
|
James Turner:
Trivial patch, but an important milestone:
Convert FGAirport to inherit FGPositioned. This concludes the first phase of the FGPositioned changes, and hopefully the most intrusive ones - adding in the base class. There's lots (and lots) of further work to do on the indexing and querying side, as well as cleaning up the accessors, but that will happen in single source files, or a group of related files at a time.
As a trivial note, this patch does fix a bug where the very last airport in apt.dat would get an invalid type. So for all you people who just love to fly to EHYB (Ypenburg, The Hague), things may work a little more sanely.
I'll intentionally let the dust settle after this patch, so any weird behaviour I may potentially have introduced shows up. Just to re-iterate, so far there should be absolutely no user-visible change in the behaviour of anything - navaids, position init, the route manager, AI flight plans, etc. If there is, please let me know and I'll fix it ASAP.
2008-09-13 08:07:22 +00:00
|
|
|
double getLongitude() const { return longitude(); }
|
2006-07-10 11:36:38 +00:00
|
|
|
// Returns degrees
|
James Turner:
Trivial patch, but an important milestone:
Convert FGAirport to inherit FGPositioned. This concludes the first phase of the FGPositioned changes, and hopefully the most intrusive ones - adding in the base class. There's lots (and lots) of further work to do on the indexing and querying side, as well as cleaning up the accessors, but that will happen in single source files, or a group of related files at a time.
As a trivial note, this patch does fix a bug where the very last airport in apt.dat would get an invalid type. So for all you people who just love to fly to EHYB (Ypenburg, The Hague), things may work a little more sanely.
I'll intentionally let the dust settle after this patch, so any weird behaviour I may potentially have introduced shows up. Just to re-iterate, so far there should be absolutely no user-visible change in the behaviour of anything - navaids, position init, the route manager, AI flight plans, etc. If there is, please let me know and I'll fix it ASAP.
2008-09-13 08:07:22 +00:00
|
|
|
double getLatitude() const { return latitude(); }
|
2006-07-10 11:36:38 +00:00
|
|
|
// Returns ft
|
James Turner:
Trivial patch, but an important milestone:
Convert FGAirport to inherit FGPositioned. This concludes the first phase of the FGPositioned changes, and hopefully the most intrusive ones - adding in the base class. There's lots (and lots) of further work to do on the indexing and querying side, as well as cleaning up the accessors, but that will happen in single source files, or a group of related files at a time.
As a trivial note, this patch does fix a bug where the very last airport in apt.dat would get an invalid type. So for all you people who just love to fly to EHYB (Ypenburg, The Hague), things may work a little more sanely.
I'll intentionally let the dust settle after this patch, so any weird behaviour I may potentially have introduced shows up. Just to re-iterate, so far there should be absolutely no user-visible change in the behaviour of anything - navaids, position init, the route manager, AI flight plans, etc. If there is, please let me know and I'll fix it ASAP.
2008-09-13 08:07:22 +00:00
|
|
|
double getElevation() const { return elevation(); }
|
2006-07-10 11:36:38 +00:00
|
|
|
bool getMetar() const { return _has_metar; }
|
James Turner:
Trivial patch, but an important milestone:
Convert FGAirport to inherit FGPositioned. This concludes the first phase of the FGPositioned changes, and hopefully the most intrusive ones - adding in the base class. There's lots (and lots) of further work to do on the indexing and querying side, as well as cleaning up the accessors, but that will happen in single source files, or a group of related files at a time.
As a trivial note, this patch does fix a bug where the very last airport in apt.dat would get an invalid type. So for all you people who just love to fly to EHYB (Ypenburg, The Hague), things may work a little more sanely.
I'll intentionally let the dust settle after this patch, so any weird behaviour I may potentially have introduced shows up. Just to re-iterate, so far there should be absolutely no user-visible change in the behaviour of anything - navaids, position init, the route manager, AI flight plans, etc. If there is, please let me know and I'll fix it ASAP.
2008-09-13 08:07:22 +00:00
|
|
|
bool isAirport() const;
|
|
|
|
bool isSeaport() const;
|
|
|
|
bool isHeliport() const;
|
2006-07-10 11:36:38 +00:00
|
|
|
|
2015-11-15 14:48:48 +00:00
|
|
|
/// is the airport closed (disused)?
|
|
|
|
/// note at rpesent we look for an [x] in the name, ideally the database
|
|
|
|
/// would explicitly include this
|
|
|
|
bool isClosed() const
|
|
|
|
{
|
|
|
|
return mIsClosed;
|
|
|
|
}
|
|
|
|
|
2008-12-25 23:11:43 +00:00
|
|
|
virtual const std::string& name() const
|
|
|
|
{ return _name; }
|
|
|
|
|
2012-08-28 00:26:36 +01:00
|
|
|
/**
|
|
|
|
* reload the ILS data from XML if required.
|
|
|
|
*/
|
2014-02-21 12:56:03 -08:00
|
|
|
void validateILSData();
|
2012-08-28 00:26:36 +01:00
|
|
|
|
2015-11-10 22:54:57 +00:00
|
|
|
bool hasTower() const;
|
|
|
|
|
2012-08-28 00:26:36 +01:00
|
|
|
SGGeod getTowerLocation() const;
|
2007-09-09 23:21:48 +00:00
|
|
|
|
2006-07-10 11:36:38 +00:00
|
|
|
void setMetar(bool value) { _has_metar = value; }
|
|
|
|
|
2013-03-06 23:21:29 +01:00
|
|
|
FGRunwayRef getActiveRunwayForUsage() const;
|
2006-07-10 11:36:38 +00:00
|
|
|
|
2015-12-05 00:25:29 +00:00
|
|
|
FGAirportDynamicsRef getDynamics() const;
|
2008-08-14 18:13:39 +00:00
|
|
|
|
2016-01-10 16:38:01 -06:00
|
|
|
FGGroundNetwork* groundNetwork() const;
|
|
|
|
|
2008-08-14 18:13:39 +00:00
|
|
|
unsigned int numRunways() const;
|
2013-02-20 23:35:32 +01:00
|
|
|
unsigned int numHelipads() const;
|
2013-03-06 23:21:29 +01:00
|
|
|
FGRunwayRef getRunwayByIndex(unsigned int aIndex) const;
|
|
|
|
FGHelipadRef getHelipadByIndex(unsigned int aIndex) const;
|
2013-03-04 16:31:37 +01:00
|
|
|
FGRunwayMap getRunwayMap() const;
|
|
|
|
FGHelipadMap getHelipadMap() const;
|
2008-08-14 18:13:39 +00:00
|
|
|
|
|
|
|
bool hasRunwayWithIdent(const std::string& aIdent) const;
|
2013-02-21 16:14:44 +01:00
|
|
|
bool hasHelipadWithIdent(const std::string& aIdent) const;
|
2013-03-06 23:21:29 +01:00
|
|
|
FGRunwayRef getRunwayByIdent(const std::string& aIdent) const;
|
|
|
|
FGHelipadRef getHelipadByIdent(const std::string& aIdent) const;
|
2014-02-19 14:24:34 +01:00
|
|
|
|
|
|
|
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;
|
2008-08-14 18:13:39 +00:00
|
|
|
|
2009-10-11 12:37:13 +01:00
|
|
|
/**
|
|
|
|
* return the most likely target runway based on a position.
|
|
|
|
* Specifically, return the runway for which the course from aPos
|
|
|
|
* to the runway end, mostly closely matches the runway heading.
|
|
|
|
* This is a good approximation of which runway the position is on or
|
|
|
|
* aiming towards.
|
|
|
|
*/
|
2013-03-06 23:21:29 +01:00
|
|
|
FGRunwayRef findBestRunwayForPos(const SGGeod& aPos) const;
|
2009-10-11 12:37:13 +01:00
|
|
|
|
2013-02-28 18:21:23 +00:00
|
|
|
/**
|
|
|
|
* Retrieve all runways at the airport, but excluding the reciprocal
|
|
|
|
* runways. For example at KSFO this might return 1L, 1R, 28L and 28R,
|
|
|
|
* but would not then include 19L/R or 10L/R.
|
|
|
|
*
|
|
|
|
* Exactly which runways you get, is undefined (i.e, dont assumes it's
|
|
|
|
* runways with heading < 180 degrees) - it depends on order in apt.dat.
|
|
|
|
*
|
|
|
|
* This is useful for code that wants to process each piece of tarmac at
|
|
|
|
* an airport *once*, not *twice* - eg mapping and nav-display code.
|
|
|
|
*/
|
|
|
|
FGRunwayList getRunwaysWithoutReciprocals() const;
|
2015-03-28 00:33:26 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve all runways at the airport
|
|
|
|
*/
|
|
|
|
FGRunwayList getRunways() const;
|
2013-02-28 18:21:23 +00:00
|
|
|
|
2008-12-23 12:37:59 +00:00
|
|
|
/**
|
|
|
|
* Useful predicate for FMS/GPS/NAV displays and similar - check if this
|
|
|
|
* aiport has a hard-surfaced runway of at least the specified length.
|
|
|
|
*/
|
|
|
|
bool hasHardRunwayOfLengthFt(double aLengthFt) const;
|
2009-06-14 11:08:21 +00:00
|
|
|
|
2015-11-10 22:54:57 +00:00
|
|
|
FGRunwayRef longestRunway() const;
|
|
|
|
|
2008-08-14 18:13:39 +00:00
|
|
|
unsigned int numTaxiways() const;
|
2013-03-06 23:21:29 +01:00
|
|
|
FGTaxiwayRef getTaxiwayByIndex(unsigned int aIndex) const;
|
2013-03-04 16:31:37 +01:00
|
|
|
FGTaxiwayList getTaxiways() const;
|
2009-06-14 11:08:21 +00:00
|
|
|
|
|
|
|
unsigned int numPavements() const;
|
2013-03-06 23:21:29 +01:00
|
|
|
FGPavementRef getPavementByIndex(unsigned int aIndex) const;
|
2013-03-04 16:31:37 +01:00
|
|
|
FGPavementList getPavements() const;
|
2008-12-23 12:37:59 +00:00
|
|
|
|
|
|
|
class AirportFilter : public Filter
|
2013-03-04 23:14:26 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool pass(FGPositioned* aPos) const {
|
|
|
|
return passAirport(static_cast<FGAirport*>(aPos));
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual Type minType() const {
|
|
|
|
return AIRPORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual Type maxType() const {
|
|
|
|
return AIRPORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool passAirport(FGAirport* aApt) const {
|
|
|
|
return true;
|
|
|
|
}
|
2008-12-23 12:37:59 +00:00
|
|
|
};
|
|
|
|
|
2009-10-28 08:27:19 +00:00
|
|
|
/**
|
|
|
|
* Filter which passes heliports and seaports in addition to airports
|
|
|
|
*/
|
|
|
|
class PortsFilter : public AirportFilter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual Type maxType() const {
|
|
|
|
return SEAPORT;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-01-08 21:11:53 +00:00
|
|
|
class HardSurfaceFilter : public AirportFilter
|
2008-12-23 12:37:59 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-05-16 16:51:39 +01:00
|
|
|
HardSurfaceFilter(double minLengthFt = -1);
|
2008-12-23 12:37:59 +00:00
|
|
|
|
2009-01-08 21:11:53 +00:00
|
|
|
virtual bool passAirport(FGAirport* aApt) const;
|
|
|
|
|
2008-12-23 12:37:59 +00:00
|
|
|
private:
|
|
|
|
double mMinLengthFt;
|
|
|
|
};
|
|
|
|
|
2013-03-04 23:14:26 +01:00
|
|
|
/**
|
|
|
|
* Filter which passes specified port type and in case of airport checks
|
|
|
|
* if a runway larger the /sim/navdb/min-runway-lenght-ft exists.
|
|
|
|
*/
|
|
|
|
class TypeRunwayFilter:
|
|
|
|
public AirportFilter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TypeRunwayFilter();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct from string containing type (airport, seaport or heliport)
|
|
|
|
*/
|
|
|
|
bool fromTypeString(const std::string& type);
|
|
|
|
|
|
|
|
virtual FGPositioned::Type minType() const { return _type; }
|
|
|
|
virtual FGPositioned::Type maxType() const { return _type; }
|
|
|
|
virtual bool pass(FGPositioned* pos) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
FGPositioned::Type _type;
|
|
|
|
double _min_runway_length_ft;
|
|
|
|
};
|
|
|
|
|
2009-10-11 12:37:13 +01:00
|
|
|
|
|
|
|
void setProcedures(const std::vector<flightgear::SID*>& aSids,
|
|
|
|
const std::vector<flightgear::STAR*>& aStars,
|
|
|
|
const std::vector<flightgear::Approach*>& aApproaches);
|
|
|
|
|
|
|
|
void addSID(flightgear::SID* aSid);
|
|
|
|
void addSTAR(flightgear::STAR* aStar);
|
|
|
|
void addApproach(flightgear::Approach* aApp);
|
|
|
|
|
|
|
|
unsigned int numSIDs() const;
|
|
|
|
flightgear::SID* getSIDByIndex(unsigned int aIndex) const;
|
|
|
|
flightgear::SID* findSIDWithIdent(const std::string& aIdent) const;
|
2013-03-04 16:31:37 +01:00
|
|
|
flightgear::SIDList getSIDs() const;
|
2018-07-19 22:41:54 +01:00
|
|
|
|
|
|
|
flightgear::Transition* selectSIDByEnrouteTransition(FGPositioned* enroute) const;
|
|
|
|
flightgear::Transition* selectSIDByTransition(const std::string& aIdent) const;
|
|
|
|
|
2009-10-11 12:37:13 +01:00
|
|
|
unsigned int numSTARs() const;
|
|
|
|
flightgear::STAR* getSTARByIndex(unsigned int aIndex) const;
|
|
|
|
flightgear::STAR* findSTARWithIdent(const std::string& aIdent) const;
|
2013-03-04 16:31:37 +01:00
|
|
|
flightgear::STARList getSTARs() const;
|
2018-07-19 22:41:54 +01:00
|
|
|
|
|
|
|
flightgear::Transition* selectSTARByEnrouteTransition(FGPositioned* enroute) const;
|
|
|
|
flightgear::Transition* selectSTARByTransition(const std::string& aIdent) const;
|
|
|
|
|
2009-10-11 12:37:13 +01:00
|
|
|
unsigned int numApproaches() const;
|
|
|
|
flightgear::Approach* getApproachByIndex(unsigned int aIndex) const;
|
2012-04-24 22:55:30 +01:00
|
|
|
flightgear::Approach* findApproachWithIdent(const std::string& aIdent) const;
|
2013-03-04 16:31:37 +01:00
|
|
|
flightgear::ApproachList getApproaches
|
|
|
|
(
|
|
|
|
flightgear::ProcedureType type = flightgear::PROCEDURE_INVALID
|
|
|
|
) const;
|
2012-04-24 22:55:30 +01:00
|
|
|
|
2008-12-23 12:37:59 +00:00
|
|
|
/**
|
|
|
|
* Syntactic wrapper around FGPositioned::findClosest - find the closest
|
|
|
|
* match for filter, and return it cast to FGAirport. The default filter
|
2009-10-13 06:48:52 +00:00
|
|
|
* passes airports, but not seaports or heliports
|
2008-12-23 12:37:59 +00:00
|
|
|
*/
|
2013-03-06 23:21:29 +01:00
|
|
|
static FGAirportRef findClosest(const SGGeod& aPos, double aCuttofNm, Filter* filter = NULL);
|
2008-12-26 15:26:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper to look up an FGAirport instance by unique ident. Throws an
|
|
|
|
* exception if the airport could not be found - so callers can assume
|
|
|
|
* the result is non-NULL.
|
|
|
|
*/
|
2013-03-06 23:21:29 +01:00
|
|
|
static FGAirportRef getByIdent(const std::string& aIdent);
|
2008-12-26 15:26:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper to look up an FGAirport instance by unique ident. Returns NULL
|
|
|
|
* if the airport could not be found.
|
|
|
|
*/
|
2013-03-06 23:21:29 +01:00
|
|
|
static FGAirportRef findByIdent(const std::string& aIdent);
|
2008-12-26 15:26:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Specialised helper to implement the AirportList dialog. Performs a
|
|
|
|
* case-insensitive search on airport names and ICAO codes, and returns
|
|
|
|
* matches in a format suitable for use by a puaList.
|
|
|
|
*/
|
|
|
|
static char** searchNamesAndIdents(const std::string& aFilter);
|
2013-10-26 22:53:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sort an FGPositionedList of airports by size (number of runways + length)
|
|
|
|
* this is meant to prioritise more important airports.
|
|
|
|
*/
|
|
|
|
static void sortBySize(FGPositionedList&);
|
|
|
|
|
2011-05-25 07:50:15 +01:00
|
|
|
flightgear::CommStationList commStationsOfType(FGPositioned::Type aTy) const;
|
|
|
|
|
2012-08-28 00:26:36 +01:00
|
|
|
flightgear::CommStationList commStations() const;
|
2005-12-29 13:58:21 +00:00
|
|
|
private:
|
2012-11-24 12:42:31 +01:00
|
|
|
static flightgear::AirportCache airportCache;
|
|
|
|
|
2009-08-29 10:21:21 +00:00
|
|
|
// disable these
|
2006-07-10 11:36:38 +00:00
|
|
|
FGAirport operator=(FGAirport &other);
|
|
|
|
FGAirport(const FGAirport&);
|
2009-08-29 10:21:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* helper to read airport data from the scenery XML files.
|
|
|
|
*/
|
2010-12-11 10:43:39 +01:00
|
|
|
void loadSceneryDefinitions() const;
|
2009-08-29 10:21:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Helpers to process property data loaded from an ICAO.threshold.xml file
|
|
|
|
*/
|
|
|
|
void readThresholdData(SGPropertyNode* aRoot);
|
|
|
|
void processThreshold(SGPropertyNode* aThreshold);
|
2012-08-28 00:26:36 +01:00
|
|
|
|
2012-09-19 22:33:43 +01:00
|
|
|
void readILSData(SGPropertyNode* aRoot);
|
2012-08-28 00:26:36 +01:00
|
|
|
|
|
|
|
void validateTowerData() const;
|
2009-08-29 10:21:21 +00:00
|
|
|
|
|
|
|
/**
|
2013-02-20 23:35:32 +01:00
|
|
|
* Helper to parse property data loaded from an ICAO.twr.xml file
|
2009-08-29 10:21:21 +00:00
|
|
|
*/
|
|
|
|
void readTowerData(SGPropertyNode* aRoot);
|
2014-02-21 10:59:13 -08:00
|
|
|
|
|
|
|
PositionedIDVec itemsOfType(FGPositioned::Type ty) const;
|
|
|
|
|
2009-08-29 10:21:21 +00:00
|
|
|
std::string _name;
|
|
|
|
bool _has_metar;
|
|
|
|
|
2009-08-29 18:00:14 +00:00
|
|
|
void loadRunways() const;
|
2013-02-20 23:35:32 +01:00
|
|
|
void loadHelipads() const;
|
2009-08-29 18:00:14 +00:00
|
|
|
void loadTaxiways() const;
|
2009-10-11 12:37:13 +01:00
|
|
|
void loadProcedures() const;
|
2009-08-29 18:00:14 +00:00
|
|
|
|
2012-08-28 00:26:36 +01:00
|
|
|
mutable bool mTowerDataLoaded;
|
2015-11-10 22:54:57 +00:00
|
|
|
mutable bool mHasTower;
|
2014-02-21 10:11:09 -08:00
|
|
|
mutable SGGeod mTowerPosition;
|
|
|
|
|
2009-08-29 18:00:14 +00:00
|
|
|
mutable bool mRunwaysLoaded;
|
2013-02-20 23:35:32 +01:00
|
|
|
mutable bool mHelipadsLoaded;
|
2009-08-29 18:00:14 +00:00
|
|
|
mutable bool mTaxiwaysLoaded;
|
2009-10-11 12:37:13 +01:00
|
|
|
mutable bool mProceduresLoaded;
|
2015-11-15 14:48:48 +00:00
|
|
|
bool mIsClosed;
|
2014-02-21 12:56:03 -08:00
|
|
|
mutable bool mThresholdDataLoaded;
|
2012-09-19 22:33:43 +01:00
|
|
|
bool mILSDataLoaded;
|
2014-02-21 10:59:13 -08:00
|
|
|
|
|
|
|
mutable std::vector<FGRunwayRef> mRunways;
|
2012-08-28 00:26:36 +01:00
|
|
|
|
2013-02-20 23:35:32 +01:00
|
|
|
mutable PositionedIDVec mHelipads;
|
2012-08-28 00:26:36 +01:00
|
|
|
mutable PositionedIDVec mTaxiways;
|
|
|
|
PositionedIDVec mPavements;
|
2009-10-11 12:37:13 +01:00
|
|
|
|
2012-11-12 22:30:28 +01:00
|
|
|
typedef SGSharedPtr<flightgear::SID> SIDRef;
|
|
|
|
typedef SGSharedPtr<flightgear::STAR> STARRef;
|
|
|
|
typedef SGSharedPtr<flightgear::Approach> ApproachRef;
|
|
|
|
|
|
|
|
std::vector<SIDRef> mSIDs;
|
|
|
|
std::vector<STARRef> mSTARs;
|
|
|
|
std::vector<ApproachRef> mApproaches;
|
2016-01-10 16:38:01 -06:00
|
|
|
|
2016-11-14 22:20:14 +01:00
|
|
|
mutable std::unique_ptr<FGGroundNetwork> _groundNetwork;
|
2012-08-28 00:26:36 +01:00
|
|
|
};
|
1998-08-25 17:19:13 +00:00
|
|
|
|
2005-12-29 13:58:21 +00:00
|
|
|
// find basic airport location info from airport database
|
2008-08-14 18:13:39 +00:00
|
|
|
const FGAirport *fgFindAirportID( const std::string& id);
|
2005-12-29 13:58:21 +00:00
|
|
|
|
|
|
|
// get airport elevation
|
2008-08-14 18:13:39 +00:00
|
|
|
double fgGetAirportElev( const std::string& id );
|
2005-12-29 13:58:21 +00:00
|
|
|
|
2003-08-28 20:53:08 +00:00
|
|
|
#endif // _FG_SIMPLE_HXX
|
1998-08-25 17:19:13 +00:00
|
|
|
|
|
|
|
|