]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/navradio.hxx
Fix MSVC compilation
[flightgear.git] / src / Instrumentation / navradio.hxx
index 92f80bc37bdb727a6e16f9401ff1186f0c86e392..5b64f374ab23233ccc420e7305e709201a72dbc5 100644 (file)
 
 
 #include <Main/fg_props.hxx>
+#include "Sound/morse.hxx"
 
 #include <simgear/compiler.h>
 #include <simgear/structure/subsystem_mgr.hxx>
-#include <simgear/math/interpolater.hxx>
 #include <simgear/timing/timestamp.hxx>
 
-#include <Navaids/navlist.hxx>
-#include <Sound/morse.hxx>
+// forward decls
+class SGInterpTable;
+
+class FGNavRecord;
+typedef SGSharedPtr<FGNavRecord> FGNavRecordPtr;
 
 class FGNavRadio : public SGSubsystem
 {
@@ -93,6 +96,7 @@ class FGNavRadio : public SGSubsystem
     SGPropertyNode_ptr loc_node;
     SGPropertyNode_ptr loc_dist_node;
     SGPropertyNode_ptr gs_deflection_node;
+    SGPropertyNode_ptr gs_deflection_norm_node;
     SGPropertyNode_ptr gs_rate_of_climb_node;
     SGPropertyNode_ptr gs_dist_node;
     SGPropertyNode_ptr nav_id_node;
@@ -110,32 +114,19 @@ class FGNavRadio : public SGSubsystem
 
     // internal (private) values
 
-    string last_nav_id;
-    bool last_nav_vor;
     int play_count;
     time_t last_time;
-
-    int index;                  // used for property binding
+    FGNavRecordPtr _navaid;
+    FGNavRecordPtr _gs;
+    
     string nav_fx_name;
     string dme_fx_name;
 
-    string trans_ident;
-    bool is_valid;
     bool has_dme;
-    double radial;
     double target_radial;
-    double loc_lon;
-    double loc_lat;
-    SGVec3d nav_xyz;
-    double gs_lon;
-    double gs_lat;
-    double nav_elev;            // use gs elev if available
-    SGVec3d gs_xyz;
     SGVec3d gs_base_vec;
-    double gs_dist_signed;
     SGTimeStamp prev_time;
     SGTimeStamp curr_time;
-    double range;
     double effective_range;
     double target_gs;
     double twist;
@@ -150,6 +141,15 @@ class FGNavRadio : public SGSubsystem
     // internal periodic station search timer
     double _time_before_search_sec;
 
+    // CDI properties
+    bool _toFlag, _fromFlag;
+    double _cdiDeflection;
+    double _cdiCrossTrackErrorM;
+    double _gsNeedleDeflection;
+    double _gsNeedleDeflectionNorm;
+    
+    bool updateWithPower(double aDt);
+
     // model standard VOR/DME/TACAN service volumes as per AIM 1-1-8
     double adjustNavRange( double stationElev, double aircraftElev,
                           double nominalRange );
@@ -158,6 +158,17 @@ class FGNavRadio : public SGSubsystem
     double adjustILSRange( double stationElev, double aircraftElev,
                           double offsetDegrees, double distance );
 
+    void updateAudio();
+    void audioNavidChanged();
+
+    void updateReceiver(double dt);
+    void updateGlideSlope(double dt, const SGVec3d& aircraft, double signal_quality_norm);
+    void updateGPSSlaved();
+    void updateCDI(double dt);
+    
+    void clearOutputs();
+
+    FGNavRecord* findPrimaryNavaid(const SGGeod& aPos, double aFreqMHz);
 public:
 
     FGNavRadio(SGPropertyNode *node);