From 1bfa13e003305dafea1b00a92888d2bf098950b8 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 16 May 1998 13:04:13 +0000 Subject: [PATCH] New updates from Charlie Hotchkiss. --- Cockpit/cockpit.cxx | 54 +++++++++++++++++++++++++++++++++++++++++++-- Cockpit/hud.cxx | 21 ++++++++++-------- Cockpit/hud.hxx | 14 +++++++++--- 3 files changed, 75 insertions(+), 14 deletions(-) diff --git a/Cockpit/cockpit.cxx b/Cockpit/cockpit.cxx index 95a9df96d..10f725d37 100644 --- a/Cockpit/cockpit.cxx +++ b/Cockpit/cockpit.cxx @@ -61,6 +61,53 @@ static pCockpit ac_cockpit; // They should eventually be member functions of the aircraft. // +double get_latitude( void ) +{ + fgFLIGHT *f; + f = current_aircraft.flight; + +// return( toDM(FG_Latitude * RAD_TO_DEG) ); + return((double)((int)( FG_Latitude * RAD_TO_DEG)) ); +} +double get_lat_min( void ) +{ + fgFLIGHT *f; + double a, d; + + f = current_aircraft.flight; + + a = FG_Latitude * RAD_TO_DEG; + if (a < 0.0) { + a = -a; + } + d = (double) ( (int) a); + return( (a - d) * 60.0); +} + + +double get_longitude( void ) +{ + fgFLIGHT *f; + f = current_aircraft.flight; + +// return( toDM(FG_Longitude * RAD_TO_DEG) ); + return((double)((int) (FG_Longitude * RAD_TO_DEG)) ); +} +double get_long_min( void ) +{ + fgFLIGHT *f; + double a, d; + + f = current_aircraft.flight; + + a = FG_Longitude * RAD_TO_DEG; + if (a < 0.0) { + a = -a; + } + d = (double) ( (int) a); + return( (a - d) * 60.0); +} + double get_throttleval( void ) { fgCONTROLS *pcontrols; @@ -217,9 +264,12 @@ void fgCockpitUpdate( void ) } /* $Log$ -/* Revision 1.6 1998/05/13 18:27:53 curt -/* Added an fov to hud display. +/* Revision 1.7 1998/05/16 13:04:13 curt +/* New updates from Charlie Hotchkiss. /* + * Revision 1.6 1998/05/13 18:27:53 curt + * Added an fov to hud display. + * * Revision 1.5 1998/05/11 18:13:10 curt * Complete C++ rewrite of all cockpit code by Charlie Hotchkiss. * diff --git a/Cockpit/hud.cxx b/Cockpit/hud.cxx index e3c7ed0c2..8a3c7c48c 100644 --- a/Cockpit/hud.cxx +++ b/Cockpit/hud.cxx @@ -1301,8 +1301,8 @@ void HudLadder :: draw( void ) roll_value = current_ch2(); pitch_value = current_ch1() * RAD_TO_DEG; - vmin = (int)pitch_value - (double)width_units/2.0; - vmax = (int)pitch_value + (double)width_units/2.0; + vmin = (int)(pitch_value - (double)width_units/2.0); + vmax = (int)(pitch_value + (double)width_units/2.0); scr_min = box.bottom; // centroid.y - ((box.top - box.bottom) >> 1); // scr_max = box.top; // scr_min + (box.top - box.bottom); @@ -1689,7 +1689,7 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) HIptr = (instr_item *) new instr_label ( loc, get_sideslip, "%5.2f", - "Sideslip", + "Sideslip ", NULL, ReadTOP, RIGHT_JUST, @@ -1702,10 +1702,10 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) loc.left = 440; loc.top = 90; // Ignore loc.right = 440; // Ignore - loc.bottom = 100; + loc.bottom = 90; HIptr = (instr_item *) new instr_label( loc, get_throttleval, - "%5.2f", - "Throttle", + "%.2f", + "Throttle ", NULL, ReadTOP, RIGHT_JUST, @@ -1718,7 +1718,7 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) loc.left = 440; loc.top = 70; // Ignore loc.right = 500; // Ignore - loc.bottom = 85; + loc.bottom = 75; HIptr = (instr_item *) new instr_label( loc, get_elevatorval, "%5.2f", "Elevator", @@ -1899,9 +1899,12 @@ void fgUpdateHUD( void ) { } /* $Log$ -/* Revision 1.8 1998/05/13 18:27:54 curt -/* Added an fov to hud display. +/* Revision 1.9 1998/05/16 13:04:14 curt +/* New updates from Charlie Hotchkiss. /* + * Revision 1.8 1998/05/13 18:27:54 curt + * Added an fov to hud display. + * * Revision 1.7 1998/05/11 18:13:11 curt * Complete C++ rewrite of all cockpit code by Charlie Hotchkiss. * diff --git a/Cockpit/hud.hxx b/Cockpit/hud.hxx index f6ebf1dc2..a3447e397 100644 --- a/Cockpit/hud.hxx +++ b/Cockpit/hud.hxx @@ -144,6 +144,10 @@ extern double get_heading ( void ); extern double get_altitude ( void ); extern double get_sideslip ( void ); extern double get_frame_rate ( void ); +extern double get_latitude ( void ); +extern double get_lat_min ( void ); +extern double get_longitude ( void ); +extern double get_long_min ( void ); extern double get_fov ( void ); enum hudinstype{ HUDno_instr, @@ -205,7 +209,8 @@ class instr_item { // An Abstract Base Class (ABC) }; typedef instr_item *HIptr; -extern deque< instr_item *> HUD_deque; + +extern deque< instr_item * > HUD_deque; // instr_item This class has no other purpose than to maintain // a linked list of instrument and derived class @@ -440,9 +445,12 @@ void fgHUDSetTimeMode( Hptr hud, int time_of_day ); #endif // _HUD_H /* $Log$ -/* Revision 1.3 1998/05/13 18:27:55 curt -/* Added an fov to hud display. +/* Revision 1.4 1998/05/16 13:04:15 curt +/* New updates from Charlie Hotchkiss. /* + * Revision 1.3 1998/05/13 18:27:55 curt + * Added an fov to hud display. + * * Revision 1.2 1998/05/11 18:13:12 curt * Complete C++ rewrite of all cockpit code by Charlie Hotchkiss. *