]> git.mxchange.org Git - flightgear.git/commitdiff
Minor autopilot/gui tweaks.
authorcurt <curt>
Sun, 30 Apr 2000 07:33:11 +0000 (07:33 +0000)
committercurt <curt>
Sun, 30 Apr 2000 07:33:11 +0000 (07:33 +0000)
src/Autopilot/newauto.cxx
src/Main/keyboard.cxx

index 34adf9d9961edb6f2ee276ab44c93b3d0a3361ef..ef308fc481b05f445f2f1cb58c1174874887b355 100644 (file)
@@ -85,7 +85,11 @@ void FGAutopilot::MakeTargetLatLonStr( double lat, double lon ) {
 
 
 void FGAutopilot::MakeTargetAltitudeStr( double altitude ) {
-    sprintf( TargetAltitudeStr, "APAltitude  %6.0f", altitude );
+    if ( altitude_mode == FG_ALTITUDE_TERRAIN ) {
+       sprintf( TargetAltitudeStr, "APAltitude  %6.0f+", altitude );
+    } else {
+       sprintf( TargetAltitudeStr, "APAltitude  %6.0f", altitude );
+    }
 }
 
 
@@ -637,10 +641,20 @@ void FGAutopilot::set_AltitudeMode( fgAutoAltitudeMode mode ) {
        TargetAltitude = FGBFI::getAltitude() * FEET_TO_METER;
        alt_error_accum = 0.0;
 
-       MakeTargetAltitudeStr( TargetAltitude );
+       if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+           MakeTargetAltitudeStr( TargetAltitude * METER_TO_FEET );
+       } else {
+           MakeTargetAltitudeStr( TargetAltitude * METER_TO_FEET );
+       }
     } else if ( altitude_mode == FG_ALTITUDE_TERRAIN ) {
        TargetAGL = FGBFI::getAGL() * FEET_TO_METER;
        alt_error_accum = 0.0;
+
+       if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+           MakeTargetAltitudeStr( TargetAGL * METER_TO_FEET );
+       } else {
+           MakeTargetAltitudeStr( TargetAGL * METER_TO_FEET );
+       }
     }
     
     update_old_control_values();
@@ -750,8 +764,14 @@ void FGAutopilot::AltitudeAdjust( double inc )
        
     if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET )
        target_alt *= METER_TO_FEET;
-    // ApAltitudeDialogInput->setValue((float)target_alt);
-    MakeTargetAltitudeStr( target_alt );
+    if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET )
+       target_agl *= METER_TO_FEET;
+
+    if ( altitude_mode == FG_ALTITUDE_LOCK ) {
+       MakeTargetAltitudeStr( target_alt );
+    } else if ( altitude_mode == FG_ALTITUDE_TERRAIN ) {
+       MakeTargetAltitudeStr( target_agl );
+    }
 
     update_old_control_values();
 }
index 60eb6a535082fc4f7742b36c9c70023d75344f0a..324a53e24e8ab0809955808915d24ab76301d07f 100644 (file)
@@ -46,6 +46,7 @@
 #include <simgear/misc/fgpath.hxx>
 
 #include <Aircraft/aircraft.hxx>
+#include <Autopilot/auto_gui.hxx>
 #include <Autopilot/newauto.hxx>
 #include <Cockpit/hud.hxx>
 #include <GUI/gui.h>
@@ -65,8 +66,6 @@
 #include "save.hxx"
 #include "views.hxx"
 
-extern void NewAltitude( puObject *cb );
-extern void NewHeading( puObject *cb );
 
 // Force an update of the sky and lighting parameters
 static void local_update_sky_and_lighting_params( void ) {