]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/navcom.hxx
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / Cockpit / navcom.hxx
index 94698eb2151ddfc9064d8a0388ff5932f49521f8..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,8 +48,11 @@ 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_ident;
+    string last_nav_id;
     bool last_nav_vor;
     int nav_play_count;
     time_t nav_last_time;
@@ -62,7 +63,9 @@ class FGNavCom : public FGSubsystem
 
     bool need_update;
 
-    string comm_ident;
+    bool power_btn;
+    bool audio_btn;
+
     bool comm_valid;
     bool comm_inrange;
     double comm_freq;
@@ -77,7 +80,7 @@ class FGNavCom : public FGSubsystem
     double comm_range;
     double comm_effective_range;
 
-    string nav_ident;
+    string nav_id;
     string nav_trans_ident;
     bool nav_valid;
     bool nav_inrange;
@@ -99,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;
@@ -138,6 +143,10 @@ public:
         sprintf( dme_fx_name, "dme%d-vor-ident", index );
     }
 
+    // NavCom Setters
+    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 ) {
        comm_freq = freq; need_update = true;
@@ -165,6 +174,13 @@ 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; }
     inline double get_comm_alt_freq () const { return comm_alt_freq; }
@@ -194,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; }