]> git.mxchange.org Git - flightgear.git/blob - JSBsim/FGMain.cpp
New changes to address various feedback from initial release.
[flightgear.git] / JSBsim / FGMain.cpp
1 #include "FGFDMExec.h"
2 #include "FGRotation.h"
3 #include "FGAtmosphere.h"
4 #include "FGState.h"
5 #include "FGFCS.h"
6 #include "FGAircraft.h"
7 #include "FGTranslation.h"
8 #include "FGPosition.h"
9 #include "FGAuxiliary.h"
10 #include "FGOutput.h"
11
12 #include <iostream.h>
13 #include <time.h>
14
15 void main(int argc, char** argv)
16 {
17   struct timespec short_wait = {0,100000000};
18   struct timespec no_wait    = {0,100000000};
19
20   if (argc != 3) {
21     cout << endl
22          << "  You must enter the name of a registered aircraft and reset point:"
23          << endl << endl << "  FDM <aircraft name> <reset file>" << endl;
24     exit(0);
25   }
26
27   FDMExec = new FGFDMExec();
28
29   FDMExec->GetAircraft()->LoadAircraft(argv[1]);
30   FDMExec->GetState()->Reset(argv[2]);
31
32   while (FDMExec->GetState()->Getsim_time() <= 25.0)
33   {
34     FDMExec->Run();
35     nanosleep(&short_wait,&no_wait);
36   }
37
38   delete FDMExec;
39 }