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 11:42:31 +00:00
|
|
|
#include <map>
|
2000-05-27 05:54:02 +00:00
|
|
|
|
2009-05-14 20:55:09 +00:00
|
|
|
#include <Navaids/positioned.hxx>
|
2005-10-18 18:44:37 +00:00
|
|
|
|
2008-08-14 18:13:39 +00:00
|
|
|
// forward decls
|
|
|
|
class FGAirportDynamics;
|
James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.
An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
|
|
|
class FGRunway;
|
2013-02-20 22:35:32 +00:00
|
|
|
class FGHelipad;
|
2008-12-29 22:23:22 +00:00
|
|
|
class FGTaxiway;
|
2009-06-14 11:08:21 +00:00
|
|
|
class FGPavement;
|
2009-08-29 10:21:21 +00:00
|
|
|
class SGPropertyNode;
|
2012-11-24 11:42:31 +00:00
|
|
|
class FGAirport;
|
James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.
An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
|
|
|
|
2009-10-11 11:37:13 +00:00
|
|
|
namespace flightgear {
|
|
|
|
class SID;
|
|
|
|
class STAR;
|
|
|
|
class Approach;
|
|
|
|
class Waypt;
|
2011-05-25 06:50:15 +00:00
|
|
|
class CommStation;
|
2009-10-11 11:37:13 +00:00
|
|
|
|
|
|
|
typedef SGSharedPtr<Waypt> WayptRef;
|
|
|
|
typedef std::vector<WayptRef> WayptVec;
|
2011-05-25 06:50:15 +00:00
|
|
|
|
|
|
|
typedef std::vector<CommStation*> CommStationList;
|
2012-11-24 11:42:31 +00:00
|
|
|
typedef std::map<std::string, FGAirport*> AirportCache;
|
2009-10-11 11:37:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2005-02-10 09:01:51 +00:00
|
|
|
public:
|
2012-08-27 23:26:36 +00: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();
|
|
|
|
|
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; }
|
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
|
|
|
|
2012-04-16 09:18:37 +00:00
|
|
|
static bool isAirportType(FGPositioned* pos);
|
|
|
|
|
2008-12-25 23:11:43 +00:00
|
|
|
virtual const std::string& name() const
|
|
|
|
{ return _name; }
|
|
|
|
|
2012-08-27 23:26:36 +00:00
|
|
|
/**
|
|
|
|
* 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();
|
|
|
|
|
|
|
|
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; }
|
|
|
|
|
James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.
An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
|
|
|
FGRunway* getActiveRunwayForUsage() const;
|
2006-07-10 11:36:38 +00:00
|
|
|
|
2008-08-14 18:13:39 +00:00
|
|
|
FGAirportDynamics *getDynamics();
|
|
|
|
|
|
|
|
unsigned int numRunways() const;
|
2013-02-20 22:35:32 +00:00
|
|
|
unsigned int numHelipads() const;
|
James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.
An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
|
|
|
FGRunway* getRunwayByIndex(unsigned int aIndex) const;
|
2013-02-20 22:35:32 +00:00
|
|
|
FGHelipad* getHelipadByIndex(unsigned int aIndex) const;
|
2008-08-14 18:13:39 +00:00
|
|
|
|
|
|
|
bool hasRunwayWithIdent(const std::string& aIdent) const;
|
2013-02-21 15:14:44 +00:00
|
|
|
bool hasHelipadWithIdent(const std::string& aIdent) const;
|
James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.
An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
|
|
|
FGRunway* getRunwayByIdent(const std::string& aIdent) const;
|
2013-02-21 15:14:44 +00:00
|
|
|
FGHelipad* getHelipadByIdent(const std::string& aIdent) const;
|
James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.
An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
|
|
|
FGRunway* findBestRunwayForHeading(double aHeading) const;
|
2008-08-14 18:13:39 +00:00
|
|
|
|
2009-10-11 11:37:13 +00: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.
|
|
|
|
*/
|
|
|
|
FGRunway* findBestRunwayForPos(const SGGeod& aPos) const;
|
|
|
|
|
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
|
|
|
|
2008-08-14 18:13:39 +00:00
|
|
|
unsigned int numTaxiways() const;
|
2008-12-29 22:23:22 +00:00
|
|
|
FGTaxiway* getTaxiwayByIndex(unsigned int aIndex) const;
|
2009-06-14 11:08:21 +00:00
|
|
|
|
|
|
|
unsigned int numPavements() const;
|
|
|
|
FGPavement* getPavementByIndex(unsigned int aIndex) const;
|
2008-12-23 12:37:59 +00:00
|
|
|
|
|
|
|
class AirportFilter : public Filter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool pass(FGPositioned* aPos) const {
|
2009-01-08 21:11:53 +00:00
|
|
|
return passAirport(static_cast<FGAirport*>(aPos));
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual Type minType() const {
|
|
|
|
return AIRPORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual Type maxType() const {
|
2009-10-13 06:48:52 +00:00
|
|
|
return AIRPORT;
|
2009-01-08 21:11:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 15:51:39 +00: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;
|
|
|
|
};
|
|
|
|
|
2009-10-11 11:37:13 +00: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;
|
|
|
|
|
|
|
|
unsigned int numSTARs() const;
|
|
|
|
flightgear::STAR* getSTARByIndex(unsigned int aIndex) const;
|
|
|
|
flightgear::STAR* findSTARWithIdent(const std::string& aIdent) const;
|
|
|
|
|
|
|
|
unsigned int numApproaches() const;
|
|
|
|
flightgear::Approach* getApproachByIndex(unsigned int aIndex) const;
|
2012-04-24 21:55:30 +00:00
|
|
|
flightgear::Approach* findApproachWithIdent(const std::string& aIdent) const;
|
|
|
|
|
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
|
|
|
*/
|
|
|
|
static FGAirport* 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.
|
|
|
|
*/
|
|
|
|
static FGAirport* getByIdent(const std::string& aIdent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper to look up an FGAirport instance by unique ident. Returns NULL
|
|
|
|
* if the airport could not be found.
|
|
|
|
*/
|
|
|
|
static FGAirport* findByIdent(const std::string& aIdent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
2012-08-27 23:26:36 +00:00
|
|
|
|
2011-05-25 06:50:15 +00:00
|
|
|
flightgear::CommStationList commStationsOfType(FGPositioned::Type aTy) const;
|
|
|
|
|
2012-08-27 23:26:36 +00:00
|
|
|
flightgear::CommStationList commStations() const;
|
2005-12-29 13:58:21 +00:00
|
|
|
private:
|
2012-11-24 11:42:31 +00: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 09:43:39 +00: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-27 23:26:36 +00:00
|
|
|
|
2012-09-19 21:33:43 +00:00
|
|
|
void readILSData(SGPropertyNode* aRoot);
|
2012-08-27 23:26:36 +00:00
|
|
|
|
|
|
|
void validateTowerData() const;
|
2009-08-29 10:21:21 +00:00
|
|
|
|
|
|
|
/**
|
2013-02-20 22:35:32 +00: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);
|
|
|
|
|
|
|
|
std::string _name;
|
|
|
|
bool _has_metar;
|
|
|
|
FGAirportDynamics *_dynamics;
|
|
|
|
|
2009-08-29 18:00:14 +00:00
|
|
|
void loadRunways() const;
|
2013-02-20 22:35:32 +00:00
|
|
|
void loadHelipads() const;
|
2009-08-29 18:00:14 +00:00
|
|
|
void loadTaxiways() const;
|
2009-10-11 11:37:13 +00:00
|
|
|
void loadProcedures() const;
|
2009-08-29 18:00:14 +00:00
|
|
|
|
2012-08-27 23:26:36 +00:00
|
|
|
mutable bool mTowerDataLoaded;
|
2009-08-29 18:00:14 +00:00
|
|
|
mutable bool mRunwaysLoaded;
|
2013-02-20 22:35:32 +00:00
|
|
|
mutable bool mHelipadsLoaded;
|
2009-08-29 18:00:14 +00:00
|
|
|
mutable bool mTaxiwaysLoaded;
|
2009-10-11 11:37:13 +00:00
|
|
|
mutable bool mProceduresLoaded;
|
2012-09-19 21:33:43 +00:00
|
|
|
bool mILSDataLoaded;
|
2012-08-27 23:26:36 +00:00
|
|
|
|
|
|
|
mutable PositionedIDVec mRunways;
|
2013-02-20 22:35:32 +00:00
|
|
|
mutable PositionedIDVec mHelipads;
|
2012-08-27 23:26:36 +00:00
|
|
|
mutable PositionedIDVec mTaxiways;
|
|
|
|
PositionedIDVec mPavements;
|
2009-10-11 11:37:13 +00:00
|
|
|
|
2012-11-12 21:30:28 +00: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;
|
2012-08-27 23:26:36 +00: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
|
|
|
|
|
|
|
|