From c3c0f68f76c031adcf610fdd3dbeee59bc33d553 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 21 Nov 2013 17:39:05 +0000 Subject: [PATCH] NavData: can refresh some in-place. (Hacking to support faster scenery-path switching) --- src/Airports/runways.cxx | 10 ++++++++++ src/Airports/runways.hxx | 4 ++++ src/Navaids/navrecord.cxx | 6 ++++++ src/Navaids/navrecord.hxx | 3 ++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index 84205a276..4dc866076 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -204,6 +204,16 @@ FGRunway::getApproaches(flightgear::ProcedureType type) const return result; } +void FGRunway::updateThreshold(const SGGeod& newThreshold, double newHeading, + double newDisplacedThreshold, + double newStopway) +{ + modifyPosition(newThreshold); + _heading = newHeading; + _stopway = newStopway; + _displ_thresh = newDisplacedThreshold; +} + FGHelipad::FGHelipad(PositionedID aGuid, PositionedID aAirport, const string& aIdent, const SGGeod& aGeod, diff --git a/src/Airports/runways.hxx b/src/Airports/runways.hxx index 03434ab8e..ae4404753 100644 --- a/src/Airports/runways.hxx +++ b/src/Airports/runways.hxx @@ -117,6 +117,10 @@ public: flightgear::ProcedureType type = flightgear::PROCEDURE_INVALID ) const; + void updateThreshold(const SGGeod& newThreshold, + double newHeading, + double newDisplacedThreshold, + double newStopway); }; class FGHelipad : public FGRunwayBase diff --git a/src/Navaids/navrecord.cxx b/src/Navaids/navrecord.cxx index 8700a577f..cb83fd02d 100644 --- a/src/Navaids/navrecord.cxx +++ b/src/Navaids/navrecord.cxx @@ -103,6 +103,12 @@ void FGNavRecord::setColocatedDME(PositionedID other) mColocated = other; } +void FGNavRecord::updateFromXML(const SGGeod& geod, double heading) +{ + modifyPosition(geod); + multiuse = heading; +} + FGTACANRecord::FGTACANRecord(void) : channel(""), freq(0) diff --git a/src/Navaids/navrecord.hxx b/src/Navaids/navrecord.hxx index e4f28c5f8..a96e171d8 100644 --- a/src/Navaids/navrecord.hxx +++ b/src/Navaids/navrecord.hxx @@ -49,7 +49,6 @@ class FGNavRecord : public FGPositioned PositionedID mColocated; // Colocated DME at a navaid (ILS, VOR, TACAN, NDB) bool serviceable; // for failure modeling - void processSceneryILS(SGPropertyNode* aILSNode); public: FGNavRecord(PositionedID aGuid, Type type, const std::string& ident, const std::string& name, @@ -90,6 +89,8 @@ public: void setColocatedDME(PositionedID other); bool hasDME(); + + void updateFromXML(const SGGeod& geod, double heading); }; class FGTACANRecord : public SGReferenced { -- 2.39.5