From eedbfddbf12947063288f361d14b0e2b5c621a1a Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 10 Jan 2000 21:06:39 +0000 Subject: [PATCH] Added Mach Number to hud. Change reported speed on hud from V_equiv_kts to V_calibrated_kts. --- src/Cockpit/cockpit.cxx | 8 +++++++- src/Cockpit/hud.cxx | 20 ++++++++++++++++++++ src/Cockpit/hud.hxx | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Cockpit/cockpit.cxx b/src/Cockpit/cockpit.cxx index 2ec6736f6..587dd59d1 100644 --- a/src/Cockpit/cockpit.cxx +++ b/src/Cockpit/cockpit.cxx @@ -161,11 +161,17 @@ float get_rudderval( void ) float get_speed( void ) { // Make an explicit function call. - float speed = current_aircraft.fdm_state->get_V_equiv_kts() + float speed = current_aircraft.fdm_state->get_V_calibrated_kts() * current_options.get_speed_up(); return( speed ); } +float get_mach(void) +{ + float mach=current_aircraft.fdm_state->get_Mach_number(); + return mach; +} + float get_aoa( void ) { float aoa = current_aircraft.fdm_state->get_Alpha() * RAD_TO_DEG; diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index 4d3ec281f..a85624fc2 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -333,6 +333,26 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) 50.0, true); + + + HUD_deque.insert( HUD_deque.begin(), HIptr); + + +// case 10: // Digital Mach number + HIptr = (instr_item *) new instr_label ( min_x , //same as speed tape + cen_y-(compass_w/2) -10, //below speed tape + 40, + 30, + get_mach, + "%4.2f", + "", + NULL, + 1.0, + HUDS_TOP, + RIGHT_JUST, + font_size, + 0, + TRUE ); HUD_deque.insert( HUD_deque.begin(), HIptr); // case 9: diff --git a/src/Cockpit/hud.hxx b/src/Cockpit/hud.hxx index efffde8b3..c64a83f14 100644 --- a/src/Cockpit/hud.hxx +++ b/src/Cockpit/hud.hxx @@ -180,6 +180,7 @@ extern float get_vfc_ratio ( void ); extern float get_vfc_tris_drawn ( void ); extern float get_vfc_tris_culled ( void ); extern float get_climb_rate ( void ); +extern float get_mach( void ); extern char *coord_format_lat(float); extern char *coord_format_lon(float); //extern char *coord_format_latlon(float latitude, float longitude); // cockpit.cxx