]> git.mxchange.org Git - flightgear.git/commitdiff
Patches and tweaks from Alex.
authorcurt <curt>
Thu, 15 Jun 2000 18:36:13 +0000 (18:36 +0000)
committercurt <curt>
Thu, 15 Jun 2000 18:36:13 +0000 (18:36 +0000)
src/Cockpit/radiostack.cxx
src/Cockpit/steam.cxx
src/Cockpit/steam.hxx

index e6c048db0146c77c25a20db96d56c4138e811bf8..09ddfa404e92d619eaa62b451612fd915733d347 100644 (file)
@@ -22,6 +22,7 @@
 
 
 #include <Aircraft/aircraft.hxx>
+#include <Main/bfi.hxx>
 #include <Navaids/ilslist.hxx>
 #include <Navaids/navlist.hxx>
 
@@ -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;
index 029519339b6a32f2389b0e168277bf9214c1ba06..6eab60f61b317ad7f099b180679829d77e9d3f12 100644 (file)
@@ -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;
   }
 }
 
index b68941b755c94038685925518ddb2b99a23cee36..69911e1aef2be9e232786b58f4cd133af8449cf0 100644 (file)
@@ -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 ();