Removed some unused bind/unbind methods.
Improved responsiveness of slip-skid ball.
Some minor cleanups.
turn_indicator.cxx turn_indicator.hxx \
slip_skid_ball.cxx slip_skid_ball.hxx \
heading_indicator.cxx heading_indicator.hxx \
- vertical_speed_indicator.cxx vertical_speed_indicator.hxx
+ vertical_speed_indicator.cxx vertical_speed_indicator.hxx \
+ mag_compass.cxx mag_compass.hxx
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
true);
}
-void
-AirspeedIndicator::bind ()
-{
-}
-
-void
-AirspeedIndicator::unbind ()
-{
-}
-
-
#ifndef SEA_LEVEL_DENSITY_SLUGFG3
# define SEA_LEVEL_DENSITY_SLUGFT3 0.002378
#endif
virtual ~AirspeedIndicator ();
virtual void init ();
- virtual void bind ();
- virtual void unbind ();
virtual void update (double dt);
private:
fgGetNode("/instrumentation/altimeter/indicated-altitude-ft", true);
}
-void
-Altimeter::bind ()
-{
-}
-
-void
-Altimeter::unbind ()
-{
-}
-
void
Altimeter::update (double dt)
{
virtual ~Altimeter ();
virtual void init ();
- virtual void bind ();
- virtual void unbind ();
virtual void update (double dt);
private:
#include "slip_skid_ball.hxx"
#include "heading_indicator.hxx"
#include "vertical_speed_indicator.hxx"
+#include "mag_compass.hxx"
FGInstrumentMgr::FGInstrumentMgr ()
set_subsystem("ball", new SlipSkidBall);
set_subsystem("hi", new HeadingIndicator);
set_subsystem("vsi", new VerticalSpeedIndicator);
+ set_subsystem("compass", new MagCompass);
}
FGInstrumentMgr::~FGInstrumentMgr ()
void
SlipSkidBall::init ()
{
- _y_accel_node = fgGetNode("/orientation/roll-rate-degps", true);
- _z_accel_node = fgGetNode("/orientation/yaw-rate-degps", true);
+ _serviceable_node =
+ fgGetNode("/instrumentation/slip-skid-ball/serviceable", 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);
}
void
-SlipSkidBall::update (double dt)
+SlipSkidBall::update (double delta_time_sec)
{
- double d = -_z_accel_node->getDoubleValue();
- if (d < 60.0) // originally 1 radian
- d = 60.0;
- double pos = _y_accel_node->getDoubleValue()/d;
- pos = fgGetLowPass(_last_pos, pos, dt);
- _last_pos = pos;
- _out_node->setDoubleValue(pos);
+ if (_serviceable_node->getBoolValue()) {
+ double d = -_z_accel_node->getDoubleValue();
+ if (d < 1.0)
+ d = 1.0;
+ double pos = _y_accel_node->getDoubleValue() / d * 5.0;
+ pos = fgGetLowPass(_out_node->getDoubleValue(), pos, delta_time_sec);
+ _out_node->setDoubleValue(pos);
+ }
}
// end of slip_skid_ball.cxx
Gyro _gyro;
double _last_pos;
+ SGPropertyNode_ptr _serviceable_node;
SGPropertyNode_ptr _y_accel_node;
SGPropertyNode_ptr _z_accel_node;
SGPropertyNode_ptr _out_node;
true);
}
-void
-VerticalSpeedIndicator::bind ()
-{
-}
-
-void
-VerticalSpeedIndicator::unbind ()
-{
-}
-
void
VerticalSpeedIndicator::update (double dt)
{
virtual ~VerticalSpeedIndicator ();
virtual void init ();
- virtual void bind ();
- virtual void unbind ();
virtual void update (double dt);
private: