]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGFDMExec.cpp
builddir -> srcdir so builds can be done outside the master source directory.
[flightgear.git] / src / FDM / JSBSim / FGFDMExec.cpp
index 2780a14fe829605e0d054ec33b17fd68728d70c7..d5324fdd0d34d5595ee479a41126ad86d02d479f 100644 (file)
@@ -39,7 +39,7 @@ INCLUDES
 *******************************************************************************/
 
 #ifdef FGFS
-#  include <Include/compiler.h>
+#  include <simgear/compiler.h>
 #  ifdef FG_HAVE_STD_INCLUDES
 #    include <iostream>
 #    include <ctime>
@@ -93,7 +93,7 @@ FGFDMExec::FGFDMExec(void)
   Rotation    = new FGRotation(this);
   Position    = new FGPosition(this);
   Auxiliary   = new FGAuxiliary(this);
-//  Output      = new FGOutput(this);
+  Output      = new FGOutput(this);
 
   State       = new FGState(this);
 
@@ -106,16 +106,20 @@ FGFDMExec::FGFDMExec(void)
   if (!Rotation->InitModel())   {cerr << "Rotation model init failed"; Error+=16;}
   if (!Position->InitModel())   {cerr << "Position model init failed"; Error+=32;}
   if (!Auxiliary->InitModel())  {cerr << "Auxiliary model init failed"; Error+=64;}
-//  if (!Output->InitModel())     {cerr << "Output model init failed"; Error+=128;}
+  if (!Output->InitModel())     {cerr << "Output model init failed"; Error+=128;}
 
-  Schedule(Atmosphere,  5);
+  // Schedule a model. The second arg (the integer) is the pass number. For
+  // instance, the atmosphere model gets executed every fifth pass it is called
+  // by the executive. Everything else here gets executed each pass.
+
+  Schedule(Atmosphere,  1);
   Schedule(FCS,         1);
   Schedule(Aircraft,    1);
   Schedule(Rotation,    1);
   Schedule(Translation, 1);
   Schedule(Position,    1);
   Schedule(Auxiliary,   1);
-//  Schedule(Output,      1);
+  Schedule(Output,     1);
 
   terminate = false;
   frozen = false;
@@ -172,3 +176,17 @@ bool FGFDMExec::Run(void)
   return true;
 }
 
+
+bool FGFDMExec::RunIC(FGInitialCondition *fgic)
+{
+  float save_dt = State->Getdt();
+
+  State->Setdt(0.0);
+  State->Initialize(fgic);
+  Run();
+  State->Setdt(save_dt);
+
+  return true;
+}
+  
+