10#include <simgear/compiler.h>
12#include <simgear/props/props.hxx>
28 const double heading,
const double length,
30 const double displ_thresh,
33 heading, length, width, surface_code, aAirport),
35 _displ_thresh(displ_thresh),
44 if (aRunwayIdent.size() && (aRunwayIdent[0] ==
'H' || aRunwayIdent[0] ==
'h' || aRunwayIdent[0] ==
'x')) {
48 std::string
ident(aRunwayIdent);
50 int rn = std::stoi(
ident.substr(0, 2));
57 snprintf(buf,
sizeof(buf) - 1,
"%02i", rn);
59 if (
ident.size() == 3) {
60 char suffix = toupper(
ident[2]);
63 }
else if (suffix ==
'R') {
76double FGRunway::score(
double aLengthWt,
double aWidthWt,
double aSurfaceWt,
double aIlsWt)
const
84 int ils = (_ils != 0);
111 assert(_reciprocal == 0);
144 for (
unsigned int i = 0;
i < apt->
numSIDs(); ++
i) {
158 for (
unsigned int i = 0;
i < apt->
numSTARs(); ++
i) {
184 double newDisplacedThreshold,
189 _stopway = newStopway;
190 _displ_thresh = newDisplacedThreshold;
196 const double heading,
const double length,
199 heading, length, width, surface_code, aAirport)
flightgear::STAR * getSTARByIndex(unsigned int aIndex) const
unsigned int numApproaches() const
unsigned int numSIDs() const
flightgear::Approach * getApproachByIndex(unsigned int aIndex) const
unsigned int numSTARs() const
flightgear::SID * getSIDByIndex(unsigned int aIndex) const
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)
PositionedID guid() const
void modifyPosition(const SGGeod &newPos)
static SGSharedPtr< T > loadById(PositionedID id)
const std::string & ident() const
SGGeod pointOnCenterline(double aOffset) const
Retrieve a position on the extended centerline.
int surface() const
Retrieve runway surface code, as define in Robin Peel's data.
FGRunwayBase(PositionedID aGuid, Type aTy, const std::string &aIdent, const SGGeod &aGeod, const double heading, const double length, const double width, const int surface_code, const PositionedID airportId)
int _surface_code
surface, as defined by: http://www.x-plane.org/home/robinp/Apt810.htm#RwySfcCodes
FGAirportRef airport() const
FGNavRecord * glideslope() const
retrieve the associated glideslope transmitter, if one is defined.
static std::string reverseIdent(const std::string &aRunayIdent)
given a runway identifier (06, 18L, 31R) compute the identifier for the reciprocal heading runway (24...
SGGeod pointOnCenterlineDisplaced(double aOffset) const
Retrieve a position on the extended centerline.
flightgear::STARList getSTARs() const
Get STARs associared with this runway.
SGGeod end() const
Get the 'far' end - this is equivalent to calling pointOnCenterline(lengthFt());.
SGGeod threshold() const
Get the (possibly displaced) threshold point.
void setReciprocalRunway(PositionedID other)
FGNavRecord * ILS() const
double score(double aLengthWt, double aWidthWt, double aSurfaceWt, double aIlsWt) const
score this runway according to the specified weights.
void updateThreshold(const SGGeod &newThreshold, double newHeading, double newDisplacedThreshold, double newStopway)
FGRunway * reciprocalRunway() const
flightgear::SIDList getSIDs() const
Get SIDs (DPs) associated with this runway.
SGGeod begin() const
Get the runway beginning point - this is syntatic sugar, equivalent to calling pointOnCenterline(0....
flightgear::ApproachList getApproaches(flightgear::ProcedureType type=flightgear::PROCEDURE_INVALID) const
FGRunway(PositionedID aGuid, PositionedID aAirport, const std::string &rwy_no, const SGGeod &aGeod, const double heading, const double length, const double width, const double displ_thresh, const double stopway, const int surface_code)
Describe an approach procedure, including the missed approach segment.
virtual ProcedureType type() const
virtual bool isForRunway(const FGRunway *aWay) const
Predicate, test if this procedure applies to the requested runway.
PositionedID findNavaidForRunway(PositionedID runway, FGPositioned::Type ty)
Given a runway and type, find the corresponding navaid (ILS / GS / OM)
static NavDataCache * instance()
std::vector< Approach * > ApproachList
std::vector< STAR * > STARList
std::vector< flightgear::SID * > SIDList