//
// 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 <Main/fg_props.hxx>
#include <Main/util.hxx>
+using std::string;
-SlipSkidBall::SlipSkidBall ()
+SlipSkidBall::SlipSkidBall ( SGPropertyNode *node)
+ :
+ _name(node->getStringValue("name", "slip-skid-ball")),
+ _num(node->getIntValue("number", 0))
{
}
void
SlipSkidBall::init ()
{
- _serviceable_node =
- fgGetNode("/instrumentation/slip-skid-ball/serviceable", true);
+ string branch;
+ branch = "/instrumentation/" + _name;
+
+ 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 =
- fgGetNode("/instrumentation/slip-skid-ball/indicated-slip-skid", true);
- _override_node =
- fgGetNode("/instrumentation/slip-skid-ball/override", true);
+ _out_node = node->getChild("indicated-slip-skid", 0, true);
+ _override_node = node->getChild("override", 0, true);
}
void