1 /*******************************************************************************
6 Purpose: Standalone version of JSBSim.
9 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
11 This program is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free Software
13 Foundation; either version 2 of the License, or (at your option) any later
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23 Place - Suite 330, Boston, MA 02111-1307, USA.
25 Further information about the GNU General Public License can also be found on
26 the world wide web at http://www.gnu.org.
28 FUNCTIONAL DESCRIPTION
29 --------------------------------------------------------------------------------
31 This class Handles calling JSBSim standalone. It is set up for compilation under
32 Borland C+Builder or other compiler.
35 --------------------------------------------------------------------------------
38 ********************************************************************************
40 *******************************************************************************/
42 #if __BCPLUSPLUS__ >= 0x0540 // If compiling under Borland C++Builder
43 //---------------------------------------------------------------------------
46 USEUNIT("FGAircraft.cpp");
47 USEUNIT("FGAtmosphere.cpp");
48 USEUNIT("FGAuxiliary.cpp");
49 USEUNIT("FGCoefficient.cpp");
50 USEUNIT("FGEngine.cpp");
52 USEUNIT("FGFDMExec.cpp");
53 USEUNIT("FGInitialCondition.cpp");
54 USEUNIT("FGModel.cpp");
55 USEUNIT("FGOutput.cpp");
56 USEUNIT("FGPosition.cpp");
57 USEUNIT("FGRotation.cpp");
58 USEUNIT("FGState.cpp");
59 USEUNIT("FGTank.cpp");
60 USEUNIT("FGTranslation.cpp");
61 USEUNIT("FGUtility.cpp");
63 //---------------------------------------------------------------------------
67 #include "FGFDMExec.h"
68 #include "FGRotation.h"
69 #include "FGAtmosphere.h"
72 #include "FGAircraft.h"
73 #include "FGTranslation.h"
74 #include "FGPosition.h"
75 #include "FGAuxiliary.h"
79 #include <Include/compiler.h>
81 # ifdef FG_HAVE_STD_INCLUDES
91 int main(int argc, char** argv)
97 << " You must enter the name of a registered aircraft and reset point:"
98 << endl << endl << " FDM <aircraft name> <reset file>" << endl;
102 FDMExec = new FGFDMExec();
104 FDMExec->GetAircraft()->LoadAircraft("aircraft", "engine", string(argv[1]));
105 FDMExec->GetState()->Reset("aircraft", string(argv[2]));
107 while (FDMExec->GetState()->Getsim_time() <= 25.0)
110 // Fake an elevator kick here after 5 seconds
113 if (FDMExec->GetState()->Getsim_time() > 5.0 &&
114 FDMExec->GetState()->Getsim_time() < 6.0)
116 FDMExec->GetFCS()->SetDe(0.05);