1
0
Fork 0

Minor autopilot/gui tweaks.

This commit is contained in:
curt 2000-04-30 07:33:11 +00:00
parent 3ecf1b8dce
commit b62900e44c
2 changed files with 25 additions and 6 deletions

View 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();
}

View 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 ) {