// TODO:
// - better spin-up
+#include <simgear/compiler.h>
+
+#include STL_IOSTREAM
+#include STL_STRING
+#include <sstream>
+
#include <math.h> // fabs()
#include "attitude_indicator.hxx"
} else if ( cname == "vacuum-system" ) {
vacuum_system = cval;
} else {
- SG_LOG( SG_AUTOPILOT, SG_WARN, "Error in attitude-indicator config logic" );
+ SG_LOG( SG_INSTR, SG_WARN, "Error in attitude-indicator config logic" );
if ( name.length() ) {
- SG_LOG( SG_AUTOPILOT, SG_WARN, "Section = " << name );
+ SG_LOG( SG_INSTR, SG_WARN, "Section = " << name );
}
}
}
_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