]> git.mxchange.org Git - flightgear.git/commitdiff
Add back power button binding, but move the location to /instrumentation/nav
authorcurt <curt>
Thu, 30 Dec 2004 14:57:12 +0000 (14:57 +0000)
committercurt <curt>
Thu, 30 Dec 2004 14:57:12 +0000 (14:57 +0000)
rather than /instrumentation/comm ... we need to be a little careful here
because typically, a single knob controls power to both matched com/nav pairs.

src/Instrumentation/navradio.cxx

index 414595cd8d9eda38a5658c8bab64ec089194694c..6a6be3707fadd46bfb0681782ff9ccfd7621fe29 100644 (file)
@@ -148,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() );
@@ -352,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() )
     {