From: david Date: Wed, 15 May 2002 12:06:33 +0000 (+0000) Subject: Comment out set_Static_pressure, set_Static_temperature, and X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cade7aad701ff1cc53a6e6598b83ed446885f243;p=flightgear.git Comment out set_Static_pressure, set_Static_temperature, and set_Density; since JSBSim doesn't override the get_* methods from FGInterface as well, the wrong values are always set anyway. Take the static temperature, static pressure, and density values from an external source if requested by the /environment/params/control-fdm-atmosphere property. This isn't working properly yet for JSBSim because of interactions with the trimming routine. --- diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index 76f2181f2..0cc28f7dd 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -87,8 +87,18 @@ FGJSBsim::FGJSBsim( double dt ) Aerodynamics = fdmex->GetAerodynamics(); GroundReactions = fdmex->GetGroundReactions(); - +#ifdef FG_WEATHERCM Atmosphere->UseInternal(); +#else + if (fgGetBool("/environment/params/control-fdm-atmosphere")) { + Atmosphere->UseExternal(); + Atmosphere->SetExTemperature(get_Static_temperature()); + Atmosphere->SetExPressure(get_Static_pressure()); + Atmosphere->SetExDensity(get_Density()); + } else { + Atmosphere->UseInternal(); + } +#endif fgic=new FGInitialCondition(fdmex); needTrim=true; @@ -697,31 +707,31 @@ void FGJSBsim::set_Gamma_vert_rad( double gamma) { needTrim=true; } -void FGJSBsim::set_Static_pressure(double p) { - SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Static_pressure: " << p ); +// void FGJSBsim::set_Static_pressure(double p) { +// SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Static_pressure: " << p ); - update_ic(); - Atmosphere->SetExPressure(p); - if(Atmosphere->External() == true) - needTrim=true; -} +// update_ic(); +// Atmosphere->SetExPressure(p); +// if(Atmosphere->External() == true) +// needTrim=true; +// } -void FGJSBsim::set_Static_temperature(double T) { - SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Static_temperature: " << T ); +// void FGJSBsim::set_Static_temperature(double T) { +// SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Static_temperature: " << T ); - Atmosphere->SetExTemperature(T); - if(Atmosphere->External() == true) - needTrim=true; -} +// Atmosphere->SetExTemperature(T); +// if(Atmosphere->External() == true) +// needTrim=true; +// } -void FGJSBsim::set_Density(double rho) { - SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Density: " << rho ); +// void FGJSBsim::set_Density(double rho) { +// SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Density: " << rho ); - Atmosphere->SetExDensity(rho); - if(Atmosphere->External() == true) - needTrim=true; -} +// Atmosphere->SetExDensity(rho); +// if(Atmosphere->External() == true) +// needTrim=true; +// } void FGJSBsim::set_Velocities_Local_Airmass (double wnorth, double weast, diff --git a/src/FDM/JSBSim/JSBSim.hxx b/src/FDM/JSBSim/JSBSim.hxx index e0e66b119..e727624ad 100644 --- a/src/FDM/JSBSim/JSBSim.hxx +++ b/src/FDM/JSBSim/JSBSim.hxx @@ -185,15 +185,15 @@ public: //@{ /** Sets the atmospheric static pressure @param p pressure in psf */ - void set_Static_pressure(double p); +// void set_Static_pressure(double p); /** Sets the atmospheric temperature @param T temperature in degrees rankine */ - void set_Static_temperature(double T); +// void set_Static_temperature(double T); /** Sets the atmospheric density. @param rho air density slugs/cubic foot */ - void set_Density(double rho); +// void set_Density(double rho); /** Sets the velocity of the local airmass for wind modeling. @param wnorth velocity north in fps