]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/JSBSim.cpp
FG_HAVE_STD_INCLUDES -> SG_HAVE_STD_INCLUDES
[flightgear.git] / src / FDM / JSBSim / JSBSim.cpp
index a41a51e275680ca849508461c7f00686a9dc4069..3d2c84d6a01de8ff55658123e75efa66ed3e3d22 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Module:       JSBSim.cpp
  Author:       Jon S. Berndt
@@ -35,9 +35,9 @@ HISTORY
 --------------------------------------------------------------------------------
 08/17/99   JSB   Created
 
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #if __BCPLUSPLUS__  == 0x0540   // If compiling under Borland C++Builder
 #pragma hdrstop
@@ -87,7 +87,7 @@ USEUNIT("FGTurboShaft.cpp");
 USEUNIT("FGPropulsion.cpp");
 USEUNIT("FGGroundReactions.cpp");
 USEUNIT("FGAerodynamics.cpp");
-//---------------------------------------------------------------------------
+
 #pragma argsused
 #endif
 
@@ -101,12 +101,11 @@ USEUNIT("FGAerodynamics.cpp");
 #include "FGPosition.h"
 #include "FGAuxiliary.h"
 #include "FGOutput.h"
-#include "FGInitialCondition.h"
 
 #ifdef FGFS
 #include <simgear/compiler.h>
 #include STL_IOSTREAM
-#  ifdef FG_HAVE_STD_INCLUDES
+#  ifdef SG_HAVE_STD_INCLUDES
 #    include <ctime>
 #  else
 #    include <time.h>
@@ -116,8 +115,38 @@ USEUNIT("FGAerodynamics.cpp");
 #include <ctime>
 #endif
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+GLOBAL DATA
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 static const char *IdSrc = "$Header$";
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Standalone JSBSim main program
+    This is the wrapper program used to instantiate the JSBSim system and control
+    it. Use this program to build a version of JSBSim that can be run from the
+    command line. This program is also designed to be built using Borland C++
+    Builder, v4.0 or greater.
+    @author Jon S. Berndt
+    @version $Id$
+    @see -
+*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+IMPLEMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 int main(int argc, char** argv)
 {
   FGFDMExec* FDMExec;
@@ -132,38 +161,17 @@ int main(int argc, char** argv)
 
   FDMExec = new FGFDMExec();
 
-  result = FDMExec->LoadModel("/home/tony/FlightGear/Aircraft", 
-                                "/home/tony/FlightGear/Engine", 
-                                  string(argv[1]));
+  result = FDMExec->LoadModel("aircraft", "engine", string(argv[1]));
   
   if (!result) {
        cerr << "Aircraft file " << argv[1] << " was not found" << endl;
          exit(-1);
   }
   
-  if ( ! FDMExec->GetState()->Reset("/home/tony/FlightGear/Aircraft", 
-                                       string(argv[1]), string(argv[2])))
+  if ( ! FDMExec->GetState()->Reset("aircraft", string(argv[1]), string(argv[2])))
     FDMExec->GetState()->Initialize(2000,0,0,0,0,0,0.5,0.5,40000);
-  
-  FGInitialCondition *fgic= new FGInitialCondition(FDMExec);
-  fgic->SetUBodyFpsIC(170);
-  fgic->SetTrueHeadingDegIC(275);
-  FDMExec->RunIC(fgic);
-  cout << "FDMExec->GetTranslation()->GetVt(): " << FDMExec->GetTranslation()->GetVt() << endl;
-  cout << "FDMExec->GetPosition()->GetVn(): " << FDMExec->GetPosition()->GetVn() << endl;
-  cout << "FDMExec->GetPosition()->GetVe(): " << FDMExec->GetPosition()->GetVe() << endl;
-  cout << "FDMExec->GetAuxiliary()->GetVcalibratedKTS(): " << FDMExec->GetAuxiliary()->GetVcalibratedKTS() << endl; 
-  fgic->SetVnorthFpsIC(170);
-  cout << "fgic->GetUBodyFpsIC(): " << fgic->GetUBodyFpsIC() << endl;
-  cout << "fgic->GetVBodyFpsIC(): " << fgic->GetVBodyFpsIC() << endl;
-  cout << "fgic->GetWBodyFpsIC(): " << fgic->GetWBodyFpsIC() << endl;
-  FDMExec->RunIC(fgic);
-  cout << "FDMExec->GetTranslation()->GetVt(): " << FDMExec->GetTranslation()->GetVt() << endl;
-  cout << "FDMExec->GetPosition()->GetVn(): " << FDMExec->GetPosition()->GetVn() << endl;
-  cout << "FDMExec->GetPosition()->GetVe(): " << FDMExec->GetPosition()->GetVe() << endl;
-  cout << "FDMExec->GetAuxiliary()->GetVcalibratedKTS(): " << FDMExec->GetAuxiliary()->GetVcalibratedKTS() << endl; 
-  
-  /* float cmd = 0.0;
+
+  float cmd = 0.0;
 
   while (FDMExec->GetState()->Getsim_time() <= 10.0)
   {
@@ -172,15 +180,15 @@ int main(int argc, char** argv)
     if (FDMExec->GetState()->Getsim_time() >= 1.00 &&
         FDMExec->GetState()->Getsim_time() < 2.0)
     {
-      cmd = -(FDMExec->GetState()->Getsim_time() - 1.00)/2.0;
+      cmd = -(FDMExec->GetState()->Getsim_time() - 1.00)/4.0;
     } else if (FDMExec->GetState()->Getsim_time() >= 2.00 &&
         FDMExec->GetState()->Getsim_time() < 6.0)
     {
-      cmd = -1.00/2.0;
+      cmd = -1.00/4.0;
     } else if (FDMExec->GetState()->Getsim_time() >= 6.00 &&
         FDMExec->GetState()->Getsim_time() < 7.0)
     {
-      cmd = -(7.0 - FDMExec->GetState()->Getsim_time())/2.0;
+      cmd = -(7.0 - FDMExec->GetState()->Getsim_time())/4.0;
     } else {
       cmd = 0.00;
     }
@@ -188,7 +196,6 @@ int main(int argc, char** argv)
     
     FDMExec->Run();
   }
- */
 
   delete FDMExec;