Added magnetic compass instrument.
Removed some unused bind/unbind methods. Improved responsiveness of slip-skid ball. Some minor cleanups.
This commit is contained in:
parent
acbb9f5aff
commit
f72891e113
10 changed files with 18 additions and 48 deletions
|
@ -8,6 +8,7 @@ libInstrumentation_a_SOURCES = instrument_mgr.cxx instrument_mgr.hxx \
|
|||
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
|
||||
|
|
|
@ -35,17 +35,6 @@ AirspeedIndicator::init ()
|
|||
true);
|
||||
}
|
||||
|
||||
void
|
||||
AirspeedIndicator::bind ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
AirspeedIndicator::unbind ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifndef SEA_LEVEL_DENSITY_SLUGFG3
|
||||
# define SEA_LEVEL_DENSITY_SLUGFT3 0.002378
|
||||
#endif
|
||||
|
|
|
@ -37,8 +37,6 @@ public:
|
|||
virtual ~AirspeedIndicator ();
|
||||
|
||||
virtual void init ();
|
||||
virtual void bind ();
|
||||
virtual void unbind ();
|
||||
virtual void update (double dt);
|
||||
|
||||
private:
|
||||
|
|
|
@ -67,16 +67,6 @@ Altimeter::init ()
|
|||
fgGetNode("/instrumentation/altimeter/indicated-altitude-ft", true);
|
||||
}
|
||||
|
||||
void
|
||||
Altimeter::bind ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Altimeter::unbind ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Altimeter::update (double dt)
|
||||
{
|
||||
|
|
|
@ -40,8 +40,6 @@ public:
|
|||
virtual ~Altimeter ();
|
||||
|
||||
virtual void init ();
|
||||
virtual void bind ();
|
||||
virtual void unbind ();
|
||||
virtual void update (double dt);
|
||||
|
||||
private:
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "slip_skid_ball.hxx"
|
||||
#include "heading_indicator.hxx"
|
||||
#include "vertical_speed_indicator.hxx"
|
||||
#include "mag_compass.hxx"
|
||||
|
||||
|
||||
FGInstrumentMgr::FGInstrumentMgr ()
|
||||
|
@ -23,6 +24,7 @@ FGInstrumentMgr::FGInstrumentMgr ()
|
|||
set_subsystem("ball", new SlipSkidBall);
|
||||
set_subsystem("hi", new HeadingIndicator);
|
||||
set_subsystem("vsi", new VerticalSpeedIndicator);
|
||||
set_subsystem("compass", new MagCompass);
|
||||
}
|
||||
|
||||
FGInstrumentMgr::~FGInstrumentMgr ()
|
||||
|
|
|
@ -19,22 +19,25 @@ SlipSkidBall::~SlipSkidBall ()
|
|||
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)
|
||||
{
|
||||
if (_serviceable_node->getBoolValue()) {
|
||||
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;
|
||||
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
|
||||
|
|
|
@ -45,6 +45,7 @@ private:
|
|||
Gyro _gyro;
|
||||
double _last_pos;
|
||||
|
||||
SGPropertyNode_ptr _serviceable_node;
|
||||
SGPropertyNode_ptr _y_accel_node;
|
||||
SGPropertyNode_ptr _z_accel_node;
|
||||
SGPropertyNode_ptr _out_node;
|
||||
|
|
|
@ -32,16 +32,6 @@ VerticalSpeedIndicator::init ()
|
|||
true);
|
||||
}
|
||||
|
||||
void
|
||||
VerticalSpeedIndicator::bind ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
VerticalSpeedIndicator::unbind ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
VerticalSpeedIndicator::update (double dt)
|
||||
{
|
||||
|
|
|
@ -36,8 +36,6 @@ public:
|
|||
virtual ~VerticalSpeedIndicator ();
|
||||
|
||||
virtual void init ();
|
||||
virtual void bind ();
|
||||
virtual void unbind ();
|
||||
virtual void update (double dt);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue