X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fslip_skid_ball.cxx;h=b5a439158a7fb0c58fc75e27600093fc5ba8dbeb;hb=0b9adf8854398461333eba43df18fa2f5c8231a1;hp=ba470bd1c3d8a7eab8806c5ad8a345ffbb19a9fd;hpb=0ab2a40c2a2c75d117744f63a1bd74ccc7ea3a4e;p=flightgear.git diff --git a/src/Instrumentation/slip_skid_ball.cxx b/src/Instrumentation/slip_skid_ball.cxx index ba470bd1c..b5a439158 100644 --- a/src/Instrumentation/slip_skid_ball.cxx +++ b/src/Instrumentation/slip_skid_ball.cxx @@ -3,35 +3,20 @@ // // This file is in the Public Domain and comes with no warranty. +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "slip_skid_ball.hxx" #include
#include
+using std::string; SlipSkidBall::SlipSkidBall ( SGPropertyNode *node) : - name("slip-skid-ball"), - num(0) -{ - int i; - for ( i = 0; i < node->nChildren(); ++i ) { - SGPropertyNode *child = node->getChild(i); - string cname = child->getName(); - string cval = child->getStringValue(); - if ( cname == "name" ) { - name = cval; - } else if ( cname == "number" ) { - num = child->getIntValue(); - } else { - SG_LOG( SG_INSTR, SG_WARN, "Error in slip-skid-ball config logic" ); - if ( name.length() ) { - SG_LOG( SG_INSTR, SG_WARN, "Section = " << name ); - } - } - } -} - -SlipSkidBall::SlipSkidBall () + _name(node->getStringValue("name", "slip-skid-ball")), + _num(node->getIntValue("number", 0)) { } @@ -43,16 +28,14 @@ void SlipSkidBall::init () { string branch; - branch = "/instrumentation/" + name; + branch = "/instrumentation/" + _name; - SGPropertyNode *node = fgGetNode(branch.c_str(), num, true ); + SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); _serviceable_node = node->getChild("serviceable", 0, true); _y_accel_node = fgGetNode("/accelerations/pilot/y-accel-fps_sec", true); _z_accel_node = fgGetNode("/accelerations/pilot/z-accel-fps_sec", true); _out_node = node->getChild("indicated-slip-skid", 0, true); - _override_node = node->getChild("iverride", 0, true); - - _serviceable_node->setBoolValue(true); + _override_node = node->getChild("override", 0, true); } void