1
0
Fork 0

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.
This commit is contained in:
david 2002-05-15 12:06:33 +00:00
parent b112e72510
commit cade7aad70
2 changed files with 33 additions and 23 deletions

View file

@ -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,

View file

@ -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