USEUNIT("filtersjb\FGGradient.cpp");
USEUNIT("filtersjb\FGSummer.cpp");
USEUNIT("filtersjb\FGDeadBand.cpp");
+USEUNIT("filtersjb\FGFlaps.cpp");
+USEFILE("JSBSim.cxx");
+USEUNIT("FGForce.cpp");
+USEUNIT("FGInertial.cpp");
+USEUNIT("FGNozzle.cpp");
+USEUNIT("FGPropeller.cpp");
+USEUNIT("FGRotor.cpp");
+USEUNIT("FGThruster.cpp");
+USEUNIT("FGMassBalance.cpp");
+USEUNIT("FGRocket.cpp");
+USEUNIT("FGTurboJet.cpp");
+USEUNIT("FGPiston.cpp");
+USEUNIT("FGTurboShaft.cpp");
+USEUNIT("FGPropulsion.cpp");
+USEUNIT("FGGroundReactions.cpp");
+USEUNIT("FGAerodynamics.cpp");
//---------------------------------------------------------------------------
#pragma argsused
#endif
#include <ctime>
#endif
+static const char *IdSrc = "$Header$";
+
int main(int argc, char** argv)
{
FGFDMExec* FDMExec;
+ bool result = false;
if (argc != 3) {
cout << endl
FDMExec = new FGFDMExec();
- FDMExec->GetAircraft()->LoadAircraft("aircraft", "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("aircraft", string(argv[1]), string(argv[2])))
FDMExec->GetState()->Initialize(2000,0,0,0,0,0,0.5,0.5,40000);
float cmd = 0.0;
- while (FDMExec->GetState()->Getsim_time() <= 5.0)
+ while (FDMExec->GetState()->Getsim_time() <= 10.0)
{
// Fake an elevator ramp here after 1 second, hold for one second, ramp down
-
+
if (FDMExec->GetState()->Getsim_time() >= 1.00 &&
FDMExec->GetState()->Getsim_time() < 2.0)
{
- cmd = FDMExec->GetState()->Getsim_time() - 1.00;
+ cmd = -(FDMExec->GetState()->Getsim_time() - 1.00)/2.0;
} else if (FDMExec->GetState()->Getsim_time() >= 2.00 &&
- FDMExec->GetState()->Getsim_time() < 3.0)
+ FDMExec->GetState()->Getsim_time() < 6.0)
{
- cmd = 1.00;
- } else if (FDMExec->GetState()->Getsim_time() >= 3.00 &&
- FDMExec->GetState()->Getsim_time() < 4.0)
+ cmd = -1.00/2.0;
+ } else if (FDMExec->GetState()->Getsim_time() >= 6.00 &&
+ FDMExec->GetState()->Getsim_time() < 7.0)
{
- cmd = 4.0 - FDMExec->GetState()->Getsim_time();
+ cmd = -(7.0 - FDMExec->GetState()->Getsim_time())/2.0;
} else {
cmd = 0.00;
}
FDMExec->GetFCS()->SetDeCmd(cmd); // input between -1 and 1
-
+
FDMExec->Run();
}
return 0;
}
+