From 5f4f82dbe71dc8feec24e98de09ca5cd66b55eda Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 29 Oct 2001 18:38:21 +0000 Subject: [PATCH] Additional startup work and error checking. --- aclocal.m4 | 2 +- src/FDM/JSBSim.cxx | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 7d5836b91..78a4037e5 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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 This file is free software; the Free Software Foundation diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index 5d2225067..ed26bd8e0 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -95,7 +95,6 @@ FGJSBsim::FGJSBsim( double dt ) engine_path.str(), fgGetString("/sim/aircraft") ); - if (result) { SG_LOG( SG_FLIGHT, SG_INFO, " loaded aircraft."); } else { @@ -104,13 +103,26 @@ FGJSBsim::FGJSBsim( double dt ) 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(); - SG_LOG(SG_FLIGHT,SG_INFO, "Neng: " << Neng ); - + SG_LOG( SG_FLIGHT, SG_INFO, "num engines = " << Neng ); for(int i=0;iGetAircraft()->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/throttle", FCS->GetThrottleCmd(0)); fgSetDouble("/fdm/trim/aileron", FCS->GetDaCmd()); @@ -149,8 +161,8 @@ void FGJSBsim::init() { FGInterface::init(); fdmex->GetState()->Initialize(fgic); - // fdmex->RunIC(fgic); //loop JSBSim once w/o integrating - fdmex->Run(); //loop JSBSim once + fdmex->RunIC(fgic); //loop JSBSim once w/o integrating + // fdmex->Run(); //loop JSBSim once copy_from_JSBsim(); //update the bus SG_LOG( SG_FLIGHT, SG_INFO, " Initialized JSBSim with:" ); @@ -213,7 +225,7 @@ bool FGJSBsim::update( int multiloop ) { trimmed->setBoolValue(false); if ( needTrim && startup_trim->getBoolValue() ) { - + cout << "num gear units = " << fdmex->GetAircraft()->GetNumGearUnits() << endl; //fgic->SetSeaLevelRadiusFtIC( get_Sea_level_radius() ); //fgic->SetTerrainAltitudeFtIC( scenery.cur_elev * SG_METER_TO_FEET ); -- 2.39.5