#include <Aircraft/aircraft.hxx>
+#include <Main/bfi.hxx>
#include <Navaids/ilslist.hxx>
#include <Navaids/navlist.hxx>
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;
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;
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;
////////////////////////////////////////////////////////////////////////
-int FGSteam::_UpdatesPending = 9999; /* Forces filter to reset */
+int FGSteam::_UpdatesPending = 999; /* Forces filter to reset */
void FGSteam::update ( int timesteps )
> 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;
}
}
// 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 ();
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 ();