X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2Fflight.cxx;h=1c16f7c4f3b56132d2c7e9adf1ce7ddcd26412ad;hb=bb785797b9dd171f21c2577e0ba1a9c84e107583;hp=5c454769dc71a3bcf6fdc2b9b7a66f3a7eb970d3;hpb=72a95d570c7e99dce9ea41c64777f6996ad05dfe;p=flightgear.git diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index 5c454769d..1c16f7c4f 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -1,4 +1,4 @@ -// flight.c -- a general interface to the various flight models +// flight.cxx -- a general interface to the various flight models // // Written by Curtis Olson, started May 1997. // @@ -270,14 +270,17 @@ FGInterface::bind () &FGInterface::get_Latitude_deg, &FGInterface::set_Latitude_deg, false); + fgSetArchivable("/position/latitude-deg"); fgTie("/position/longitude-deg", this, &FGInterface::get_Longitude_deg, &FGInterface::set_Longitude_deg, false); + fgSetArchivable("/position/longitude-deg"); fgTie("/position/altitude-ft", this, &FGInterface::get_Altitude, &FGInterface::set_Altitude, false); + fgSetArchivable("/position/altitude-ft"); fgTie("/position/altitude-agl-ft", this, &FGInterface::get_Altitude_AGL); // read-only @@ -285,39 +288,64 @@ FGInterface::bind () fgTie("/orientation/roll-deg", this, &FGInterface::get_Phi_deg, &FGInterface::set_Phi_deg); + fgSetArchivable("/orientation/roll-deg"); fgTie("/orientation/pitch-deg", this, &FGInterface::get_Theta_deg, &FGInterface::set_Theta_deg); + fgSetArchivable("/orientation/pitch-deg"); fgTie("/orientation/heading-deg", this, &FGInterface::get_Psi_deg, &FGInterface::set_Psi_deg); + fgSetArchivable("/orientation/heading-deg"); // Calibrated airspeed fgTie("/velocities/airspeed-kt", this, &FGInterface::get_V_calibrated_kts, - &FGInterface::set_V_calibrated_kts); + &FGInterface::set_V_calibrated_kts, + false); // Local velocities +// fgTie("/velocities/speed-north-fps", this, +// &FGInterface::get_V_north, +// &FGInterface::set_V_north); +// fgSetArchivable("/velocities/speed-north-fps"); +// fgTie("/velocities/speed-east-fps", this, +// &FGInterface::get_V_east, +// &FGInterface::set_V_east); +// fgSetArchivable("/velocities/speed-east-fps"); +// fgTie("/velocities/speed-down-fps", this, +// &FGInterface::get_V_down, +// &FGInterface::set_V_down); +// fgSetArchivable("/velocities/speed-down-fps"); + // FIXME: Temporarily read-only, until the + // incompatibilities between JSBSim and + // LaRCSim are fixed (LaRCSim adds the + // earth's rotation to the east velocity). fgTie("/velocities/speed-north-fps", this, - &FGInterface::get_V_north, - &FGInterface::set_V_north); + &FGInterface::get_V_north); fgTie("/velocities/speed-east-fps", this, - &FGInterface::get_V_east, - &FGInterface::set_V_east); + &FGInterface::get_V_east); fgTie("/velocities/speed-down-fps", this, - &FGInterface::get_V_down, - &FGInterface::set_V_down); + &FGInterface::get_V_down); // Relative wind + // FIXME: temporarily archivable, until + // the NED problem is fixed. fgTie("/velocities/uBody-fps", this, &FGInterface::get_uBody, - &FGInterface::set_uBody); + &FGInterface::set_uBody, + false); + fgSetArchivable("/velocities/uBody-fps"); fgTie("/velocities/vBody-fps", this, &FGInterface::get_vBody, - &FGInterface::set_vBody); + &FGInterface::set_vBody, + false); + fgSetArchivable("/velocities/vBody-fps"); fgTie("/velocities/wBody-fps", this, &FGInterface::get_wBody, - &FGInterface::set_wBody); + &FGInterface::set_wBody, + false); + fgSetArchivable("/velocities/wBody-fps"); // Climb and slip (read-only) fgTie("/velocities/vertical-speed-fps", this, @@ -377,6 +405,8 @@ bool FGInterface::update( int multi_loop ) { void FGInterface::_updatePosition( double lat_geoc, double lon, double alt ) { double lat_geod, tmp_alt, sl_radius1, sl_radius2, tmp_lat_geoc; + // cout << "starting sea level rad = " << get_Sea_level_radius() << endl; + sgGeocToGeod( lat_geoc, ( get_Sea_level_radius() + alt ) * SG_FEET_TO_METER, &lat_geod, &tmp_alt, &sl_radius1 ); sgGeodToGeoc( lat_geod, alt * SG_FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );