From b4a4e9ea8639aee9ed0571506741757f92c0d6fc Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 24 Oct 2006 16:03:44 +0000 Subject: [PATCH] Vivian MEAZZA: add missing heading-indicator-dg inclusion (instrument_mgr.cxx) mf: - fix abs/fabs bug - typos & cosmetics --- src/Instrumentation/heading_indicator_dg.cxx | 2 +- src/Instrumentation/heading_indicator_fg.cxx | 2 +- src/Instrumentation/instrument_mgr.cxx | 9 +++++++++ src/Instrumentation/mrg.cxx | 6 +++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Instrumentation/heading_indicator_dg.cxx b/src/Instrumentation/heading_indicator_dg.cxx index eb8726c89..28be8a3a1 100644 --- a/src/Instrumentation/heading_indicator_dg.cxx +++ b/src/Instrumentation/heading_indicator_dg.cxx @@ -1,5 +1,5 @@ // heading_indicator_dg.cxx - a Directional Gyro (DG) compass. -// Based on the vacuum driven Heading Indicator Written by David Megginson, +// Based on the vacuum driven Heading Indicator Written by David Megginson, // started 2002. // // Written by Vivian Meazza, started 2005. diff --git a/src/Instrumentation/heading_indicator_fg.cxx b/src/Instrumentation/heading_indicator_fg.cxx index 14027a412..b5dde762d 100644 --- a/src/Instrumentation/heading_indicator_fg.cxx +++ b/src/Instrumentation/heading_indicator_fg.cxx @@ -131,7 +131,7 @@ HeadingIndicatorFG::update (double dt) _heading_out_node->setDoubleValue(heading); - // calculate the difference between the indicacted heading + // calculate the difference between the indicated heading // and the selected heading for use with an autopilot static SGPropertyNode *bnode = fgGetNode( "/autopilot/settings/heading-bug-deg", false ); diff --git a/src/Instrumentation/instrument_mgr.cxx b/src/Instrumentation/instrument_mgr.cxx index 425d1ee1e..9bc9172c5 100644 --- a/src/Instrumentation/instrument_mgr.cxx +++ b/src/Instrumentation/instrument_mgr.cxx @@ -33,6 +33,7 @@ #include "gsdi.hxx" #include "heading_indicator.hxx" #include "heading_indicator_fg.hxx" +#include "heading_indicator_dg.hxx" #include "kr_87.hxx" #include "kt_70.hxx" #include "mag_compass.hxx" @@ -47,6 +48,7 @@ #include "wxradar.hxx" #include "tacan.hxx" #include "mk_viii.hxx" +#include "mrg.hxx" FGInstrumentMgr::FGInstrumentMgr () @@ -134,6 +136,9 @@ bool FGInstrumentMgr::build () } else if ( name == "heading-indicator-fg" ) { set_subsystem( "instrument" + temp.str(), new HeadingIndicatorFG( node ) ); + } else if ( name == "heading-indicator-dg" ) { + set_subsystem( "instrument" + temp.str(), + new HeadingIndicatorDG( node ) ); } else if ( name == "KR-87" ) { set_subsystem( "instrument" + temp.str(), new FGKR_87( node ) ); @@ -173,6 +178,10 @@ bool FGInstrumentMgr::build () } else if ( name == "mk-viii" ) { set_subsystem( "instrument" + temp.str(), new MK_VIII( node ) ); + } else if ( name == "master-reference-gyro" ) { + set_subsystem( "instrument" + temp.str(), + new MasterReferenceGyro( node ) ); + } else { SG_LOG( SG_ALL, SG_ALERT, "Unknown top level section: " << name ); diff --git a/src/Instrumentation/mrg.cxx b/src/Instrumentation/mrg.cxx index 918160ae5..830079172 100644 --- a/src/Instrumentation/mrg.cxx +++ b/src/Instrumentation/mrg.cxx @@ -1,5 +1,5 @@ -// MRG.cxx - an electrcally powered master reference gyro. -// Written by Vivian Meazza based on wrok by David Megginson, started 2006. +// MRG.cxx - an electrically powered master reference gyro. +// Written by Vivian Meazza based on work by David Megginson, started 2006. // // This file is in the Public Domain and comes with no warranty. @@ -167,7 +167,7 @@ MasterReferenceGyro::update (double dt) _last_yaw_rate = yaw_rate; //the gyro only erects inside limits - if ( abs ( yaw_rate ) <= 5 + if ( fabs ( yaw_rate ) <= 5 && (_g_in_node->getDoubleValue() <= 1.5 || _g_in_node->getDoubleValue() >= -0.5) ) { indicated_roll = _last_roll; -- 2.39.5