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 USEUNIT("FGLGear.cpp");
64 USEUNIT("FGfdmSocket.cpp");
65 //---------------------------------------------------------------------------
69 #include "FGFDMExec.h"
70 #include "FGRotation.h"
71 #include "FGAtmosphere.h"
74 #include "FGAircraft.h"
75 #include "FGTranslation.h"
76 #include "FGPosition.h"
77 #include "FGAuxiliary.h"
81 #include <Include/compiler.h>
83 # ifdef FG_HAVE_STD_INCLUDES
93 int main(int argc, char** argv)
99 << " You must enter the name of a registered aircraft and reset point:"
100 << endl << endl << " FDM <aircraft name> <reset file>" << endl;
104 FDMExec = new FGFDMExec();
106 FDMExec->GetAircraft()->LoadAircraft("aircraft", "engine", string(argv[1]));
107 FDMExec->GetState()->Reset("aircraft", string(argv[2]));
109 while (FDMExec->GetState()->Getsim_time() <= 25.0)
112 // Fake an elevator kick here after 5 seconds
115 if (FDMExec->GetState()->Getsim_time() > 5.0 &&
116 FDMExec->GetState()->Getsim_time() < 6.0)
118 FDMExec->GetFCS()->SetDe(0.05);
120 FDMExec->GetFCS()->SetDe(0.00);