]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGFDMExec.cpp
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGFDMExec.cpp
index dac9eedacb1701d38a4963e597feea5c2c557ac1..2110fb0d9559006bbc2933875c7568e1de163b5d 100644 (file)
@@ -58,6 +58,7 @@ INCLUDES
 #include "FGState.h"
 #include "FGAtmosphere.h"
 #include "FGFCS.h"
+#include "FGGroundCallback.h"
 #include "FGPropulsion.h"
 #include "FGMassBalance.h"
 #include "FGGroundReactions.h"
@@ -120,6 +121,7 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root)
   Inertial        = 0;
   GroundReactions = 0;
   Aircraft        = 0;
+  GroundCallback  = 0;
   Propagate       = 0;
   Auxiliary       = 0;
   Output          = 0;
@@ -131,8 +133,12 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root)
   modelLoaded = false;
   IsSlave = false;
 
+  // Multiple FDM's are stopped for now.  We need to ensure that
+  // the "user" instance always gets the zeroeth instance number,
+  // because there may be instruments or scripts tied to properties
+  // in the jsbsim[0] node.
   IdFDM = FDMctr;
-  FDMctr++;
+  //FDMctr++;
 
   try {
     char* num = getenv("JSBSIM_DEBUG");
@@ -190,6 +196,7 @@ bool FGFDMExec::Allocate(void)
   Inertial        = new FGInertial(this);
   GroundReactions = new FGGroundReactions(this);
   Aircraft        = new FGAircraft(this);
+  GroundCallback  = new FGGroundCallback();
   Propagate       = new FGPropagate(this);
   Auxiliary       = new FGAuxiliary(this);
   Output          = new FGOutput(this);
@@ -280,6 +287,8 @@ bool FGFDMExec::DeAllocate(void)
   delete IC;
   delete Trim;
 
+  delete GroundCallback;
+
   FirstModel  = 0L;
   Error       = 0;
 
@@ -369,6 +378,14 @@ bool FGFDMExec::RunIC(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+void FGFDMExec::SetGroundCallback(FGGroundCallback* p) {
+  if (GroundCallback)
+    delete GroundCallback;
+  GroundCallback = p;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 vector <string> FGFDMExec::EnumerateFDMs(void)
 {
   vector <string> FDMList;
@@ -502,8 +519,10 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
     return false;
   }
 
-  if (Release == "ALPHA") {
+  if (Release == "ALPHA" && debug_lvl > 0) {
+#ifndef _MSC_VER
     system("banner ALPHA");
+#endif
     cout << endl << endl
          << highint << "This aircraft model is an " << fgred << Release
          << reset << highint << " release!!!" << endl << endl << reset
@@ -511,8 +530,10 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
          << " will not fly as expected." << endl << endl
          << fgred << highint << "Use this model for development purposes ONLY!!!"
          << normint << reset << endl << endl;
-  } else if (Release == "BETA") {
+  } else if (Release == "BETA" && debug_lvl > 0) {
+#ifndef _MSC_VER
     system("banner BETA");
+#endif
     cout << endl << endl
          << highint << "This aircraft model is a " << fgred << Release
          << reset << highint << " release!!!" << endl << endl << reset