Fixes:
* line 343: comparison between signed and unsigned integer expressions * line 441: 'lon', 'lat', 'slr' and 'alt' might be used uninitialized * line 565: enumeration value 'etUnknown' not handled in switch
This commit is contained in:
parent
35ed31972a
commit
1a1b11b96c
2 changed files with 26 additions and 14 deletions
src/FDM/JSBSim
|
@ -412,7 +412,7 @@ void FGFDMExec::ResetToInitialConditions(void)
|
||||||
FGModel* model_iterator;
|
FGModel* model_iterator;
|
||||||
|
|
||||||
model_iterator = FirstModel;
|
model_iterator = FirstModel;
|
||||||
if (model_iterator == 0L) return;
|
if (model_iterator == 0L || Constructing) return;
|
||||||
|
|
||||||
while (model_iterator != 0L) {
|
while (model_iterator != 0L) {
|
||||||
model_iterator->InitModel();
|
model_iterator->InitModel();
|
||||||
|
|
|
@ -145,6 +145,16 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
|
|
||||||
fdmex = new FGFDMExec( (FGPropertyManager*)globals->get_props() );
|
fdmex = new FGFDMExec( (FGPropertyManager*)globals->get_props() );
|
||||||
|
|
||||||
|
// begin ugly hack
|
||||||
|
// Untie the write-state-file property to avoid creating an initfile.xml
|
||||||
|
// file on each FlightGear reset.
|
||||||
|
fgGetNode("/fdm/jsbsim/simulation/write-state-file")->untie();
|
||||||
|
fgGetNode("/fdm/jsbsim/simulation")->removeChild("write-state-file", false);
|
||||||
|
// Prevent nuking of the state on JSBSim recreation after FlightGear reset.
|
||||||
|
fgGetNode("/fdm/jsbsim/simulation/reset")->untie();
|
||||||
|
fgGetNode("/fdm/jsbsim/simulation")->removeChild("reset", false);
|
||||||
|
// end ugly hack
|
||||||
|
|
||||||
// Register ground callback.
|
// Register ground callback.
|
||||||
fdmex->SetGroundCallback( new FGFSGroundCallback(this) );
|
fdmex->SetGroundCallback( new FGFSGroundCallback(this) );
|
||||||
|
|
||||||
|
@ -281,10 +291,6 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-y-in", 0),
|
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-y-in", 0),
|
||||||
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-z-in", -16));
|
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-z-in", -16));
|
||||||
|
|
||||||
// Untie the write-state-file property to avoid creating an initfile.xml
|
|
||||||
// file on each reset.
|
|
||||||
fgGetNode("/fdm/jsbsim/simulation/write-state-file")->untie();
|
|
||||||
|
|
||||||
crashed = false;
|
crashed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,7 +340,7 @@ void FGJSBsim::init()
|
||||||
<< ", " << fdmex->GetAtmosphere()->GetDensity() );
|
<< ", " << fdmex->GetAtmosphere()->GetDensity() );
|
||||||
|
|
||||||
if (fgGetBool("/sim/presets/running")) {
|
if (fgGetBool("/sim/presets/running")) {
|
||||||
for (int i=0; i < Propulsion->GetNumEngines(); i++) {
|
for (unsigned int i=0; i < Propulsion->GetNumEngines(); i++) {
|
||||||
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
||||||
node->setBoolValue("running", true);
|
node->setBoolValue("running", true);
|
||||||
Propulsion->GetEngine(i)->SetRunning(true);
|
Propulsion->GetEngine(i)->SetRunning(true);
|
||||||
|
@ -448,14 +454,18 @@ void FGJSBsim::update( double dt )
|
||||||
if (!cache_ok) {
|
if (!cache_ok) {
|
||||||
SG_LOG(SG_FLIGHT, SG_WARN,
|
SG_LOG(SG_FLIGHT, SG_WARN,
|
||||||
"FGInterface is being called without scenery below the aircraft!");
|
"FGInterface is being called without scenery below the aircraft!");
|
||||||
SG_LOG(SG_FLIGHT, SG_WARN,
|
|
||||||
"altitude = " << alt);
|
alt = fgic->GetAltitudeFtIC();
|
||||||
SG_LOG(SG_FLIGHT, SG_WARN,
|
SG_LOG(SG_FLIGHT, SG_WARN, "altitude = " << alt);
|
||||||
"sea level radius = " << slr);
|
|
||||||
SG_LOG(SG_FLIGHT, SG_WARN,
|
slr = fgic->GetSeaLevelRadiusFtIC();
|
||||||
"latitude = " << lat);
|
SG_LOG(SG_FLIGHT, SG_WARN, "sea level radius = " << slr);
|
||||||
SG_LOG(SG_FLIGHT, SG_WARN,
|
|
||||||
"longitude = " << lon);
|
lat = fgic->GetLatitudeDegIC() * SGD_DEGREES_TO_RADIANS;
|
||||||
|
SG_LOG(SG_FLIGHT, SG_WARN, "latitude = " << lat);
|
||||||
|
|
||||||
|
lon = fgic->GetLongitudeDegIC() * SGD_DEGREES_TO_RADIANS;
|
||||||
|
SG_LOG(SG_FLIGHT, SG_WARN, "longitude = " << lon);
|
||||||
//return;
|
//return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,6 +599,8 @@ bool FGJSBsim::copy_to_JSBsim()
|
||||||
eng->SetCondition( globals->get_controls()->get_condition(i) );
|
eng->SetCondition( globals->get_controls()->get_condition(i) );
|
||||||
break;
|
break;
|
||||||
} // end FGTurboProp code block
|
} // end FGTurboProp code block
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // FGEngine code block
|
{ // FGEngine code block
|
||||||
|
|
Loading…
Add table
Reference in a new issue