]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/navradio.cxx
Add back power button binding, but move the location to /instrumentation/nav
[flightgear.git] / src / Instrumentation / navradio.cxx
index 6d00f42b2e08961e816dc712d09c3f3d2b5a1e5a..6a6be3707fadd46bfb0681782ff9ccfd7621fe29 100644 (file)
@@ -128,9 +128,15 @@ FGNavRadio::init ()
     cdi_serviceable = (node->getChild("cdi", 0, true))
        ->getChild("serviceable", 0, true);
     gs_serviceable = (node->getChild("gs", 0, true))
-       ->getNode("serviceable");
+       ->getChild("serviceable");
     tofrom_serviceable = (node->getChild("to-from", 0, true))
        ->getChild("serviceable", 0, true);
+
+    std::ostringstream temp;
+    temp << name << "nav-ident" << num;
+    nav_fx_name = temp.str();
+    temp << name << "dme-ident" << num;
+    dme_fx_name = temp.str();
 }
 
 void
@@ -142,6 +148,10 @@ FGNavRadio::bind ()
     branch = "/instrumentation/" + name + "[" + temp.str() + "]";
 
                                // User inputs
+    fgTie( (branch + "power-btn").c_str(), this,
+           &FGNavRadio::get_power_btn, &FGNavRadio::set_power_btn );
+    fgSetArchivable( (branch + "power-btn").c_str() );
+
     fgTie( (branch + "/frequencies/selected-mhz").c_str() , this,
          &FGNavRadio::get_nav_freq, &FGNavRadio::set_nav_freq );
     fgSetArchivable( (branch + "/frequencies/selected-mhz").c_str() );
@@ -176,6 +186,12 @@ FGNavRadio::bind ()
     fgTie( (branch + "/radials/target-radial-deg").c_str(),
           this, &FGNavRadio::get_nav_target_radial_true );
 
+    fgTie( (branch + "/radials/reciprocal-radial-deg").c_str(),
+          this, &FGNavRadio::get_nav_reciprocal_radial );
+
+    fgTie( (branch + "/radials/target-radial2-deg").c_str(),
+          this, &FGNavRadio::get_nav_target_radial );
+
     fgTie( (branch + "/radials/target-auto-hdg-deg").c_str(),
           this, &FGNavRadio::get_nav_target_auto_hdg );
 
@@ -206,6 +222,12 @@ FGNavRadio::bind ()
     fgTie( (branch + "/gs-needle-deflection").c_str(),
           this, &FGNavRadio::get_nav_gs_deflection );
 
+    fgTie( (branch + "/gs-distance").c_str(),
+          this, &FGNavRadio::get_nav_gs_dist_signed );
+
+    fgTie( (branch + "/nav-distance").c_str(),
+          this, &FGNavRadio::get_nav_loc_dist );
+
     fgTie( (branch + "/nav-id").c_str(),
           this, &FGNavRadio::get_nav_id );
 
@@ -334,6 +356,12 @@ FGNavRadio::update(double dt)
     // Nav.
     ////////////////////////////////////////////////////////////////////////
 
+    // cout << "nav_valid = " << nav_valid
+    //      << " power_btn = " << power_btn
+    //      << " bus_power = " << bus_power->getDoubleValue()
+    //      << " nav_serviceable = " << nav_serviceable->getBoolValue()
+    //      << endl;
+
     if ( nav_valid && power_btn && (bus_power->getDoubleValue() > 1.0)
          && nav_serviceable->getBoolValue() )
     {