]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/navcom.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / Cockpit / navcom.hxx
index d05881abe89c0cfc6c7517216ad7c748a6613a06..960d8cdbc9c09da1432a96cbd6dbc06fdddefbff 100644 (file)
 
 #include <Navaids/ilslist.hxx>
 #include <Navaids/navlist.hxx>
-#include <Sound/beacon.hxx>
 #include <Sound/morse.hxx>
 
 class FGNavCom : public FGSubsystem
 {
-    FGBeacon beacon;
     FGMorse morse;
 
     SGInterpTable *term_tbl;
@@ -50,6 +48,9 @@ class FGNavCom : public FGSubsystem
     SGPropertyNode *lon_node;
     SGPropertyNode *lat_node;
     SGPropertyNode *alt_node;
+    SGPropertyNode *bus_power;
+    SGPropertyNode *com_servicable, *nav_servicable;
+    SGPropertyNode *cdi_servicable, *gs_servicable, *tofrom_servicable;
 
     string last_nav_id;
     bool last_nav_vor;
@@ -63,6 +64,7 @@ class FGNavCom : public FGSubsystem
     bool need_update;
 
     bool power_btn;
+    bool audio_btn;
 
     bool comm_valid;
     bool comm_inrange;
@@ -100,7 +102,9 @@ class FGNavCom : public FGSubsystem
     double nav_gs_x;
     double nav_gs_y;
     double nav_gs_z;
+    sgdVec3 gs_base_vec;
     double nav_gs_dist;
+    double nav_gs_dist_signed;
     SGTimeStamp prev_time;
     SGTimeStamp curr_time;
     double nav_elev;
@@ -140,10 +144,8 @@ public:
     }
 
     // NavCom Setters
-    inline void set_power_btn( bool val ) {
-        power_btn = val;
-
-    }
+    inline void set_power_btn( bool val ) { power_btn = val; }
+    inline void set_audio_btn( bool val ) { audio_btn = val; }
  
     // COMM Setters
     inline void set_comm_freq( double freq ) {
@@ -173,7 +175,11 @@ public:
     inline void set_nav_ident_btn( bool val ) { nav_ident_btn = val; }
 
     // NavCom Accessors
+    inline bool has_power() const {
+        return power_btn && (bus_power->getDoubleValue() > 1.0);
+    }
     inline bool get_power_btn() const { return power_btn; }
+    inline bool get_audio_btn() const { return audio_btn; }
 
     // COMM Accessors
     inline double get_comm_freq () const { return comm_freq; }
@@ -204,6 +210,7 @@ public:
     inline double get_nav_gslon() const { return nav_gslon; }
     inline double get_nav_gslat() const { return nav_gslat; }
     inline double get_nav_gs_dist() const { return nav_gs_dist; }
+    inline double get_nav_gs_dist_signed() const { return nav_gs_dist_signed; }
     inline double get_nav_elev() const { return nav_elev; }
     inline double get_nav_heading() const { return nav_heading; }
     inline double get_nav_radial() const { return nav_radial; }