Make FGRunway track reciprocal runways.
This commit is contained in:
parent
d11ad100cc
commit
d4d1d827d0
3 changed files with 27 additions and 3 deletions
|
@ -286,6 +286,9 @@ private:
|
|||
displ_thresh2, stopway2, surface_code, true);
|
||||
|
||||
runways.push_back(reciprocal);
|
||||
|
||||
rwy->setReciprocalRunway(reciprocal);
|
||||
reciprocal->setReciprocalRunway(rwy);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,6 +338,9 @@ private:
|
|||
pos, heading_2, length, width,
|
||||
displ_thresh2, stopway2, surface_code, true);
|
||||
runways.push_back(reciprocal);
|
||||
|
||||
rwy->setReciprocalRunway(reciprocal);
|
||||
reciprocal->setReciprocalRunway(rwy);
|
||||
}
|
||||
|
||||
void parseWaterRunwayLine850(const vector<string>& token)
|
||||
|
@ -373,6 +379,9 @@ private:
|
|||
pos, heading_2, length, width,
|
||||
0.0, 0.0, 13, true);
|
||||
runways.push_back(reciprocal);
|
||||
|
||||
rwy->setReciprocalRunway(reciprocal);
|
||||
reciprocal->setReciprocalRunway(rwy);
|
||||
}
|
||||
|
||||
void parseHelipadLine850(const vector<string>& token)
|
||||
|
|
|
@ -71,7 +71,8 @@ FGRunway::FGRunway(FGAirport* aAirport, const string& aIdent,
|
|||
bool reciprocal) :
|
||||
FGRunwayBase(RUNWAY, cleanRunwayNo(aIdent), aGeod, heading, length, width, surface_code, true),
|
||||
_airport(aAirport),
|
||||
_reciprocal(reciprocal),
|
||||
_isReciprocal(reciprocal),
|
||||
_reciprocal(NULL),
|
||||
_displ_thresh(displ_thresh),
|
||||
_stopway(stopway),
|
||||
_ils(NULL)
|
||||
|
@ -158,3 +159,12 @@ void FGRunway::processThreshold(SGPropertyNode* aThreshold)
|
|||
SGGeodesy::direct(newThreshold, _heading, offsetFt * SG_FEET_TO_METER, newCenter, dummy);
|
||||
mPosition = newCenter;
|
||||
}
|
||||
|
||||
void FGRunway::setReciprocalRunway(FGRunway* other)
|
||||
{
|
||||
assert(_reciprocal==NULL);
|
||||
assert((other->_reciprocal == NULL) || (other->_reciprocal == this));
|
||||
|
||||
_reciprocal = other;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ class SGPropertyNode;
|
|||
class FGRunway : public FGRunwayBase
|
||||
{
|
||||
FGAirport* _airport;
|
||||
bool _reciprocal;
|
||||
bool _isReciprocal;
|
||||
FGRunway* _reciprocal;
|
||||
double _displ_thresh;
|
||||
double _stopway;
|
||||
FGNavRecord* _ils;
|
||||
|
@ -68,7 +69,7 @@ public:
|
|||
* over runways to avoid counting runways twice, if desired.
|
||||
*/
|
||||
bool isReciprocal() const
|
||||
{ return _reciprocal; }
|
||||
{ return _isReciprocal; }
|
||||
|
||||
/**
|
||||
* Get the runway begining point - this is syntatic sugar, equivalent to
|
||||
|
@ -106,6 +107,10 @@ public:
|
|||
FGNavRecord* ILS() const { return _ils; }
|
||||
void setILS(FGNavRecord* nav) { _ils = nav; }
|
||||
|
||||
FGRunway* reciprocalRunway() const
|
||||
{ return _reciprocal; }
|
||||
void setReciprocalRunway(FGRunway* other);
|
||||
|
||||
/**
|
||||
* Helper to process property data loaded from an ICAO.threshold.xml file
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue