1 // slip_skid_ball.cxx - an electric-powered turn indicator.
2 // Written by David Megginson, started 2003.
4 // This file is in the Public Domain and comes with no warranty.
6 #include "slip_skid_ball.hxx"
7 #include <Main/fg_props.hxx>
8 #include <Main/util.hxx>
11 SlipSkidBall::SlipSkidBall ()
15 SlipSkidBall::~SlipSkidBall ()
23 fgGetNode("/instrumentation/slip-skid-ball/serviceable", true);
24 _y_accel_node = fgGetNode("/accelerations/pilot/y-accel-fps_sec", true);
25 _z_accel_node = fgGetNode("/accelerations/pilot/z-accel-fps_sec", true);
27 fgGetNode("/instrumentation/slip-skid-ball/indicated-slip-skid", true);
31 SlipSkidBall::update (double delta_time_sec)
33 if (_serviceable_node->getBoolValue()) {
34 double d = -_z_accel_node->getDoubleValue();
37 double pos = _y_accel_node->getDoubleValue() / d * 5.0;
38 pos = fgGetLowPass(_out_node->getDoubleValue(), pos, delta_time_sec);
39 _out_node->setDoubleValue(pos);
43 // end of slip_skid_ball.cxx