1
0
Fork 0

Make FGRunway track reciprocal runways.

This commit is contained in:
jmt 2009-09-16 00:17:12 +00:00 committed by Tim Moore
parent d11ad100cc
commit d4d1d827d0
3 changed files with 27 additions and 3 deletions

View file

@ -286,6 +286,9 @@ private:
displ_thresh2, stopway2, surface_code, true); displ_thresh2, stopway2, surface_code, true);
runways.push_back(reciprocal); runways.push_back(reciprocal);
rwy->setReciprocalRunway(reciprocal);
reciprocal->setReciprocalRunway(rwy);
} }
} }
@ -335,6 +338,9 @@ private:
pos, heading_2, length, width, pos, heading_2, length, width,
displ_thresh2, stopway2, surface_code, true); displ_thresh2, stopway2, surface_code, true);
runways.push_back(reciprocal); runways.push_back(reciprocal);
rwy->setReciprocalRunway(reciprocal);
reciprocal->setReciprocalRunway(rwy);
} }
void parseWaterRunwayLine850(const vector<string>& token) void parseWaterRunwayLine850(const vector<string>& token)
@ -373,6 +379,9 @@ private:
pos, heading_2, length, width, pos, heading_2, length, width,
0.0, 0.0, 13, true); 0.0, 0.0, 13, true);
runways.push_back(reciprocal); runways.push_back(reciprocal);
rwy->setReciprocalRunway(reciprocal);
reciprocal->setReciprocalRunway(rwy);
} }
void parseHelipadLine850(const vector<string>& token) void parseHelipadLine850(const vector<string>& token)

View file

@ -71,7 +71,8 @@ FGRunway::FGRunway(FGAirport* aAirport, const string& aIdent,
bool reciprocal) : bool reciprocal) :
FGRunwayBase(RUNWAY, cleanRunwayNo(aIdent), aGeod, heading, length, width, surface_code, true), FGRunwayBase(RUNWAY, cleanRunwayNo(aIdent), aGeod, heading, length, width, surface_code, true),
_airport(aAirport), _airport(aAirport),
_reciprocal(reciprocal), _isReciprocal(reciprocal),
_reciprocal(NULL),
_displ_thresh(displ_thresh), _displ_thresh(displ_thresh),
_stopway(stopway), _stopway(stopway),
_ils(NULL) _ils(NULL)
@ -158,3 +159,12 @@ void FGRunway::processThreshold(SGPropertyNode* aThreshold)
SGGeodesy::direct(newThreshold, _heading, offsetFt * SG_FEET_TO_METER, newCenter, dummy); SGGeodesy::direct(newThreshold, _heading, offsetFt * SG_FEET_TO_METER, newCenter, dummy);
mPosition = newCenter; mPosition = newCenter;
} }
void FGRunway::setReciprocalRunway(FGRunway* other)
{
assert(_reciprocal==NULL);
assert((other->_reciprocal == NULL) || (other->_reciprocal == this));
_reciprocal = other;
}

View file

@ -36,7 +36,8 @@ class SGPropertyNode;
class FGRunway : public FGRunwayBase class FGRunway : public FGRunwayBase
{ {
FGAirport* _airport; FGAirport* _airport;
bool _reciprocal; bool _isReciprocal;
FGRunway* _reciprocal;
double _displ_thresh; double _displ_thresh;
double _stopway; double _stopway;
FGNavRecord* _ils; FGNavRecord* _ils;
@ -68,7 +69,7 @@ public:
* over runways to avoid counting runways twice, if desired. * over runways to avoid counting runways twice, if desired.
*/ */
bool isReciprocal() const bool isReciprocal() const
{ return _reciprocal; } { return _isReciprocal; }
/** /**
* Get the runway begining point - this is syntatic sugar, equivalent to * Get the runway begining point - this is syntatic sugar, equivalent to
@ -106,6 +107,10 @@ public:
FGNavRecord* ILS() const { return _ils; } FGNavRecord* ILS() const { return _ils; }
void setILS(FGNavRecord* nav) { _ils = nav; } 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 * Helper to process property data loaded from an ICAO.threshold.xml file
*/ */