From: curt Date: Thu, 15 Jun 2000 18:36:13 +0000 (+0000) Subject: Patches and tweaks from Alex. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1882fb0119f1db6f457cc52f8c55a9e718ff028f;p=flightgear.git Patches and tweaks from Alex. --- diff --git a/src/Cockpit/radiostack.cxx b/src/Cockpit/radiostack.cxx index e6c048db0..09ddfa404 100644 --- a/src/Cockpit/radiostack.cxx +++ b/src/Cockpit/radiostack.cxx @@ -22,6 +22,7 @@ #include +#include
#include #include @@ -102,6 +103,7 @@ void FGRadioStack::update( double lon, double lat, double elev ) { nav1_loclat, nav1_loclon, &az1, &az2, &s ); nav1_heading = az1; + // Alex: nav1_heading = az1 - FGBFI::getMagVar() / RAD_TO_DEG; // cout << " heading = " << nav1_heading // << " dist = " << nav1_dist << endl; @@ -145,6 +147,7 @@ void FGRadioStack::update( double lon, double lat, double elev ) { nav2_loclat, nav2_loclon, &az1, &az2, &s ); nav2_heading = az1; + // Alex: nav2_heading = az1 - FGBFI::getMagVar() / RAD_TO_DEG; // cout << " heading = " << nav2_heading // << " dist = " << nav2_dist << endl; diff --git a/src/Cockpit/steam.cxx b/src/Cockpit/steam.cxx index 029519339..6eab60f61 100644 --- a/src/Cockpit/steam.cxx +++ b/src/Cockpit/steam.cxx @@ -68,10 +68,16 @@ double FGSteam::the_MH_deg = 0.0; double FGSteam::the_MH_degps = 0.0; double FGSteam::get_MH_deg () { _CatchUp(); return the_MH_deg; } +double FGSteam::the_DG_err = 0.0; double FGSteam::the_DG_deg = 0.0; double FGSteam::the_DG_degps = 0.0; double FGSteam::the_DG_inhg = 0.0; double FGSteam::get_DG_deg () { _CatchUp(); return the_DG_deg; } +double FGSteam::get_DG_err () { _CatchUp(); return the_DG_err; } + +void FGSteam::set_DG_err ( double approx_magvar ) { + the_DG_err = approx_magvar; +} double FGSteam::the_TC_rad = 0.0; double FGSteam::the_TC_std = 0.0; @@ -84,7 +90,7 @@ double FGSteam::get_TC_std () { _CatchUp(); return the_TC_std; } //////////////////////////////////////////////////////////////////////// -int FGSteam::_UpdatesPending = 9999; /* Forces filter to reset */ +int FGSteam::_UpdatesPending = 999; /* Forces filter to reset */ void FGSteam::update ( int timesteps ) @@ -315,12 +321,20 @@ void FGSteam::_CatchUp() > have it tumble when you exceed the usual pitch or bank limits, > put in those insidious turning errors ... for now anyway. */ - the_DG_deg = FGBFI::getHeading () - FGBFI::getMagVar(); + // cout << "Updates pending = " << _UpdatesPending << endl; + if ( _UpdatesPending > 999 ) { + the_DG_err = FGBFI::getMagVar(); + } + the_DG_degps = 0.0; /* HACK! */ + if (dt<1.0) the_DG_err += dt * the_DG_degps; + the_DG_deg = FGBFI::getHeading () - the_DG_err; /************************** Finished updates, now clear the timer */ _UpdatesPending = 0; + } else { + // cout << "0 Updates pending" << endl; } } diff --git a/src/Cockpit/steam.hxx b/src/Cockpit/steam.hxx index b68941b75..69911e1ae 100644 --- a/src/Cockpit/steam.hxx +++ b/src/Cockpit/steam.hxx @@ -58,9 +58,11 @@ public: // Position static double get_ALT_ft (); + static double get_TC_rad (); static double get_MH_deg (); static double get_DG_deg (); - static double get_TC_rad (); + static double get_DG_err (); + static void set_DG_err(double approx_magvar); // Velocities static double get_ASI_kias (); @@ -85,7 +87,7 @@ private: static double the_STATIC_inhg, the_VACUUM_inhg; static double the_VSI_fps, the_VSI_case; static double the_MH_deg, the_MH_degps, the_MH_err; - static double the_DG_deg, the_DG_degps, the_DG_inhg; + static double the_DG_deg, the_DG_degps, the_DG_inhg, the_DG_err; static int _UpdatesPending; static void _CatchUp ();