1
0
Fork 0

Added magnetic compass instrument.

Removed some unused bind/unbind methods.

Improved responsiveness of slip-skid ball.

Some minor cleanups.
This commit is contained in:
david 2003-01-26 15:56:11 +00:00
parent acbb9f5aff
commit f72891e113
10 changed files with 18 additions and 48 deletions

View file

@ -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

View file

@ -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

View file

@ -37,8 +37,6 @@ public:
virtual ~AirspeedIndicator ();
virtual void init ();
virtual void bind ();
virtual void unbind ();
virtual void update (double dt);
private:

View file

@ -67,16 +67,6 @@ Altimeter::init ()
fgGetNode("/instrumentation/altimeter/indicated-altitude-ft", true);
}
void
Altimeter::bind ()
{
}
void
Altimeter::unbind ()
{
}
void
Altimeter::update (double dt)
{

View file

@ -40,8 +40,6 @@ public:
virtual ~Altimeter ();
virtual void init ();
virtual void bind ();
virtual void unbind ();
virtual void update (double dt);
private:

View file

@ -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 ()

View file

@ -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)
{
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

View file

@ -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;

View file

@ -32,16 +32,6 @@ VerticalSpeedIndicator::init ()
true);
}
void
VerticalSpeedIndicator::bind ()
{
}
void
VerticalSpeedIndicator::unbind ()
{
}
void
VerticalSpeedIndicator::update (double dt)
{

View file

@ -36,8 +36,6 @@ public:
virtual ~VerticalSpeedIndicator ();
virtual void init ();
virtual void bind ();
virtual void unbind ();
virtual void update (double dt);
private: