]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/kr_87.hxx
Removed FGEnvironmentMgr as a special case in globals, initialization,
[flightgear.git] / src / Cockpit / kr_87.hxx
index 21230d5113e2eac60f48e80dae9c9bc8549f7702..de90c5447d0eac2ce7b7df50711583aaca9af471 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <simgear/compiler.h>
 
-#include <simgear/math/interpolater.hxx>
 #include <simgear/timing/timestamp.hxx>
 
 #include <Navaids/navlist.hxx>
@@ -41,13 +40,11 @@ class FGKR_87 : public FGSubsystem
 {
     FGMorse morse;
 
-    SGInterpTable *term_tbl;
-    SGInterpTable *low_tbl;
-    SGInterpTable *high_tbl;
-
     SGPropertyNode *lon_node;
     SGPropertyNode *lat_node;
     SGPropertyNode *alt_node;
+    SGPropertyNode *bus_power;
+    SGPropertyNode *servicable;
 
     bool need_update;
 
@@ -79,7 +76,9 @@ class FGKR_87 : public FGSubsystem
 
     // input and buttons
     double rotation;            // compass faceplace rotation
-    double on_off_vol_btn;
+    bool power_btn;             // 0 = off, 1 = powered
+    bool audio_btn;             // 0 = off, 1 = on
+    double vol_btn;
     bool adf_btn;               // 0 = normal, 1 = depressed
     bool bfo_btn;               // 0 = normal, 1 = depressed
     bool frq_btn;               // 0 = normal, 1 = depressed
@@ -88,7 +87,6 @@ class FGKR_87 : public FGSubsystem
     bool last_flt_et_btn;
     bool set_rst_btn;           // 0 = normal, 1 = depressed
     bool last_set_rst_btn;      // 0 = normal, 1 = depressed
-    bool ident_btn;             // turn audio morse code on/off
 
     // outputs
     double freq;
@@ -127,6 +125,9 @@ public:
     inline double get_stn_lat() const { return stn_lat; }
     inline double get_dist() const { return dist; }
     inline double get_heading() const { return heading; }
+    inline bool has_power() const {
+        return power_btn && (bus_power->getDoubleValue() > 1.0);
+    }
 
     // modes
     inline int get_ant_mode() const { return ant_mode; }
@@ -137,11 +138,19 @@ public:
     // input and buttons
     inline double get_rotation () const { return rotation; }
     inline void set_rotation( double rot ) { rotation = rot; }
-    inline double get_on_off_vol_btn() const { return on_off_vol_btn; }
-    inline void set_on_off_vol_btn( double val ) {
+    inline bool get_power_btn() const { return power_btn; }
+    inline void set_power_btn( bool val ) {
+       power_btn = val;
+    }
+    inline bool get_audio_btn() const { return audio_btn; }
+    inline void set_audio_btn( bool val ) {
+       audio_btn = val;
+    }
+    inline double get_vol_btn() const { return vol_btn; }
+    inline void set_vol_btn( double val ) {
        if ( val < 0.0 ) val = 0.0;
        if ( val > 1.0 ) val = 1.0;
-       on_off_vol_btn = val;
+       vol_btn = val;
     }
     inline bool get_adf_btn() const { return adf_btn; }
     inline void set_adf_btn( bool val ) { adf_btn = val; }
@@ -153,8 +162,6 @@ public:
     inline void set_flt_et_btn( bool val ) { flt_et_btn = val; }
     inline bool get_set_rst_btn() const { return set_rst_btn; }
     inline void set_set_rst_btn( bool val ) { set_rst_btn = val; }
-    inline bool get_ident_btn() const { return ident_btn; }
-    inline void set_ident_btn( bool val ) { ident_btn = val; }
 
     // outputs
     inline double get_freq () const { return freq; }