]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/navcom.hxx
Begin interfacing the navcom's to the electrical model.
[flightgear.git] / src / Cockpit / navcom.hxx
index 94698eb2151ddfc9064d8a0388ff5932f49521f8..6eb52d1f04fc2a67d58e6079cc5125b30ff88f65 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,9 @@ class FGNavCom : public FGSubsystem
     SGPropertyNode *lon_node;
     SGPropertyNode *lat_node;
     SGPropertyNode *alt_node;
+    SGPropertyNode *bus_power;
 
-    string last_nav_ident;
+    string last_nav_id;
     bool last_nav_vor;
     int nav_play_count;
     time_t nav_last_time;
@@ -62,7 +61,8 @@ class FGNavCom : public FGSubsystem
 
     bool need_update;
 
-    string comm_ident;
+    bool power_btn;
+
     bool comm_valid;
     bool comm_inrange;
     double comm_freq;
@@ -77,7 +77,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;
@@ -138,6 +138,12 @@ public:
         sprintf( dme_fx_name, "dme%d-vor-ident", index );
     }
 
+    // NavCom Setters
+    inline void set_power_btn( bool val ) {
+        power_btn = val;
+
+    }
     // COMM Setters
     inline void set_comm_freq( double freq ) {
        comm_freq = freq; need_update = true;
@@ -165,6 +171,12 @@ 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; }
+
     // COMM Accessors
     inline double get_comm_freq () const { return comm_freq; }
     inline double get_comm_alt_freq () const { return comm_alt_freq; }