#include <string.h>
#include <Aircraft/aircraft.hxx>
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
#include <Include/fg_constants.h>
#include <Include/general.h>
#include <Main/options.hxx>
double get_throttleval( void )
{
- fgCONTROLS *pcontrols;
-
- pcontrols = current_aircraft.controls;
- return pcontrols->throttle[0]; // Hack limiting to one engine
+ return controls.get_throttle( 0 ); // Hack limiting to one engine
}
double get_aileronval( void )
{
- fgCONTROLS *pcontrols;
-
- pcontrols = current_aircraft.controls;
- return pcontrols->aileron;
+ return controls.get_aileron();
}
double get_elevatorval( void )
{
- fgCONTROLS *pcontrols;
-
- pcontrols = current_aircraft.controls;
- return pcontrols->elevator;
+ return controls.get_elevator();
}
double get_elev_trimval( void )
{
- fgCONTROLS *pcontrols;
-
- pcontrols = current_aircraft.controls;
- return pcontrols->elevator_trim;
+ return controls.get_elevator_trim();
}
double get_rudderval( void )
{
- fgCONTROLS *pcontrols;
-
- pcontrols = current_aircraft.controls;
- return pcontrols->rudder;
+ return controls.get_rudder();
}
double get_speed( void )
// rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
// FG_Latitude * RAD_TO_ARCSEC);
- return( FG_Altitude * FEET_TO_METER /* -rough_elev */ );
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return FG_Altitude;
+ } else {
+ return FG_Altitude * FEET_TO_METER;
+ }
}
double get_agl( void )
{
fgFLIGHT *f;
- double agl;
f = current_aircraft.flight;
- agl = FG_Altitude * FEET_TO_METER - scenery.cur_elev;
- return( agl );
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return FG_Altitude - scenery.cur_elev * METER_TO_FEET;
+ } else {
+ return FG_Altitude * FEET_TO_METER - scenery.cur_elev;
+ }
}
double get_sideslip( void )
f = current_aircraft.flight;
- return( FG_Climb_Rate * FEET_TO_METER * 60.0 );
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return FG_Climb_Rate * 60.0;
+ } else {
+ return FG_Climb_Rate * FEET_TO_METER * 60.0;
+ }
}
bool fgCockpitInit( fgAIRCRAFT *cur_aircraft )
{
- fgPrintf( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem\n");
+ FG_LOG( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem" );
// cockpit->code = 1; /* It will be aircraft dependent */
// cockpit->status = 0;
fgPanelInit();
}
- fgPrintf( FG_COCKPIT, FG_INFO,
- " Code %d Status %d\n",
- ac_cockpit->code(), ac_cockpit->status() );
+ FG_LOG( FG_COCKPIT, FG_INFO,
+ " Code " << ac_cockpit->code() << " Status "
+ << ac_cockpit->status() );
return true;
}
pview = ¤t_view;
- fgPrintf( FG_COCKPIT, FG_DEBUG,
- "Cockpit: code %d status %d\n",
- ac_cockpit->code(), ac_cockpit->status() );
+ FG_LOG( FG_COCKPIT, FG_DEBUG,
+ "Cockpit: code " << ac_cockpit->code() << " status "
+ << ac_cockpit->status() );
if ( current_options.get_hud_status() ) {
// This will check the global hud linked list pointer.
// $Log$
+// Revision 1.22 1998/11/06 21:17:45 curt
+// Converted to new logstream debugging facility. This allows release
+// builds with no messages at all (and no performance impact) by using
+// the -DFG_NDEBUG flag.
+//
+// Revision 1.21 1998/11/02 23:04:02 curt
+// HUD units now display in feet by default with meters being a command line
+// option.
+//
+// Revision 1.20 1998/10/25 14:08:40 curt
+// Turned "struct fgCONTROLS" into a class, with inlined accessor functions.
+//
// Revision 1.19 1998/10/17 01:33:56 curt
// C++ ifying ...
//