]> git.mxchange.org Git - flightgear.git/commitdiff
Additional startup work and error checking.
authorcurt <curt>
Mon, 29 Oct 2001 18:38:21 +0000 (18:38 +0000)
committercurt <curt>
Mon, 29 Oct 2001 18:38:21 +0000 (18:38 +0000)
aclocal.m4
src/FDM/JSBSim.cxx

index 7d5836b91f4d1fbed719541171644fe7ba3a68b6..78a4037e5c412f8cbb48479f9e8cf5998f0aad3e 100644 (file)
@@ -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
index 5d22250675d57872849b29e5ea918300c46a90cf..ed26bd8e0bbd8aa8e606ea36fcf67bae70e6758c 100644 (file)
@@ -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;i<Neng;i++) {
         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/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 );