X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fattitude_indicator.cxx;h=1555c2c74eeddc49dda9b2656043e8c89544b711;hb=f620af29cdc18ab7924055092e8f75cbe37aae2c;hp=82cb4c6a0f24bc871d2b412184d363eadcbc80bc;hpb=f614545fc5a6f0fb12a05344d9ee41b2a49cc04a;p=flightgear.git diff --git a/src/Instrumentation/attitude_indicator.cxx b/src/Instrumentation/attitude_indicator.cxx index 82cb4c6a0..1555c2c74 100644 --- a/src/Instrumentation/attitude_indicator.cxx +++ b/src/Instrumentation/attitude_indicator.cxx @@ -6,6 +6,12 @@ // TODO: // - better spin-up +#include + +#include STL_IOSTREAM +#include STL_STRING +#include + #include // fabs() #include "attitude_indicator.hxx" @@ -31,9 +37,9 @@ AttitudeIndicator::AttitudeIndicator ( SGPropertyNode *node ) } 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 ); } } } @@ -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