Additional startup work and error checking.
This commit is contained in:
parent
c74c2f224f
commit
5f4f82dbe7
2 changed files with 19 additions and 7 deletions
2
aclocal.m4
vendored
2
aclocal.m4
vendored
|
@ -1,4 +1,4 @@
|
||||||
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
|
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||||
|
|
||||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
|
|
|
@ -95,7 +95,6 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
engine_path.str(),
|
engine_path.str(),
|
||||||
fgGetString("/sim/aircraft") );
|
fgGetString("/sim/aircraft") );
|
||||||
|
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
SG_LOG( SG_FLIGHT, SG_INFO, " loaded aircraft.");
|
SG_LOG( SG_FLIGHT, SG_INFO, " loaded aircraft.");
|
||||||
} else {
|
} else {
|
||||||
|
@ -104,13 +103,26 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
throw(-1);
|
throw(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SG_LOG( SG_FLIGHT, SG_INFO, "" );
|
||||||
|
SG_LOG( SG_FLIGHT, SG_INFO, "" );
|
||||||
|
SG_LOG( SG_FLIGHT, SG_INFO, "After loading aircraft definition file ..." );
|
||||||
|
|
||||||
int Neng = Propulsion->GetNumEngines();
|
int Neng = Propulsion->GetNumEngines();
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "Neng: " << Neng );
|
SG_LOG( SG_FLIGHT, SG_INFO, "num engines = " << Neng );
|
||||||
|
|
||||||
for(int i=0;i<Neng;i++) {
|
for(int i=0;i<Neng;i++) {
|
||||||
add_engine( FGEngInterface() );
|
add_engine( FGEngInterface() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( fdmex->GetAircraft()->GetNumGearUnits() <= 0 ) {
|
||||||
|
SG_LOG( SG_FLIGHT, SG_ALERT, "num gear units = "
|
||||||
|
<< fdmex->GetAircraft()->GetNumGearUnits() );
|
||||||
|
SG_LOG( SG_FLIGHT, SG_ALERT, "This is a very bad thing because with 0 gear units, the ground trimming");
|
||||||
|
SG_LOG( SG_FLIGHT, SG_ALERT, "routine (coming up later in the code) will core dump.");
|
||||||
|
SG_LOG( SG_FLIGHT, SG_ALERT, "Halting the sim now, and hoping a solution will present itself soon!");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fgSetDouble("/fdm/trim/pitch-trim", FCS->GetPitchTrimCmd());
|
fgSetDouble("/fdm/trim/pitch-trim", FCS->GetPitchTrimCmd());
|
||||||
fgSetDouble("/fdm/trim/throttle", FCS->GetThrottleCmd(0));
|
fgSetDouble("/fdm/trim/throttle", FCS->GetThrottleCmd(0));
|
||||||
fgSetDouble("/fdm/trim/aileron", FCS->GetDaCmd());
|
fgSetDouble("/fdm/trim/aileron", FCS->GetDaCmd());
|
||||||
|
@ -149,8 +161,8 @@ void FGJSBsim::init() {
|
||||||
FGInterface::init();
|
FGInterface::init();
|
||||||
|
|
||||||
fdmex->GetState()->Initialize(fgic);
|
fdmex->GetState()->Initialize(fgic);
|
||||||
// fdmex->RunIC(fgic); //loop JSBSim once w/o integrating
|
fdmex->RunIC(fgic); //loop JSBSim once w/o integrating
|
||||||
fdmex->Run(); //loop JSBSim once
|
// fdmex->Run(); //loop JSBSim once
|
||||||
copy_from_JSBsim(); //update the bus
|
copy_from_JSBsim(); //update the bus
|
||||||
|
|
||||||
SG_LOG( SG_FLIGHT, SG_INFO, " Initialized JSBSim with:" );
|
SG_LOG( SG_FLIGHT, SG_INFO, " Initialized JSBSim with:" );
|
||||||
|
@ -213,7 +225,7 @@ bool FGJSBsim::update( int multiloop ) {
|
||||||
trimmed->setBoolValue(false);
|
trimmed->setBoolValue(false);
|
||||||
|
|
||||||
if ( needTrim && startup_trim->getBoolValue() ) {
|
if ( needTrim && startup_trim->getBoolValue() ) {
|
||||||
|
cout << "num gear units = " << fdmex->GetAircraft()->GetNumGearUnits() << endl;
|
||||||
//fgic->SetSeaLevelRadiusFtIC( get_Sea_level_radius() );
|
//fgic->SetSeaLevelRadiusFtIC( get_Sea_level_radius() );
|
||||||
//fgic->SetTerrainAltitudeFtIC( scenery.cur_elev * SG_METER_TO_FEET );
|
//fgic->SetTerrainAltitudeFtIC( scenery.cur_elev * SG_METER_TO_FEET );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue