- eliminated all references to BFI; use properties instead
This commit is contained in:
parent
9c0925744d
commit
f9533d2f4b
4 changed files with 26 additions and 26 deletions
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include <Airports/simple.hxx>
|
||||
#include <GUI/gui.h>
|
||||
#include <Main/bfi.hxx>
|
||||
#include <Main/fg_init.hxx>
|
||||
#include <Main/globals.hxx>
|
||||
#include <Main/fg_props.hxx>
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include <simgear/math/sg_random.h>
|
||||
|
||||
#include <Aircraft/aircraft.hxx>
|
||||
#include <Main/bfi.hxx>
|
||||
#include <Navaids/ilslist.hxx>
|
||||
#include <Navaids/mkrbeacons.hxx>
|
||||
#include <Navaids/navlist.hxx>
|
||||
|
@ -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 {
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <simgear/math/sg_types.hxx>
|
||||
#include <simgear/misc/props.hxx>
|
||||
#include <Aircraft/aircraft.hxx>
|
||||
#include <Main/bfi.hxx>
|
||||
#include <NetworkOLK/features.hxx>
|
||||
|
||||
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;
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue