char NewHeadingLabel[] = "Enter New Heading";
char *s;
- float heading = fgGetDouble("/orientation/heading");
+ float heading = fgGetDouble("/orientation/heading-deg");
int len = 260/2 -
(puGetStringWidth( puGetDefaultLabelFont(), NewHeadingLabel ) /2 );
// use current heading
current_autopilot
- ->set_TargetHeading(fgGetDouble("/orientation/heading"));
+ ->set_TargetHeading(fgGetDouble("/orientation/heading-deg"));
}
}
void FGAutopilot::init() {
SG_LOG( SG_AUTOPILOT, SG_INFO, "Init AutoPilot Subsystem" );
- latitude_node = fgGetNode("/position/latitude", true);
- longitude_node = fgGetNode("/position/longitude", true);
- altitude_node = fgGetNode("/position/altitude", true);
- altitude_agl_node = fgGetNode("/position/altitude-agl", true);
- vertical_speed_node = fgGetNode("/velocities/vertical-speed", true);
- heading_node = fgGetNode("/orientation/heading", true);
- roll_node = fgGetNode("/orientation/roll", true);
+ latitude_node = fgGetNode("/position/latitude-deg", true);
+ longitude_node = fgGetNode("/position/longitude-deg", true);
+ altitude_node = fgGetNode("/position/altitude-ft", true);
+ altitude_agl_node = fgGetNode("/position/altitude-agl-ft", true);
+ vertical_speed_node = fgGetNode("/velocities/vertical-speed-fps", true);
+ heading_node = fgGetNode("/orientation/heading-deg", true);
+ roll_node = fgGetNode("/orientation/roll-deg", true);
heading_hold = false ; // turn the heading hold off
altitude_hold = false ; // turn the altitude hold off
auto_throttle = value;
if ( auto_throttle == true ) {
- TargetSpeed = fgGetDouble("/velocities/airspeed");
+ TargetSpeed = fgGetDouble("/velocities/airspeed-kt");
speed_error_accum = 0.0;
}
nav2_radial = 0.0;
nav2_dme_dist = 0.0;
need_update = true;
- lon_node = fgGetNode("/position/longitude");
- lat_node = fgGetNode("/position/latitude");
- alt_node = fgGetNode("/position/altitude");
+ lon_node = fgGetNode("/position/longitude-deg");
+ lat_node = fgGetNode("/position/latitude-deg");
+ alt_node = fgGetNode("/position/altitude-ft");
}
FGRadioStack::bind ()
{
// User inputs
- fgTie("/radios/nav1/frequencies/selected", this,
+ fgTie("/radios/nav[0]/frequencies/selected-mhz", this,
&FGRadioStack::get_nav1_freq, &FGRadioStack::set_nav1_freq);
- fgTie("/radios/nav1/frequencies/standby", this,
+ fgTie("/radios/nav[0]/standby-mhz", this,
&FGRadioStack::get_nav1_alt_freq, &FGRadioStack::set_nav1_alt_freq);
- fgTie("/radios/nav1/radials/selected", this,
+ fgTie("/radios/nav[0]/radials/selected-deg", this,
&FGRadioStack::get_nav1_sel_radial,
&FGRadioStack::set_nav1_sel_radial);
- fgTie("/radios/nav1/volume", this,
+ fgTie("/radios/nav[0]/volume", this,
&FGRadioStack::get_nav1_vol_btn,
&FGRadioStack::set_nav1_vol_btn);
- fgTie("/radios/nav1/ident", this,
+ fgTie("/radios/nav[0]/ident", this,
&FGRadioStack::get_nav1_ident_btn,
&FGRadioStack::set_nav1_ident_btn);
// Radio outputs
- fgTie("/radios/nav1/radials/actual", this, &FGRadioStack::get_nav1_radial);
- fgTie("/radios/nav1/to-flag", this, &FGRadioStack::get_nav1_to_flag);
- fgTie("/radios/nav1/from-flag", this, &FGRadioStack::get_nav1_from_flag);
- fgTie("/radios/nav1/in-range", this, &FGRadioStack::get_nav1_inrange);
- fgTie("/radios/nav1/dme/distance", this, &FGRadioStack::get_nav1_dme_dist);
- fgTie("/radios/nav1/dme/in-range", this,
+ fgTie("/radios/nav[0]/radials/actual-deg", this, &FGRadioStack::get_nav1_radial);
+ fgTie("/radios/nav[0]/to-flag", this, &FGRadioStack::get_nav1_to_flag);
+ fgTie("/radios/nav[0]/from-flag", this, &FGRadioStack::get_nav1_from_flag);
+ fgTie("/radios/nav[0]/in-range", this, &FGRadioStack::get_nav1_inrange);
+ fgTie("/radios/nav[0]/dme/distance-nm", this, &FGRadioStack::get_nav1_dme_dist);
+ fgTie("/radios/nav[0]/dme/in-range", this,
&FGRadioStack::get_nav1_dme_inrange);
- fgTie("/radios/nav1/heading-needle-deflection", this,
+ fgTie("/radios/nav[0]/heading-needle-deflection", this,
&FGRadioStack::get_nav1_heading_needle_deflection);
- fgTie("/radios/nav1/gs-needle-deflection", this,
+ fgTie("/radios/nav[0]/gs-needle-deflection", this,
&FGRadioStack::get_nav1_gs_needle_deflection);
// User inputs
- fgTie("/radios/nav2/frequencies/selected", this,
+ fgTie("/radios/nav[1]/frequencies/selected-mhz", this,
&FGRadioStack::get_nav2_freq, &FGRadioStack::set_nav2_freq);
- fgTie("/radios/nav2/frequencies/standby", this,
+ fgTie("/radios/nav[1]/standby-mhz", this,
&FGRadioStack::get_nav2_alt_freq, &FGRadioStack::set_nav2_alt_freq);
- fgTie("/radios/nav2/radials/selected", this,
+ fgTie("/radios/nav[1]/radials/selected-deg", this,
&FGRadioStack::get_nav2_sel_radial,
&FGRadioStack::set_nav2_sel_radial);
- fgTie("/radios/nav2/volume", this,
+ fgTie("/radios/nav[1]/volume", this,
&FGRadioStack::get_nav2_vol_btn,
&FGRadioStack::set_nav2_vol_btn);
- fgTie("/radios/nav2/ident", this,
+ fgTie("/radios/nav[1]/ident", this,
&FGRadioStack::get_nav2_ident_btn,
&FGRadioStack::set_nav2_ident_btn);
// Radio outputs
- fgTie("/radios/nav2/radials/actual", this, &FGRadioStack::get_nav2_radial);
- fgTie("/radios/nav2/to-flag", this, &FGRadioStack::get_nav2_to_flag);
- fgTie("/radios/nav2/from-flag", this, &FGRadioStack::get_nav2_from_flag);
- fgTie("/radios/nav2/in-range", this, &FGRadioStack::get_nav2_inrange);
- fgTie("/radios/nav2/dme/distance", this, &FGRadioStack::get_nav2_dme_dist);
- fgTie("/radios/nav2/dme/in-range", this,
+ fgTie("/radios/nav[1]/radials/actual-deg", this, &FGRadioStack::get_nav2_radial);
+ fgTie("/radios/nav[1]/to-flag", this, &FGRadioStack::get_nav2_to_flag);
+ fgTie("/radios/nav[1]/from-flag", this, &FGRadioStack::get_nav2_from_flag);
+ fgTie("/radios/nav[1]/in-range", this, &FGRadioStack::get_nav2_inrange);
+ fgTie("/radios/nav[1]/dme/distance-nm", this, &FGRadioStack::get_nav2_dme_dist);
+ fgTie("/radios/nav[1]/dme/in-range", this,
&FGRadioStack::get_nav2_dme_inrange);
- fgTie("/radios/nav2/heading-needle-deflection", this,
+ fgTie("/radios/nav[1]/heading-needle-deflection", this,
&FGRadioStack::get_nav2_heading_needle_deflection);
- fgTie("/radios/nav2/gs-needle-deflection", this,
+ fgTie("/radios/nav[1]/gs-needle-deflection", this,
&FGRadioStack::get_nav2_gs_needle_deflection);
// User inputs
- fgTie("/radios/adf/frequencies/selected", this,
+ fgTie("/radios/adf/frequencies/selected-khz", this,
&FGRadioStack::get_adf_freq, &FGRadioStack::set_adf_freq);
- fgTie("/radios/adf/frequencies/standby", this,
+ fgTie("/radios/adf/frequencies/standby-khz", this,
&FGRadioStack::get_adf_alt_freq, &FGRadioStack::set_adf_alt_freq);
- fgTie("/radios/adf/rotation", this,
+ fgTie("/radios/adf/rotation-deg", this,
&FGRadioStack::get_adf_rotation, &FGRadioStack::set_adf_rotation);
fgTie("/radios/adf/volume", this,
&FGRadioStack::get_adf_vol_btn,
void
FGRadioStack::unbind ()
{
- fgUntie("/radios/nav1/frequencies/selected");
- fgUntie("/radios/nav1/frequencies/standby");
- fgUntie("/radios/nav1/radials/actual");
- fgUntie("/radios/nav1/radials/selected");
- fgUntie("/radios/nav1/on");
- fgUntie("/radios/nav1/ident");
- fgUntie("/radios/nav1/to-flag");
- fgUntie("/radios/nav1/from-flag");
- fgUntie("/radios/nav1/in-range");
- fgUntie("/radios/nav1/dme/distance");
- fgUntie("/radios/nav1/dme/in-range");
- fgUntie("/radios/nav1/heading-needle-deflection");
- fgUntie("/radios/nav1/gs-needle-deflection");
-
- fgUntie("/radios/nav2/frequencies/selected");
- fgUntie("/radios/nav2/frequencies/standby");
- fgUntie("/radios/nav2/radials/actual");
- fgUntie("/radios/nav2/radials/selected");
- fgUntie("/radios/nav2/on");
- fgUntie("/radios/nav2/ident");
- fgUntie("/radios/nav2/to-flag");
- fgUntie("/radios/nav2/from-flag");
- fgUntie("/radios/nav2/in-range");
- fgUntie("/radios/nav2/dme/distance");
- fgUntie("/radios/nav2/dme/in-range");
- fgUntie("/radios/nav2/heading-needle-deflection");
- fgUntie("/radios/nav2/gs-needle-deflection");
-
- fgUntie("/radios/adf/frequencies/selected");
- fgUntie("/radios/adf/frequencies/standby");
- fgUntie("/radios/adf/rotation");
+ fgUntie("/radios/nav[0]/frequencies/selected-mhz");
+ fgUntie("/radios/nav[0]/standby-mhz");
+ fgUntie("/radios/nav[0]/radials/actual-deg");
+ fgUntie("/radios/nav[0]/radials/selected-deg");
+ fgUntie("/radios/nav[0]/on");
+ fgUntie("/radios/nav[0]/ident");
+ fgUntie("/radios/nav[0]/to-flag");
+ fgUntie("/radios/nav[0]/from-flag");
+ fgUntie("/radios/nav[0]/in-range");
+ fgUntie("/radios/nav[0]/dme/distance-nm");
+ fgUntie("/radios/nav[0]/dme/in-range");
+ fgUntie("/radios/nav[0]/heading-needle-deflection");
+ fgUntie("/radios/nav[0]/gs-needle-deflection");
+
+ fgUntie("/radios/nav[1]/frequencies/selected-mhz");
+ fgUntie("/radios/nav[1]/standby-mhz");
+ fgUntie("/radios/nav[1]//radials/actual-deg");
+ fgUntie("/radios/nav[1]/radials/selected-deg");
+ fgUntie("/radios/nav[1]/on");
+ fgUntie("/radios/nav[1]/ident");
+ fgUntie("/radios/nav[1]/to-flag");
+ fgUntie("/radios/nav[1]/from-flag");
+ fgUntie("/radios/nav[1]/in-range");
+ fgUntie("/radios/nav[1]/dme/distance-nm");
+ fgUntie("/radios/nav[1]/dme/in-range");
+ fgUntie("/radios/nav[1]/heading-needle-deflection");
+ fgUntie("/radios/nav[1]/gs-needle-deflection");
+
+ fgUntie("/radios/adf/frequencies/selected-khz");
+ fgUntie("/radios/adf/frequencies/standby-khz");
+ fgUntie("/radios/adf/rotation-deg");
fgUntie("/radios/adf/on");
fgUntie("/radios/adf/ident");
double FGRadioStack::get_nav1_gs_needle_deflection() const {
if ( nav1_inrange && nav1_has_gs ) {
double x = nav1_gs_dist;
- double y = (fgGetDouble("/position/altitude") - nav1_elev)
+ double y = (fgGetDouble("/position/altitude-ft") - nav1_elev)
* SG_FEET_TO_METER;
double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES;
return (nav1_target_gs - angle) * 5.0;
double FGRadioStack::get_nav2_gs_needle_deflection() const {
if ( nav2_inrange && nav2_has_gs ) {
double x = nav2_gs_dist;
- double y = (fgGetDouble("/position/altitude") - nav2_elev)
+ double y = (fgGetDouble("/position/altitude-ft") - nav2_elev)
* SG_FEET_TO_METER;
double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES;
return (nav2_target_gs - angle) * 5.0;
the_ALT_datum_mb = datum_mb;
}
-double FGSteam::get_ASI_kias() { return fgGetDouble("/velocities/airspeed"); }
+double FGSteam::get_ASI_kias() { return fgGetDouble("/velocities/airspeed-kt"); }
double FGSteam::the_VSI_case = 29.92;
double FGSteam::the_VSI_fps = 0.0;
{
if (!isTied) {
isTied = true;
- fgTie("/steam/airspeed", FGSteam::get_ASI_kias);
- fgTie("/steam/altitude", FGSteam::get_ALT_ft);
+ fgTie("/steam/airspeed-kt", FGSteam::get_ASI_kias);
+ fgTie("/steam/altitude-ft", FGSteam::get_ALT_ft);
fgTie("/steam/altimeter-datum-mb",
FGSteam::get_ALT_datum_mb, FGSteam::set_ALT_datum_mb,
false); /* don't modify the value */
fgTie("/steam/turn-rate", FGSteam::get_TC_std);
fgTie("/steam/slip-skid", FGSteam::get_TC_rad);
- fgTie("/steam/vertical-speed", FGSteam::get_VSI_fps);
- fgTie("/steam/gyro-compass", FGSteam::get_DG_deg);
- fgTie("/steam/adf", FGSteam::get_HackADF_deg);
- fgTie("/steam/gyro-compass-error",
+ fgTie("/steam/vertical-speed-fpm", FGSteam::get_VSI_fps);
+ fgTie("/steam/gyro-compass-deg", FGSteam::get_DG_deg);
+ fgTie("/steam/adf-deg", FGSteam::get_HackADF_deg);
+ fgTie("/steam/gyro-compass-error-deg",
FGSteam::get_DG_err, FGSteam::set_DG_err,
false); /* don't modify the value */
- fgTie("/steam/mag-compass", FGSteam::get_MH_deg);
+ fgTie("/steam/mag-compass-deg", FGSteam::get_MH_deg);
}
_UpdatesPending += timesteps;
}
if ( fabs(the_TC_rad) > 0.2 )
{ /* Massive sideslip jams it; it stops turning */
the_MH_degps = 0.0;
- the_MH_err = fgGetDouble("/orientation/heading") - the_MH_deg;
+ the_MH_err = fgGetDouble("/orientation/heading-deg") - 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 = fgGetDouble("/environment/magnetic-variation")
+ MagVar = fgGetDouble("/environment/magnetic-variation-deg")
/ SGD_RADIANS_TO_DEGREES;
- MagDip = fgGetDouble("/environment/magnetic-dip")
+ MagDip = fgGetDouble("/environment/magnetic-dip-deg")
/ SGD_RADIANS_TO_DEGREES;
CosDip = cos ( MagDip );
FrcN = CosDip * cos ( MagVar );
}
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 = fgGetDouble("/orientation/heading") - the_MH_err;
+ the_MH_deg = fgGetDouble("/orientation/heading-deg") - the_MH_err;
}
/**************************
account for the line impedance of the plumbing.
*/
double static_inhg
- = altFtToPressInHg(fgGetDouble("/position/altitude"));
+ = altFtToPressInHg(fgGetDouble("/position/altitude-ft"));
set_lowpass ( & the_STATIC_inhg, static_inhg, dt );
/*
> put in those insidious turning errors ... for now anyway.
*/
if ( _UpdatesPending > 999999 )
- the_DG_err = fgGetDouble("/environment/magnetic-variation");
+ the_DG_err = fgGetDouble("/environment/magnetic-variation-deg");
the_DG_degps = 0.01; /* HACK! */
if (dt<1.0) the_DG_err += dt * the_DG_degps;
- the_DG_deg = fgGetDouble("/orientation/heading") - the_DG_err;
+ the_DG_deg = fgGetDouble("/orientation/heading-deg") - the_DG_err;
/**************************
Finished updates, now clear the timer
current_radiostack->get_nav1_has_gs() )
{
double x = current_radiostack->get_nav1_gs_dist();
- double y = (fgGetDouble("/position/altitude")
+ double y = (fgGetDouble("/position/altitude-ft")
- current_radiostack->get_nav1_elev())
* SG_FEET_TO_METER;
double angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES;
//set velocities
sgSetVec3( temp,
- fgGetDouble("/velocities/uBody"),
- fgGetDouble("/velocities/vBody"),
- fgGetDouble("/velocities/wBody") );
+ fgGetDouble("/velocities/uBody-fps"),
+ fgGetDouble("/velocities/vBody-fps"),
+ fgGetDouble("/velocities/wBody-fps") );
current_balloon.setVelocity( temp );
SG_LOG( SG_FLIGHT, SG_INFO, "Finished initializing BalloonSim" );
// Set initial position
SG_LOG(SG_FLIGHT, SG_INFO, "...initializing position...");
- set_Longitude(fgGetDouble("/position/longitude") * SGD_DEGREES_TO_RADIANS);
- set_Latitude(fgGetDouble("/position/latitude") * SGD_DEGREES_TO_RADIANS);
+ set_Longitude(fgGetDouble("/position/longitude-deg") * SGD_DEGREES_TO_RADIANS);
+ set_Latitude(fgGetDouble("/position/latitude-deg") * SGD_DEGREES_TO_RADIANS);
double ground_elev_m = scenery.cur_elev + 1;
double ground_elev_ft = ground_elev_m * METERS_TO_FEET;
if (fgGetBool("/sim/startup/onground") ||
- fgGetDouble("/position/altitude") < ground_elev_ft)
- fgSetDouble("/position/altitude", ground_elev_ft);
- set_Altitude(fgGetDouble("/position/altitude"));
+ fgGetDouble("/position/altitude-ft") < ground_elev_ft)
+ fgSetDouble("/position/altitude-ft", ground_elev_ft);
+ set_Altitude(fgGetDouble("/position/altitude-ft"));
// Set ground elevation
SG_LOG(SG_FLIGHT, SG_INFO,
} else {
const string speedset = fgGetString("/sim/startup/speed-set");
if (speedset == "knots" || speedset == "KNOTS") {
- set_V_calibrated_kts(fgGetDouble("/velocities/airspeed"));
+ set_V_calibrated_kts(fgGetDouble("/velocities/airspeed-kt"));
} else if (speedset == "mach" || speedset == "MACH") {
set_Mach_number(fgGetDouble("/velocities/mach"));
} else if (speedset == "UVW" || speedset == "uvw") {
- set_Velocities_Wind_Body(fgGetDouble("/velocities/uBody"),
- fgGetDouble("/velocities/vBody"),
- fgGetDouble("/velocities/wBody"));
+ set_Velocities_Wind_Body(fgGetDouble("/velocities/uBody-fps"),
+ fgGetDouble("/velocities/vBody-fps"),
+ fgGetDouble("/velocities/wBody-fps"));
} else if (speedset == "NED" || speedset == "ned") {
- set_Velocities_Local(fgGetDouble("/velocities/speed-north"),
- fgGetDouble("/velocities/speed-east"),
- fgGetDouble("/velocities/speed-down"));
+ set_Velocities_Local(fgGetDouble("/velocities/speed-north-fps"),
+ fgGetDouble("/velocities/speed-east-fps"),
+ fgGetDouble("/velocities/speed-down-fps"));
} else {
SG_LOG(SG_FLIGHT, SG_ALERT,
"Unrecognized value for /sim/startup/speed-set: " << speedset);
// Set initial Euler angles
SG_LOG(SG_FLIGHT, SG_INFO, "...initializing Euler angles...");
set_Euler_Angles
- (fgGetDouble("/orientation/roll") * SGD_DEGREES_TO_RADIANS,
- fgGetDouble("/orientation/pitch") * SGD_DEGREES_TO_RADIANS,
- fgGetDouble("/orientation/heading") * SGD_DEGREES_TO_RADIANS);
+ (fgGetDouble("/orientation/roll-deg") * SGD_DEGREES_TO_RADIANS,
+ fgGetDouble("/orientation/pitch-deg") * SGD_DEGREES_TO_RADIANS,
+ fgGetDouble("/orientation/heading-deg") * SGD_DEGREES_TO_RADIANS);
SG_LOG(SG_FLIGHT, SG_INFO, "End initializing FGInterface");
}
&FGInterface::get_multi_loop); // read-only
// Aircraft position
- fgTie("/position/latitude", this,
+ fgTie("/position/latitude-deg", this,
&FGInterface::get_Latitude_deg,
&FGInterface::set_Latitude_deg,
false);
- fgTie("/position/longitude", this,
+ fgTie("/position/longitude-deg", this,
&FGInterface::get_Longitude_deg,
&FGInterface::set_Longitude_deg,
false);
- fgTie("/position/altitude", this,
+ fgTie("/position/altitude-ft", this,
&FGInterface::get_Altitude,
&FGInterface::set_Altitude,
false);
- fgTie("/position/altitude-agl", this,
+ fgTie("/position/altitude-agl-ft", this,
&FGInterface::get_Altitude_AGL); // read-only
// Orientation
- fgTie("/orientation/roll", this,
+ fgTie("/orientation/roll-deg", this,
&FGInterface::get_Phi_deg,
&FGInterface::set_Phi_deg);
- fgTie("/orientation/pitch", this,
+ fgTie("/orientation/pitch-deg", this,
&FGInterface::get_Theta_deg,
&FGInterface::set_Theta_deg);
- fgTie("/orientation/heading", this,
+ fgTie("/orientation/heading-deg", this,
&FGInterface::get_Psi_deg,
&FGInterface::set_Psi_deg);
// Calibrated airspeed
- fgTie("/velocities/airspeed", this,
+ fgTie("/velocities/airspeed-kt", this,
&FGInterface::get_V_calibrated_kts,
&FGInterface::set_V_calibrated_kts);
// Local velocities
- fgTie("/velocities/speed-north", this,
+ fgTie("/velocities/speed-north-fps", this,
&FGInterface::get_V_north,
&FGInterface::set_V_north);
- fgTie("/velocities/speed-east", this,
+ fgTie("/velocities/speed-east-fps", this,
&FGInterface::get_V_east,
&FGInterface::set_V_east);
- fgTie("/velocities/speed-down", this,
+ fgTie("/velocities/speed-down-fps", this,
&FGInterface::get_V_down,
&FGInterface::set_V_down);
// Relative wind
- fgTie("/velocities/uBody", this,
+ fgTie("/velocities/uBody-fps", this,
&FGInterface::get_uBody,
&FGInterface::set_uBody);
- fgTie("/velocities/vBody", this,
+ fgTie("/velocities/vBody-fps", this,
&FGInterface::get_vBody,
&FGInterface::set_vBody);
- fgTie("/velocities/wBody", this,
+ fgTie("/velocities/wBody-fps", this,
&FGInterface::get_wBody,
&FGInterface::set_wBody);
// Climb and slip (read-only)
- fgTie("/velocities/vertical-speed", this,
+ fgTie("/velocities/vertical-speed-fps", this,
&FGInterface::get_Climb_Rate); // read-only
- fgTie("/velocities/side-slip", this,
+ fgTie("/velocities/side-slip-rad", this,
&FGInterface::get_Beta); // read-only
}
fgUntie("/fdm/time/elapsed");
fgUntie("/fdm/time/remainder");
fgUntie("/fdm/time/multi_loop");
- fgUntie("/position/latitude");
- fgUntie("/position/longitude");
- fgUntie("/position/altitude");
+ fgUntie("/position/latitude-deg");
+ fgUntie("/position/longitude-deg");
+ fgUntie("/position/altitude-ft");
fgUntie("/position/heading");
fgUntie("/position/pitch");
fgUntie("/position/roll");
- fgUntie("/velocities/airspeed");
- fgUntie("/velocities/speed-north");
- fgUntie("/velocities/speed-east");
- fgUntie("/velocities/speed-down");
- fgUntie("/velocities/uBody");
- fgUntie("/velocities/vBody");
- fgUntie("/velocities/wBody");
- fgUntie("/velocities/vertical-speed");
- fgUntie("/velocities/side-slip");
+ fgUntie("/velocities/airspeed-kt");
+ fgUntie("/velocities/speed-north-fps");
+ fgUntie("/velocities/speed-east-fps");
+ fgUntie("/velocities/speed-down-fps");
+ fgUntie("/velocities/uBody-fps");
+ fgUntie("/velocities/vBody-fps");
+ fgUntie("/velocities/wBody-fps");
+ fgUntie("/velocities/vertical-speed-fps");
+ fgUntie("/velocities/side-slip-rad");
}
if ( airports.search( AptId, &a ) )
{
fgSetString("/sim/startup/airport-id", AptId.c_str() );
- // fgSetDouble("/position/altitude", -9999.0 );
+ // fgSetDouble("/position/altitude-ft", -9999.0 );
// fgSetPosFromAirportID( AptId );
fgSetPosFromAirportIDandHdg( AptId,
cur_fdm_state->get_Psi() *
BusyCursor(0);
if ( global_tile_mgr.init() ) {
// Load the local scenery data
- global_tile_mgr.update(fgGetDouble("/position/longitude"),
- fgGetDouble("/position/latitude"));
+ global_tile_mgr.update(fgGetDouble("/position/longitude-deg"),
+ fgGetDouble("/position/latitude-deg"));
} else {
SG_LOG( SG_GENERAL, SG_ALERT,
"Error in Tile Manager initialization!" );
"Attempting to set starting position from airport code " << id );
if ( fgFindAirportID( id, &a ) ) {
- fgSetDouble("/position/longitude", a.longitude );
- fgSetDouble("/position/latitude", a.latitude );
+ fgSetDouble("/position/longitude-deg", a.longitude );
+ fgSetDouble("/position/latitude-deg", a.latitude );
SG_LOG( SG_GENERAL, SG_INFO,
"Position for " << id << " is ("
<< a.longitude << ", "
lat2=olat;
lon2=olon;
}
- fgSetDouble("/position/longitude", lon2 );
- fgSetDouble("/position/latitude", lat2 );
- fgSetDouble("/orientation/heading", heading );
+ fgSetDouble("/position/longitude-deg", lon2 );
+ fgSetDouble("/position/latitude-deg", lat2 );
+ fgSetDouble("/orientation/heading-deg", heading );
SG_LOG( SG_GENERAL, SG_INFO,
"Position for " << id << " is ("
if ( global_tile_mgr.init() ) {
// Load the local scenery data
- global_tile_mgr.update( fgGetDouble("/position/longitude"),
- fgGetDouble("/position/latitude") );
+ global_tile_mgr.update( fgGetDouble("/position/longitude-deg"),
+ fgGetDouble("/position/latitude-deg") );
} else {
SG_LOG( SG_GENERAL, SG_ALERT, "Error in Tile Manager initialization!" );
exit(-1);
WeatherDatabase = FGLocalWeatherDatabase::theFGLocalWeatherDatabase;
- double init_vis = fgGetDouble("/environment/visibility");
+ double init_vis = fgGetDouble("/environment/visibility-m");
if ( init_vis > 0 ) {
WeatherDatabase->setWeatherVisibility( init_vis );
}
// Initialize the default (kludged) properties.
////////////////////////////////////////////////////////////////////
- fgInitProps ();
+ fgInitProps();
////////////////////////////////////////////////////////////////////
void fgReInitSubsystems( void )
{
SG_LOG( SG_GENERAL, SG_INFO,
- "/position/altitude = " << fgGetDouble("/position/altitude") );
+ "/position/altitude = " << fgGetDouble("/position/altitude-ft") );
bool freeze = globals->get_freeze();
if( !freeze )
if( global_tile_mgr.init() ) {
// Load the local scenery data
- global_tile_mgr.update( fgGetDouble("/position/longitude"),
- fgGetDouble("/position/latitude") );
+ global_tile_mgr.update( fgGetDouble("/position/longitude-deg"),
+ fgGetDouble("/position/latitude-deg") );
} else {
SG_LOG( SG_GENERAL, SG_ALERT, "Error in Tile Manager initialization!" );
exit(-1);
// Simulation
fgTie("/sim/freeze", getFreeze, setFreeze);
fgTie("/sim/aircraft-dir", getAircraftDir, setAircraftDir);
- fgTie("/sim/view/offset", getViewOffset, setViewOffset);
- fgTie("/sim/view/goal-offset", getGoalViewOffset, setGoalViewOffset);
+ fgTie("/sim/view/offset-deg", getViewOffset, setViewOffset);
+ fgTie("/sim/view/goal-offset-deg", getGoalViewOffset, setGoalViewOffset);
fgTie("/sim/time/gmt", getDateString, setDateString);
fgTie("/sim/time/gmt-string", getGMTString);
fgTie("/sim/rendering/textures", getTextures, setTextures);
// Orientation
- fgTie("/orientation/heading-magnetic", getHeadingMag);
+ fgTie("/orientation/heading-magnetic-deg", getHeadingMag);
// Engine
- fgTie("/engines/engine0/rpm", getRPM);
- fgTie("/engines/engine0/egt", getEGT);
- fgTie("/engines/engine0/cht", getCHT);
- fgTie("/engines/engine0/mp", getMP);
- fgTie("/engines/engine0/fuel-flow", getFuelFlow);
+ fgTie("/engines/engine[0]/rpm", getRPM);
+ fgTie("/engines/engine[0]/egt-degf", getEGT);
+ fgTie("/engines/engine[0]/cht-degf", getCHT);
+ fgTie("/engines/engine[0]/mp-osi", getMP);
+ fgTie("/engines/engine[0]/fuel-flow-gph", getFuelFlow);
//consumables
- fgTie("/consumables/fuel/tank1/level", getTank1Fuel, setTank1Fuel, false);
- fgTie("/consumables/fuel/tank2/level", getTank2Fuel, setTank2Fuel, false);
+ fgTie("/consumables/fuel/tank[0]/level-gal_us", getTank1Fuel, setTank1Fuel, false);
+ fgTie("/consumables/fuel/tank2/level-gal_us", getTank2Fuel, setTank2Fuel, false);
// Autopilot
fgTie("/autopilot/locks/altitude", getAPAltitudeLock, setAPAltitudeLock);
- fgTie("/autopilot/settings/altitude", getAPAltitude, setAPAltitude);
+ fgTie("/autopilot/settings/altitude-ft", getAPAltitude, setAPAltitude);
fgTie("/autopilot/locks/glide-slope", getAPGSLock, setAPGSLock);
fgTie("/autopilot/locks/terrain", getAPTerrainLock, setAPTerrainLock);
- fgTie("/autopilot/settings/climb-rate", getAPClimb, setAPClimb, false);
+ fgTie("/autopilot/settings/climb-rate-fpm", getAPClimb, setAPClimb, false);
fgTie("/autopilot/locks/heading", getAPHeadingLock, setAPHeadingLock);
- fgTie("/autopilot/settings/heading-bug", getAPHeadingBug, setAPHeadingBug,
+ fgTie("/autopilot/settings/heading-bug-deg", getAPHeadingBug, setAPHeadingBug,
false);
fgTie("/autopilot/locks/wing-leveler", getAPWingLeveler, setAPWingLeveler);
- fgTie("/autopilot/locks/nav1", getAPNAV1Lock, setAPNAV1Lock);
+ fgTie("/autopilot/locks/nav[0]", getAPNAV1Lock, setAPNAV1Lock);
fgTie("/autopilot/locks/auto-throttle",
getAPAutoThrottleLock, setAPAutoThrottleLock);
fgTie("/autopilot/control-overrides/rudder",
getAPThrottleControl, setAPThrottleControl);
// Environment
- fgTie("/environment/visibility", getVisibility, setVisibility);
- fgTie("/environment/wind-north", getWindNorth, setWindNorth);
- fgTie("/environment/wind-east", getWindEast, setWindEast);
- fgTie("/environment/wind-down", getWindDown, setWindDown);
- fgTie("/environment/magnetic-variation", getMagVar);
- fgTie("/environment/magnetic-dip", getMagDip);
+ fgTie("/environment/visibility-m", getVisibility, setVisibility);
+ fgTie("/environment/wind-north-fps", getWindNorth, setWindNorth);
+ fgTie("/environment/wind-east-fps", getWindEast, setWindEast);
+ fgTie("/environment/wind-down-fps", getWindDown, setWindDown);
+ fgTie("/environment/magnetic-variation-deg", getMagVar);
+ fgTie("/environment/magnetic-dip-deg", getMagDip);
// View
fgTie("/sim/field-of-view", getFOV, setFOV);
if (prop_selector != NULL) {
int propsel_mask = 0;
- double rpm = fgGetDouble("/engines/engine0/rpm");
+ double rpm = fgGetDouble("/engines/engine[0]/rpm");
for (int i = 0; i < acmodel_npropsettings; i++) {
if (rpm >= acmodel_proprpms[i][0] &&
rpm <= acmodel_proprpms[i][1]) {
if ( fgGetString("/sim/startup/airport-id").length() ) {
// fgSetPosFromAirportID( fgGetString("/sim/startup/airport-id") );
fgSetPosFromAirportIDandHdg( fgGetString("/sim/startup/airport-id"),
- fgGetDouble("/orientation/heading") );
+ fgGetDouble("/orientation/heading-deg") );
}
// Initialize time
SGPath zone( globals->get_fg_root() );
zone.append( "Timezone" );
- SGTime *t = new SGTime( fgGetDouble("/position/longitude") * SGD_DEGREES_TO_RADIANS,
- fgGetDouble("/position/latitude") * SGD_DEGREES_TO_RADIANS,
+ SGTime *t = new SGTime( fgGetDouble("/position/longitude-deg") * SGD_DEGREES_TO_RADIANS,
+ fgGetDouble("/position/latitude-deg") * SGD_DEGREES_TO_RADIANS,
zone.str() );
// Handle potential user specified time offsets
globals->set_fg_scenery("");
}
// Position (Globe, AZ)
- fgSetDouble("/position/longitude", -110.6642444);
- fgSetDouble("/position/latitude", 33.3528917);
- fgSetDouble("/position/altitude", -9999.0);
+ fgSetDouble("/position/longitude-deg", -110.6642444);
+ fgSetDouble("/position/latitude-deg", 33.3528917);
+ fgSetDouble("/position/altitude-ft", -9999.0);
// Orientation
- fgSetDouble("/orientation/heading", 270);
- fgSetDouble("/orientation/roll", 0);
- fgSetDouble("/orientation/pitch", 0.424);
+ fgSetDouble("/orientation/heading-deg", 270);
+ fgSetDouble("/orientation/roll-deg", 0);
+ fgSetDouble("/orientation/pitch-deg", 0.424);
// Velocities
fgSetString("/sim/startup/speed-set", "knots");
- fgSetDouble("/velocities/uBody", 0.0);
- fgSetDouble("/velocities/vBody", 0.0);
- fgSetDouble("/velocities/wBody", 0.0);
- fgSetDouble("/velocities/speed-north", 0.0);
- fgSetDouble("/velocities/speed-east", 0.0);
- fgSetDouble("/velocities/speed-down", 0.0);
- fgSetDouble("/velocities/airspeed", 0.0);
+ fgSetDouble("/velocities/uBody-fps", 0.0);
+ fgSetDouble("/velocities/vBody-fps", 0.0);
+ fgSetDouble("/velocities/wBody-fps", 0.0);
+ fgSetDouble("/velocities/speed-north-fps", 0.0);
+ fgSetDouble("/velocities/speed-east-fps", 0.0);
+ fgSetDouble("/velocities/speed-down-fps", 0.0);
+ fgSetDouble("/velocities/airspeed-kt", 0.0);
fgSetDouble("/velocities/mach", 0.0);
// Miscellaneous
// Rendering options
fgSetString("/sim/rendering/fog", "nicest");
fgSetBool("/environment/clouds/status", true);
- fgSetDouble("/environment/clouds/altitude", 5000);
+ fgSetDouble("/environment/clouds/altitude-ft", 5000);
fgSetBool("/sim/startup/fullscreen", false);
fgSetBool("/sim/rendering/shading", true);
fgSetBool("/sim/rendering/skyblend", true);
fgSetInt("/sim/startup/ysize", 600);
fgSetInt("/sim/rendering/bits-per-pixel", 16);
fgSetString("/sim/view-mode", "pilot");
- fgSetDouble("/sim/view/offset", 0);
- fgSetDouble("/environment/visibility", 20000);
+ fgSetDouble("/sim/view/offset-deg", 0);
+ fgSetDouble("/environment/visibility-m", 20000);
// HUD options
fgSetString("/sim/startup/units", "feet");
} else if ( arg.find( "--offset-azimuth=") == 0 ) {
fgSetDouble("/sim/startup/offset-azimuth", atof(arg.substr(17)));
} else if ( arg.find( "--lon=" ) == 0 ) {
- fgSetDouble("/position/longitude",
+ fgSetDouble("/position/longitude-deg",
parse_degree(arg.substr(6)));
fgSetString("/sim/startup/airport-id", "");
} else if ( arg.find( "--lat=" ) == 0 ) {
- fgSetDouble("/position/latitude",
+ fgSetDouble("/position/latitude-deg",
parse_degree(arg.substr(6)));
fgSetString("/sim/startup/airport-id", "");
} else if ( arg.find( "--altitude=" ) == 0 ) {
fgSetBool("/sim/startup/onground", false);
if ( fgGetString("/sim/startup/units") == "feet" )
- fgSetDouble("/position/altitude", atof(arg.substr(11)));
+ fgSetDouble("/position/altitude-ft", atof(arg.substr(11)));
else
- fgSetDouble("/position/altitude",
+ fgSetDouble("/position/altitude-ft",
atof(arg.substr(11)) * SG_METER_TO_FEET);
} else if ( arg.find( "--uBody=" ) == 0 ) {
fgSetString("/sim/startup/speed-set", "UVW");
if ( fgGetString("/sim/startup/units") == "feet" )
- fgSetDouble("/velocities/uBody", atof(arg.substr(8)));
+ fgSetDouble("/velocities/uBody-fps", atof(arg.substr(8)));
else
- fgSetDouble("/velocities/uBody",
+ fgSetDouble("/velocities/uBody-fps",
atof(arg.substr(8)) * SG_METER_TO_FEET);
} else if ( arg.find( "--vBody=" ) == 0 ) {
fgSetString("/sim/startup/speed-set", "UVW");
if ( fgGetString("/sim/startup/units") == "feet" )
- fgSetDouble("/velocities/vBody", atof(arg.substr(8)));
+ fgSetDouble("/velocities/vBody-fps", atof(arg.substr(8)));
else
- fgSetDouble("/velocities/vBody",
+ fgSetDouble("/velocities/vBody-fps",
atof(arg.substr(8)) * SG_METER_TO_FEET);
} else if ( arg.find( "--wBody=" ) == 0 ) {
fgSetString("/sim/startup/speed-set", "UVW");
if ( fgGetString("/sim/startup/units") == "feet" )
- fgSetDouble("/velocities/wBody", atof(arg.substr(8)));
+ fgSetDouble("/velocities/wBody-fps", atof(arg.substr(8)));
else
- fgSetDouble("/velocities/wBody",
+ fgSetDouble("/velocities/wBody-fps",
atof(arg.substr(8)) * SG_METER_TO_FEET);
} else if ( arg.find( "--vNorth=" ) == 0 ) {
fgSetString("/sim/startup/speed-set", "NED");
if ( fgGetString("/sim/startup/units") == "feet" )
- fgSetDouble("/velocities/speed-north", atof(arg.substr(9)));
+ fgSetDouble("/velocities/speed-north-fps", atof(arg.substr(9)));
else
- fgSetDouble("/velocities/speed-north",
+ fgSetDouble("/velocities/speed-north-fps",
atof(arg.substr(9)) * SG_METER_TO_FEET);
} else if ( arg.find( "--vEast=" ) == 0 ) {
fgSetString("/sim/startup/speed-set", "NED");
if ( fgGetString("/sim/startup/units") == "feet" )
- fgSetDouble("/velocities/speed-east", atof(arg.substr(8)));
+ fgSetDouble("/velocities/speed-east-fps", atof(arg.substr(8)));
else
- fgSetDouble("/velocities/speed-east",
- atof(arg.substr(8)) * SG_METER_TO_FEET);
+ fgSetDouble("/velocities/speed-east-fps",
+ atof(arg.substr(8)) * SG_METER_TO_FEET);
} else if ( arg.find( "--vDown=" ) == 0 ) {
fgSetString("/sim/startup/speed-set", "NED");
if ( fgGetString("/sim/startup/units") == "feet" )
- fgSetDouble("/velocities/speed-down", atof(arg.substr(8)));
+ fgSetDouble("/velocities/speed-down-fps", atof(arg.substr(8)));
else
- fgSetDouble("/velocities/speed-down",
+ fgSetDouble("/velocities/speed-down-fps",
atof(arg.substr(8)) * SG_METER_TO_FEET);
} else if ( arg.find( "--vc=" ) == 0) {
fgSetString("/sim/startup/speed-set", "knots");
- fgSetDouble("/velocities/airspeed", atof(arg.substr(5)));
+ fgSetDouble("/velocities/airspeed-kt", atof(arg.substr(5)));
} else if ( arg.find( "--mach=" ) == 0) {
fgSetString("/sim/startup/speed-set", "mach");
fgSetDouble("/velocities/mach", atof(arg.substr(7)));
} else if ( arg.find( "--heading=" ) == 0 ) {
- fgSetDouble("/orientation/heading", atof(arg.substr(10)));
+ fgSetDouble("/orientation/heading-deg", atof(arg.substr(10)));
} else if ( arg.find( "--roll=" ) == 0 ) {
- fgSetDouble("/orientation/roll", atof(arg.substr(7)));
+ fgSetDouble("/orientation/roll-deg", atof(arg.substr(7)));
} else if ( arg.find( "--pitch=" ) == 0 ) {
- fgSetDouble("/orientation/pitch", atof(arg.substr(8)));
+ fgSetDouble("/orientation/pitch-deg", atof(arg.substr(8)));
} else if ( arg.find( "--fg-root=" ) == 0 ) {
globals->set_fg_root(arg.substr( 10 ));
} else if ( arg.find( "--fg-scenery=" ) == 0 ) {
} else if ( arg.find( "--clouds-asl=" ) == 0 ) {
// FIXME: check units
if ( fgGetString("/sim/startup/units") == "feet" )
- fgSetDouble("/environment/clouds/altitude",
+ fgSetDouble("/environment/clouds/altitude-ft",
atof(arg.substr(13)) * SG_FEET_TO_METER);
else
- fgSetDouble("/environment/clouds/altitude",
+ fgSetDouble("/environment/clouds/altitude-ft",
atof(arg.substr(13)));
} else if ( arg.find( "--fov=" ) == 0 ) {
parse_fov( arg.substr(6) );
(FGViewerRPH *)globals->get_viewmgr()->get_view( 0 );
pilot_view->set_view_offset( default_view_offset );
pilot_view->set_goal_view_offset( default_view_offset );
- fgSetDouble("/sim/view/offset", default_view_offset);
+ fgSetDouble("/sim/view/offset-deg", default_view_offset);
// $$$ end - added VS Renganathan, 14 Oct 2K
} else if ( arg.find( "--visibility=" ) == 0 ) {
- fgSetDouble("/environment/visibility", atof(arg.substr(13)));
+ fgSetDouble("/environment/visibility-m", atof(arg.substr(13)));
} else if ( arg.find( "--visibility-miles=" ) == 0 ) {
double visibility = atof(arg.substr(19)) * 5280.0 * SG_FEET_TO_METER;
- fgSetDouble("/environment/visibility", visibility);
+ fgSetDouble("/environment/visibility-m", visibility);
} else if ( arg.find( "--wind=" ) == 0 ) {
string val = arg.substr(7);
unsigned int pos = val.find('@');
if (dir >= 360)
dir -= 360;
dir *= SGD_DEGREES_TO_RADIANS;
- fgSetDouble("/environment/wind-north",
+ fgSetDouble("/environment/wind-north-fps",
speed * cos(dir));
- fgSetDouble("/environment/wind-east",
+ fgSetDouble("/environment/wind-east-fps",
speed * sin(dir));
} else if ( arg.find( "--wp=" ) == 0 ) {
parse_wp( arg.substr( 5 ) );