]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/steam.cxx
Commented out a cout statement.
[flightgear.git] / src / Cockpit / steam.cxx
index 75eae0e4d70e982f04a36f815dc346275adb5cfe..d9de74789ae7bcec179886f96185af14f826c251 100644 (file)
@@ -98,8 +98,9 @@ int FGSteam::_UpdatesPending = 1000000;  /* Forces filter to reset */
                                // FIXME: no need to use static
                                // functions any longer.
 
-void FGSteam::update ( int timesteps )
+void FGSteam::update (double dt)
 {
+    int timesteps = int(dt * fgGetInt("/sim/model-hz")); // FIXME
     if (!isTied) {
         isTied = true;
         fgTie("/steam/airspeed-kt", FGSteam::get_ASI_kias);
@@ -114,12 +115,12 @@ void FGSteam::update ( int timesteps )
        fgSetArchivable("/steam/turn-rate");
         fgTie("/steam/slip-skid", FGSteam::get_TC_rad);
        fgSetArchivable("/steam/slip-skid");
-        fgTie("/steam/vertical-speed-fpm", FGSteam::get_VSI_fps);
-       fgSetArchivable("/steam/vertical-speed-fpm");
+        fgTie("/steam/vertical-speed-fps", FGSteam::get_VSI_fps);
+       fgSetArchivable("/steam/vertical-speed-fps");
         fgTie("/steam/gyro-compass-deg", FGSteam::get_DG_deg);
        fgSetArchivable("/steam/gyro-compass-deg");
-        fgTie("/steam/adf-deg", FGSteam::get_HackADF_deg);
-       fgSetArchivable("/steam/adf-deg");
+        // fgTie("/steam/adf-deg", FGSteam::get_HackADF_deg);
+       // fgSetArchivable("/steam/adf-deg");
         fgTie("/steam/gyro-compass-error-deg",
               FGSteam::get_DG_err, FGSteam::set_DG_err,
               false);  /* don't modify the value */
@@ -206,29 +207,6 @@ void FGSteam::_CatchUp()
        /* int i, j; */
        double d, the_ENGINE_rpm;
 
-#if 0
-        /**************************
-       There is the possibility that this is the first call.
-       If this is the case, we will emit the feature registrations
-       just to be on the safe side.  Doing it more than once will
-       waste CPU time but doesn't hurt anything really.
-       */
-       if ( _UpdatesPending > 999999 )
-       { FGFeature::register_int (    "Avionics/NAV1/Localizer", &NAV1_LOC );
-         FGFeature::register_double ( "Avionics/NAV1/Latitude",  &NAV1_Lat );
-         FGFeature::register_double ( "Avionics/NAV1/Longitude", &NAV1_Lon );
-         FGFeature::register_double ( "Avionics/NAV1/Radial",    &NAV1_Rad );
-         FGFeature::register_double ( "Avionics/NAV1/Altitude",  &NAV1_Alt );
-         FGFeature::register_int (    "Avionics/NAV2/Localizer", &NAV2_LOC );
-         FGFeature::register_double ( "Avionics/NAV2/Latitude",  &NAV2_Lat );
-         FGFeature::register_double ( "Avionics/NAV2/Longitude", &NAV2_Lon );
-         FGFeature::register_double ( "Avionics/NAV2/Radial",    &NAV2_Rad );
-         FGFeature::register_double ( "Avionics/NAV2/Altitude",  &NAV2_Alt );
-         FGFeature::register_double ( "Avionics/ADF/Latitude",   &ADF_Lat );
-         FGFeature::register_double ( "Avionics/ADF/Longitude",  &ADF_Lon );
-       }
-#endif
-
        /**************************
        Someone has called our update function and
        it turns out that we are running somewhat behind.
@@ -275,7 +253,7 @@ void FGSteam::_CatchUp()
        AccE = current_aircraft.fdm_state->get_V_dot_east();
        AccU = current_aircraft.fdm_state->get_V_dot_down()
             - 9.81 / 0.3;
-       if ( fabs(the_TC_rad) > 0.2 )
+       if ( fabs(the_TC_rad) > 0.2 /* 2.0 */ )
        {       /* Massive sideslip jams it; it stops turning */
                the_MH_degps = 0.0;
                the_MH_err   = fgGetDouble("/orientation/heading-deg") - the_MH_deg;
@@ -489,20 +467,24 @@ double FGSteam::get_HackOBS2_deg () {
 }
 
 
+#if 0
 double FGSteam::get_HackADF_deg () {
+    static SGPropertyNode *adf_inrange = fgGetNode("/radios/adf/inrange", true);
+    static SGPropertyNode *adf_heading = fgGetNode("/radios/adf/heading", true);
     static double last_r = 0;
 
-    if ( current_radiostack->get_adf_inrange() ) {
-       double r = current_radiostack->get_adf_heading()
-            - fgGetDouble("orientation/heading");
+    if ( adf_inrange->getBoolValue() ) {
+       double r = adf_heading->getDoubleValue()
+            - fgGetDouble("/orientation/heading-deg");
        last_r = r;
-       // cout << "Radial = " << current_radiostack->get_adf_heading() 
-       //      << "  Heading = " << FGBFI::getHeading() << endl;
+       // cout << "Radial = " << adf_heading->getDoubleValue() << endl;
+        // cout << "/orientation/heading-deg = "
+        //      << fgGetDouble("/orientation/heading-deg") << endl;
        return r;
     } else {
        return last_r;
     }
 }
-
+#endif
 
 // end of steam.cxx