2000-08-16 01:28:33 +00:00
|
|
|
// runways.hxx -- a simple class to manage airport runway info
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started August 2000.
|
|
|
|
//
|
2004-11-19 22:10:41 +00:00
|
|
|
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
2000-08-16 01:28:33 +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.
|
2000-08-16 01:28:33 +00:00
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
|
2003-08-29 04:11:23 +00:00
|
|
|
#ifndef _FG_RUNWAYS_HXX
|
|
|
|
#define _FG_RUNWAYS_HXX
|
2000-08-16 01:28:33 +00:00
|
|
|
|
|
|
|
#include <simgear/compiler.h>
|
|
|
|
|
2013-03-04 15:31:37 +00:00
|
|
|
#include <Navaids/procedure.hxx>
|
|
|
|
#include "runwaybase.hxx"
|
|
|
|
#include "airports_fwd.hxx"
|
2009-10-11 11:37:13 +00:00
|
|
|
|
2008-12-29 22:23:22 +00:00
|
|
|
class FGRunway : public FGRunwayBase
|
|
|
|
{
|
2012-08-27 23:26:36 +00:00
|
|
|
PositionedID _airport;
|
|
|
|
PositionedID _reciprocal;
|
2008-12-24 15:45:35 +00:00
|
|
|
double _displ_thresh;
|
|
|
|
double _stopway;
|
2012-08-27 23:26:36 +00:00
|
|
|
PositionedID _ils;
|
2008-08-14 18:13:39 +00:00
|
|
|
public:
|
|
|
|
|
2012-08-27 23:26:36 +00:00
|
|
|
FGRunway(PositionedID aGuid,
|
|
|
|
PositionedID aAirport, const std::string& rwy_no,
|
2008-12-24 14:48:30 +00:00
|
|
|
const SGGeod& aGeod,
|
2008-08-14 18:13:39 +00:00
|
|
|
const double heading, const double length,
|
|
|
|
const double width,
|
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
|
|
|
const double displ_thresh,
|
|
|
|
const double stopway,
|
2013-02-28 18:21:23 +00:00
|
|
|
const int surface_code);
|
2008-08-14 18:13:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* given a runway identifier (06, 18L, 31R) compute the identifier for the
|
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
|
|
|
* reciprocal heading runway (24, 36R, 13L) string.
|
2008-08-14 18:13:39 +00:00
|
|
|
*/
|
|
|
|
static std::string reverseIdent(const std::string& aRunayIdent);
|
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
|
|
|
|
2008-08-14 18:13:39 +00:00
|
|
|
/**
|
|
|
|
* score this runway according to the specified weights. Used by
|
|
|
|
* FGAirport::findBestRunwayForHeading
|
|
|
|
*/
|
|
|
|
double score(double aLengthWt, double aWidthWt, double aSurfaceWt) 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
|
|
|
/**
|
2012-08-17 21:51:30 +00:00
|
|
|
* Get the runway beginning point - this is syntatic sugar, equivalent to
|
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
|
|
|
* calling pointOnCenterline(0.0);
|
|
|
|
*/
|
2009-01-03 16:15:48 +00:00
|
|
|
SGGeod begin() 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
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the (possibly displaced) threshold point.
|
|
|
|
*/
|
2009-01-03 16:15:48 +00:00
|
|
|
SGGeod threshold() 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
|
|
|
|
|
|
|
/**
|
2009-01-03 16:15:48 +00:00
|
|
|
* Get the 'far' end - this is equivalent to calling
|
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
|
|
|
* pointOnCenterline(lengthFt());
|
|
|
|
*/
|
2009-01-03 16:15:48 +00:00
|
|
|
SGGeod end() 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
|
|
|
|
2008-12-24 15:45:35 +00:00
|
|
|
double displacedThresholdM() const
|
2013-02-21 21:47:01 +00:00
|
|
|
{ return _displ_thresh; }
|
2008-12-24 15:45:35 +00:00
|
|
|
|
|
|
|
double stopwayM() const
|
2013-02-21 21:47:01 +00:00
|
|
|
{ return _stopway; }
|
2008-12-24 15:45:35 +00:00
|
|
|
|
2009-06-11 21:53:30 +00:00
|
|
|
/**
|
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
|
|
|
* Airport this runway is located at
|
|
|
|
*/
|
2012-08-27 23:26:36 +00:00
|
|
|
FGAirport* airport() 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
|
|
|
|
2012-08-27 23:26:36 +00:00
|
|
|
FGNavRecord* ILS() const;
|
2009-06-11 21:53:30 +00:00
|
|
|
|
2012-10-30 15:43:54 +00:00
|
|
|
/**
|
|
|
|
* retrieve the associated glideslope transmitter, if one is defined.
|
|
|
|
*/
|
|
|
|
FGNavRecord* glideslope() const;
|
|
|
|
|
2012-08-27 23:26:36 +00:00
|
|
|
void setILS(PositionedID nav) { _ils = nav; }
|
2009-08-29 10:21:21 +00:00
|
|
|
|
2012-08-27 23:26:36 +00:00
|
|
|
FGRunway* reciprocalRunway() const;
|
|
|
|
|
|
|
|
void setReciprocalRunway(PositionedID other);
|
2009-10-11 11:37:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get SIDs (DPs) associated with this runway
|
|
|
|
*/
|
2013-03-04 15:31:37 +00:00
|
|
|
flightgear::SIDList getSIDs() const;
|
2009-10-11 11:37:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get STARs associared with this runway
|
|
|
|
*/
|
2013-03-04 15:31:37 +00:00
|
|
|
flightgear::STARList getSTARs() const;
|
2012-04-24 21:55:30 +00:00
|
|
|
|
|
|
|
|
2013-03-04 15:31:37 +00:00
|
|
|
flightgear::ApproachList getApproaches
|
|
|
|
(
|
|
|
|
flightgear::ProcedureType type = flightgear::PROCEDURE_INVALID
|
|
|
|
) const;
|
2011-05-25 06:50:15 +00:00
|
|
|
|
2000-08-16 01:28:33 +00:00
|
|
|
};
|
|
|
|
|
2013-02-20 22:35:32 +00:00
|
|
|
class FGHelipad : public FGRunwayBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FGHelipad(PositionedID aGuid,
|
|
|
|
PositionedID aAirport, const std::string& rwy_no,
|
|
|
|
const SGGeod& aGeod,
|
|
|
|
const double heading, const double length,
|
|
|
|
const double width,
|
|
|
|
const int surface_code);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-08-29 04:11:23 +00:00
|
|
|
#endif // _FG_RUNWAYS_HXX
|