From 64e81d1960dbe5e8485869d290cfecefed2bedc3 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 4 Apr 2003 22:44:32 +0000 Subject: [PATCH] Make sure values get back to FGInterface, in case we're not trimming. This is especially important for setting multiple values like Euler angles. --- src/FDM/JSBSim/JSBSim.cxx | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index aa2e86e92..3679164ef 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -626,6 +626,9 @@ void FGJSBsim::set_Latitude(double lat) { static const SGPropertyNode *altitude = fgGetNode("/position/altitude-ft"); double alt; double sea_level_radius_meters, lat_geoc; + + // In case we're not trimming + FGInterface::set_Latitude(lat); if ( altitude->getDoubleValue() > -9990 ) { alt = altitude->getDoubleValue(); @@ -650,6 +653,10 @@ void FGJSBsim::set_Latitude(double lat) { void FGJSBsim::set_Longitude(double lon) { SG_LOG(SG_FLIGHT,SG_INFO,"FGJSBsim::set_Longitude: " << lon ); + + // In case we're not trimming + FGInterface::set_Longitude(lon); + update_ic(); fgic->SetLongitudeRadIC( lon ); _set_Runway_altitude( cur_fdm_state->get_Runway_altitude() ); @@ -665,6 +672,9 @@ void FGJSBsim::set_Altitude(double alt) { SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Altitude: " << alt ); SG_LOG(SG_FLIGHT,SG_INFO, " lat (deg) = " << latitude->getDoubleValue() ); + // In case we're not trimming + FGInterface::set_Altitude(alt); + update_ic(); sgGeodToGeoc( latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS, alt, &sea_level_radius_meters, &lat_geoc); @@ -681,7 +691,10 @@ void FGJSBsim::set_Altitude(double alt) { void FGJSBsim::set_V_calibrated_kts(double vc) { SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_V_calibrated_kts: " << vc ); - + + // In case we're not trimming + FGInterface::set_V_calibrated_kts(vc); + update_ic(); fgic->SetVcalibratedKtsIC(vc); needTrim=true; @@ -690,6 +703,9 @@ void FGJSBsim::set_V_calibrated_kts(double vc) { void FGJSBsim::set_Mach_number(double mach) { SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Mach_number: " << mach ); + // In case we're not trimming + FGInterface::set_Mach_number(mach); + update_ic(); fgic->SetMachIC(mach); needTrim=true; @@ -699,6 +715,9 @@ void FGJSBsim::set_Velocities_Local( double north, double east, double down ){ SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Local: " << north << ", " << east << ", " << down ); + // In case we're not trimming + FGInterface::set_Velocities_Local(north, east, down); + update_ic(); fgic->SetVnorthFpsIC(north); fgic->SetVeastFpsIC(east); @@ -710,6 +729,9 @@ void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){ SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Wind_Body: " << u << ", " << v << ", " << w ); + // In case we're not trimming + FGInterface::set_Velocities_Wind_Body(u, v, w); + update_ic(); fgic->SetUBodyFpsIC(u); fgic->SetVBodyFpsIC(v); @@ -722,6 +744,9 @@ void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) { SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Euler_Angles: " << phi << ", " << theta << ", " << psi ); + // In case we're not trimming + FGInterface::set_Euler_Angles(phi, theta, psi); + update_ic(); fgic->SetPitchAngleRadIC(theta); fgic->SetRollAngleRadIC(phi); @@ -733,6 +758,9 @@ void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) { void FGJSBsim::set_Climb_Rate( double roc) { SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Climb_Rate: " << roc ); + // In case we're not trimming + FGInterface::set_Climb_Rate(roc); + update_ic(); //since both climb rate and flight path angle are set in the FG //startup sequence, something is needed to keep one from cancelling -- 2.39.5