X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fgps.hxx;h=f69a70a76be4b6fcc0922b92210e2fe5d13f3ef7;hb=2c1de98ef327f22781bf98e297be99f5121477a8;hp=d6c3a7069bfe96d2f3d32d1ed71cab60bec6b1d3;hpb=52ac173257bf9cc780f0faee5049314442083140;p=flightgear.git diff --git a/src/Instrumentation/gps.hxx b/src/Instrumentation/gps.hxx index d6c3a7069..f69a70a76 100644 --- a/src/Instrumentation/gps.hxx +++ b/src/Instrumentation/gps.hxx @@ -8,12 +8,14 @@ #define __INSTRUMENTS_GPS_HXX 1 #include +#include #include #include #include -#include "Navaids/positioned.hxx" +#include +#include // forward decls class SGRoute; @@ -73,20 +75,29 @@ private: * /instrumentation/gps/magnetic-bug-error-deg */ -class GPS : public SGSubsystem +class GPS : public SGSubsystem, public flightgear::RNAV { - public: - GPS (SGPropertyNode *node); GPS (); virtual ~GPS (); + // SGSubsystem interface virtual void init (); virtual void update (double delta_time_sec); virtual void bind(); virtual void unbind(); + + // RNAV interface + virtual SGGeod position(); + virtual double trackDeg(); + virtual double groundSpeedKts(); + virtual double vspeedFPM(); + virtual double magvarDeg(); + virtual double selectedMagCourse(); + virtual double overflightArmDistanceM(); + private: friend class GPSListener; friend class SearchFilter; @@ -188,7 +199,6 @@ private: void clearOutput(); void updateBasicData(double dt); - void updateWaypoints(); void updateTrackingBug(); void updateReferenceNavaid(double dt); @@ -275,7 +285,6 @@ private: double getLegDistance() const; double getLegCourse() const; double getLegMagCourse() const; - double getAltDistanceRatio() const; double getTrueTrack() const { return _last_true_track; } double getMagTrack() const; @@ -325,6 +334,7 @@ private: // members SGPropertyNode_ptr _gpsNode; + SGPropertyNode_ptr _currentWayptNode; SGPropertyNode_ptr _magvar_node; SGPropertyNode_ptr _serviceable_node; SGPropertyNode_ptr _electrical_node; @@ -379,10 +389,8 @@ private: SGGeodProperty _position; SGGeod _wp0_position; - SGGeod _wp1_position; SGGeod _indicated_pos; - std::string _wp0Ident, _wp0Name, _wp1Ident, _wp1Name; - double _wp1DistanceM, _wp1TrueBearing; + double _legDistanceNm; // scratch data SGGeod _scratchPos; @@ -410,7 +418,11 @@ private: SGGeod _turnPt; SGGeod _turnCentre; + std::auto_ptr _wayptController; + SGPropertyNode_ptr _realismSimpleGps; ///< should the GPS be simple or realistic? + flightgear::WayptRef _prevWaypt; + flightgear::WayptRef _currentWaypt; // autopilot drive properties SGPropertyNode_ptr _apDrivingFlag;