]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/attitude_indicator.cxx
- fix unzoomed tapes (TODO: restore tick length)
[flightgear.git] / src / Instrumentation / attitude_indicator.cxx
index d958de25df39d361ed4047a391d357221f9a75d2..1555c2c74eeddc49dda9b2656043e8c89544b711 100644 (file)
@@ -6,6 +6,12 @@
 // TODO:
 // - better spin-up
 
+#include <simgear/compiler.h>
+
+#include STL_IOSTREAM
+#include STL_STRING
+#include <sstream>
+
 #include <math.h>      // fabs()
 
 #include "attitude_indicator.hxx"
@@ -67,32 +73,32 @@ AttitudeIndicator::init ()
     _roll_int_node = node->getChild("internal-roll-deg", 0, true);
     _pitch_out_node = node->getChild("indicated-pitch-deg", 0, true);
     _roll_out_node = node->getChild("indicated-roll-deg", 0, true);
-
-    //_serviceable_node->setBoolValue(true);
 }
 
 void
 AttitudeIndicator::bind ()
 {
+    std::ostringstream temp;
     string branch;
-    branch = "/instrumentation/" + name + "/serviceable";
+    temp << num;
+    branch = "/instrumentation/" + name + "[" + temp.str() + "]";
 
-    fgTie(branch.c_str(),
+    fgTie((branch + "/serviceable").c_str(),
           &_gyro, &Gyro::is_serviceable, &Gyro::set_serviceable);
-    branch = "/instrumentation/" + name + "/spin";
-    fgTie(branch.c_str(),
+    fgTie((branch + "/spin").c_str(),
           &_gyro, &Gyro::get_spin_norm, &Gyro::set_spin_norm);
 }
 
 void
 AttitudeIndicator::unbind ()
 {
+    std::ostringstream temp;
     string branch;
-    branch = "/instrumentation/" + name + "/serviceable";
+    temp << num;
+    branch = "/instrumentation/" + name + "[" + temp.str() + "]";
 
-    fgUntie(branch.c_str());
-    branch = "/instrumentation/" + name + "/spin";
-    fgUntie(branch.c_str());
+    fgUntie((branch + "/serviceable").c_str());
+    fgUntie((branch + "/spin").c_str());
 }
 
 void