1999-02-05 21:26:01 +00:00
|
|
|
#include "FGFDMExec.h"
|
1999-02-11 21:05:34 +00:00
|
|
|
#include "FGRotation.h"
|
|
|
|
#include "FGAtmosphere.h"
|
|
|
|
#include "FGState.h"
|
|
|
|
#include "FGFCS.h"
|
|
|
|
#include "FGAircraft.h"
|
|
|
|
#include "FGTranslation.h"
|
|
|
|
#include "FGPosition.h"
|
|
|
|
#include "FGAuxiliary.h"
|
|
|
|
#include "FGOutput.h"
|
1999-02-05 21:26:01 +00:00
|
|
|
|
1999-02-26 22:09:10 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <ctime>
|
1999-02-05 21:26:01 +00:00
|
|
|
|
|
|
|
void main(int argc, char** argv)
|
|
|
|
{
|
1999-02-26 22:09:10 +00:00
|
|
|
FGFDMExec* FDMExec;
|
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
struct timespec short_wait = {0,100000000};
|
|
|
|
struct timespec no_wait = {0,100000000};
|
|
|
|
|
|
|
|
if (argc != 3) {
|
|
|
|
cout << endl
|
|
|
|
<< " You must enter the name of a registered aircraft and reset point:"
|
|
|
|
<< endl << endl << " FDM <aircraft name> <reset file>" << endl;
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
FDMExec = new FGFDMExec();
|
|
|
|
|
1999-03-02 01:02:51 +00:00
|
|
|
FDMExec->GetAircraft()->LoadAircraft("aircraft", "engine", string(argv[1]));
|
|
|
|
FDMExec->GetState()->Reset("aircraft", string(argv[2]));
|
1999-02-05 21:26:01 +00:00
|
|
|
|
1999-02-11 21:05:34 +00:00
|
|
|
while (FDMExec->GetState()->Getsim_time() <= 25.0)
|
1999-02-05 21:26:01 +00:00
|
|
|
{
|
|
|
|
FDMExec->Run();
|
|
|
|
nanosleep(&short_wait,&no_wait);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete FDMExec;
|
|
|
|
}
|