From f9533d2f4b70b5b38465fc120dadd0c980a486a1 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 5 Jun 2001 22:10:25 +0000 Subject: [PATCH] - eliminated all references to BFI; use properties instead --- src/Autopilot/auto_gui.cxx | 6 +++--- src/Cockpit/radiostack.cxx | 7 ++++--- src/Cockpit/steam.cxx | 30 +++++++++++++++--------------- src/Cockpit/steam.hxx | 9 ++++----- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Autopilot/auto_gui.cxx b/src/Autopilot/auto_gui.cxx index 833180d90..c9c3529b1 100644 --- a/src/Autopilot/auto_gui.cxx +++ b/src/Autopilot/auto_gui.cxx @@ -38,7 +38,6 @@ #include #include -#include
#include
#include
#include
@@ -219,7 +218,7 @@ void NewHeadingInit(void) char NewHeadingLabel[] = "Enter New Heading"; char *s; - float heading = FGBFI::getHeading(); + float heading = fgGetDouble("/orientation/heading"); int len = 260/2 - (puGetStringWidth( puGetDefaultLabelFont(), NewHeadingLabel ) /2 ); @@ -664,7 +663,8 @@ void PopWayPoint(puObject *cb) current_autopilot->set_HeadingMode( FGAutopilot::FG_TC_HEADING_LOCK ); // use current heading - current_autopilot->set_TargetHeading( FGBFI::getHeading() ); + current_autopilot + ->set_TargetHeading(fgGetDouble("/orientation/heading")); } } diff --git a/src/Cockpit/radiostack.cxx b/src/Cockpit/radiostack.cxx index 1bae2f576..39159f439 100644 --- a/src/Cockpit/radiostack.cxx +++ b/src/Cockpit/radiostack.cxx @@ -29,7 +29,6 @@ #include #include -#include
#include #include #include @@ -1053,7 +1052,8 @@ double FGRadioStack::get_nav2_heading_needle_deflection() const { double FGRadioStack::get_nav1_gs_needle_deflection() const { if ( nav1_inrange && nav1_has_gs ) { double x = nav1_gs_dist; - double y = (FGBFI::getAltitude() - nav1_elev) * SG_FEET_TO_METER; + double y = (fgGetDouble("/position/altitude") - nav1_elev) + * SG_FEET_TO_METER; double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES; return (nav1_target_gs - angle) * 5.0; } else { @@ -1067,7 +1067,8 @@ double FGRadioStack::get_nav1_gs_needle_deflection() const { double FGRadioStack::get_nav2_gs_needle_deflection() const { if ( nav2_inrange && nav2_has_gs ) { double x = nav2_gs_dist; - double y = (FGBFI::getAltitude() - nav2_elev) * SG_FEET_TO_METER; + double y = (fgGetDouble("/position/altitude") - nav2_elev) + * SG_FEET_TO_METER; double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES; return (nav2_target_gs - angle) * 5.0; } else { diff --git a/src/Cockpit/steam.cxx b/src/Cockpit/steam.cxx index c312bf5aa..9a76a9aa3 100644 --- a/src/Cockpit/steam.cxx +++ b/src/Cockpit/steam.cxx @@ -31,7 +31,6 @@ #include #include #include -#include
#include SG_USING_NAMESPACE(std); @@ -47,9 +46,6 @@ static bool isTied = false; // Declare the functions that read the variables //////////////////////////////////////////////////////////////////////// -// Anything that reads the BFI directly is not implemented at all! - - double FGSteam::the_STATIC_inhg = 29.92; double FGSteam::the_ALT_ft = 0.0; // Indicated altitude double FGSteam::get_ALT_ft() { _CatchUp(); return the_ALT_ft; } @@ -61,7 +57,7 @@ void FGSteam::set_ALT_datum_mb ( double datum_mb ) { the_ALT_datum_mb = datum_mb; } -double FGSteam::get_ASI_kias() { return FGBFI::getAirspeed(); } +double FGSteam::get_ASI_kias() { return fgGetDouble("/velocities/airspeed"); } double FGSteam::the_VSI_case = 29.92; double FGSteam::the_VSI_fps = 0.0; @@ -243,7 +239,6 @@ void FGSteam::_CatchUp() More subtle flaw is having it not move or a travel limit occasionally due to some dirt in the tube or on the ball. */ - // the_TC_rad = - ( FGBFI::getSideSlip () ); /* incorrect */ d = - current_aircraft.fdm_state->get_A_Z_pilot(); if ( d < 1 ) d = 1; set_lowpass ( & the_TC_rad, @@ -274,15 +269,17 @@ void FGSteam::_CatchUp() if ( fabs(the_TC_rad) > 0.2 ) { /* Massive sideslip jams it; it stops turning */ the_MH_degps = 0.0; - the_MH_err = FGBFI::getHeading () - the_MH_deg; + the_MH_err = fgGetDouble("/orientation/heading") - the_MH_deg; } else { double MagDip, MagVar, CosDip; double FrcN, FrcE, FrcU, AccTot; double EdgN, EdgE, EdgU; double TrqN, TrqE, TrqU, Torque; /* Find a force vector towards exact magnetic north */ - MagVar = FGBFI::getMagVar() / SGD_RADIANS_TO_DEGREES; - MagDip = FGBFI::getMagDip() / SGD_RADIANS_TO_DEGREES; + MagVar = fgGetDouble("/environment/magnetic-variation") + / SGD_RADIANS_TO_DEGREES; + MagDip = fgGetDouble("/environment/magnetic-dip") + / SGD_RADIANS_TO_DEGREES; CosDip = cos ( MagDip ); FrcN = CosDip * cos ( MagVar ); FrcE = CosDip * sin ( MagVar ); @@ -312,7 +309,7 @@ void FGSteam::_CatchUp() } if ( the_MH_err > 180.0 ) the_MH_err -= 360.0; else if ( the_MH_err < -180.0 ) the_MH_err += 360.0; - the_MH_deg = FGBFI::getHeading () - the_MH_err; + the_MH_deg = fgGetDouble("/orientation/heading") - the_MH_err; } /************************** @@ -328,7 +325,8 @@ void FGSteam::_CatchUp() We filter the actual value by one second to account for the line impedance of the plumbing. */ - double static_inhg = altFtToPressInHg(FGBFI::getAltitude()); + double static_inhg + = altFtToPressInHg(fgGetDouble("/position/altitude")); set_lowpass ( & the_STATIC_inhg, static_inhg, dt ); /* @@ -388,10 +386,10 @@ void FGSteam::_CatchUp() > put in those insidious turning errors ... for now anyway. */ if ( _UpdatesPending > 999999 ) - the_DG_err = FGBFI::getMagVar(); + the_DG_err = fgGetDouble("/environment/magnetic-variation"); the_DG_degps = 0.01; /* HACK! */ if (dt<1.0) the_DG_err += dt * the_DG_degps; - the_DG_deg = FGBFI::getHeading () - the_DG_err; + the_DG_deg = fgGetDouble("/orientation/heading") - the_DG_err; /************************** Finished updates, now clear the timer @@ -415,7 +413,8 @@ double FGSteam::get_HackGS_deg () { current_radiostack->get_nav1_has_gs() ) { double x = current_radiostack->get_nav1_gs_dist(); - double y = (FGBFI::getAltitude() - current_radiostack->get_nav1_elev()) + double y = (fgGetDouble("/position/altitude") + - current_radiostack->get_nav1_elev()) * SG_FEET_TO_METER; double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES; return (current_radiostack->get_nav1_target_gs() - angle) * 5.0; @@ -486,7 +485,8 @@ double FGSteam::get_HackADF_deg () { double r; if ( current_radiostack->get_adf_inrange() ) { - double r = current_radiostack->get_adf_heading() - FGBFI::getHeading(); + double r = current_radiostack->get_adf_heading() + - fgGetDouble("orientation/heading"); last_r = r; // cout << "Radial = " << current_radiostack->get_adf_heading() // << " Heading = " << FGBFI::getHeading() << endl; diff --git a/src/Cockpit/steam.hxx b/src/Cockpit/steam.hxx index c532344fc..862433ffa 100644 --- a/src/Cockpit/steam.hxx +++ b/src/Cockpit/steam.hxx @@ -40,15 +40,14 @@ SG_USING_NAMESPACE(std); /** * STEAM GAUGES * - * This class is a mapping layer, which retrieves information from - * the BFI (which reports truthful and ideal values) and generates - * all the instrument errors and inaccuracies that pilots (err) - * love, of course. Please report any missing flaws (!). + * This class is a mapping layer, which retrieves information from the + * property manager (which reports truthful and ideal values) and + * generates all the instrument errors and inaccuracies that pilots + * (err) love, of course. Please report any missing flaws (!). * * These should be used to operate cockpit instruments, * and autopilot features where these are slaved thus. * They should not be used for other simulation purposes. - * */ class FGSteam { -- 2.39.5