]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/FGInput.cpp
Andreas Gaeb: fix #222 (JSBSIm reset problems)
[flightgear.git] / src / FDM / JSBSim / models / FGInput.cpp
index 6ba43df4ec73eabe33a0bdcdf2ca8a52c49d6495..65ab24db22b1c338b0b3a2e8ee19bebbabf86645 100755 (executable)
@@ -39,7 +39,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGInput.h"
-#include "FGState.h"
+#include "FGAircraft.h"
 #include "FGFDMExec.h"
 
 #include "input_output/FGfdmSocket.h"
@@ -53,7 +53,7 @@ using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGInput.cpp,v 1.19 2010/02/25 05:21:36 jberndt Exp $";
 static const char *IdHdr = ID_INPUT;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -105,6 +105,8 @@ bool FGInput::Run(void)
                                     // return false if no error
   // This model DOES execute if "Exec->Holding"
 
+  RunPreFunctions();
+
   data = socket->Receive(); // get socket transmission if present
 
   if (data.size() > 0) {
@@ -189,8 +191,8 @@ bool FGInput::Run(void)
         ostringstream info;
         info << "JSBSim version: " << JSBSim_version << endl;
         info << "Config File version: " << needed_cfg_version << endl;
-        info << "Aircraft simulated: " << Aircraft->GetAircraftName() << endl;
-        info << "Simulation time: " << setw(8) << setprecision(3) << State->Getsim_time() << endl;
+//      info << "Aircraft simulated: " << Aircraft->GetAircraftName() << endl;
+        info << "Simulation time: " << setw(8) << setprecision(3) << FDMExec->GetSimTime() << endl;
         socket->Reply(info.str());
 
       } else if (command == "help") {                   // HELP
@@ -213,6 +215,8 @@ bool FGInput::Run(void)
     }
   }
 
+  RunPostFunctions();
+
   return false;
 }