#include "FGFDMExec.h"
#include "FGAtmosphere.h"
#include "FGFCS.h"
+#include "FGPropulsion.h"
+#include "FGMassBalance.h"
+#include "FGAerodynamics.h"
+#include "FGInertial.h"
#include "FGAircraft.h"
#include "FGTranslation.h"
#include "FGRotation.h"
#include "FGAuxiliary.h"
#include "FGOutput.h"
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_MODEL;
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+GLOBAL DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+extern short debug_lvl;
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
{
FDMExec = fdmex;
NextModel = 0L;
-
- State = 0;
- Atmosphere = 0;
- FCS = 0;
- Aircraft = 0;
- Translation = 0;
- Rotation = 0;
- Position = 0;
- Auxiliary = 0;
- Output = 0;
+
+ State = 0;
+ Atmosphere = 0;
+ FCS = 0;
+ Propulsion = 0;
+ MassBalance = 0;
+ Aerodynamics = 0;
+ Inertial = 0;
+ Aircraft = 0;
+ Translation = 0;
+ Rotation = 0;
+ Position = 0;
+ Auxiliary = 0;
+ Output = 0;
exe_ctr = 1;
+
+ if (debug_lvl & 2) cout << " FGModel Base Class" << endl;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FGModel::~FGModel()
{
+ if (debug_lvl & 2) cout << "Destroyed: FGModel" << endl;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bool FGModel::InitModel(void)
{
- State = FDMExec->GetState();
- Atmosphere = FDMExec->GetAtmosphere();
- FCS = FDMExec->GetFCS();
- Aircraft = FDMExec->GetAircraft();
- Translation = FDMExec->GetTranslation();
- Rotation = FDMExec->GetRotation();
- Position = FDMExec->GetPosition();
- Auxiliary = FDMExec->GetAuxiliary();
- Output = FDMExec->GetOutput();
+ State = FDMExec->GetState();
+ Atmosphere = FDMExec->GetAtmosphere();
+ FCS = FDMExec->GetFCS();
+ Propulsion = FDMExec->GetPropulsion();
+ MassBalance = FDMExec->GetMassBalance();
+ Aerodynamics = FDMExec->GetAerodynamics();
+ Inertial = FDMExec->GetInertial();
+ Aircraft = FDMExec->GetAircraft();
+ Translation = FDMExec->GetTranslation();
+ Rotation = FDMExec->GetRotation();
+ Position = FDMExec->GetPosition();
+ Auxiliary = FDMExec->GetAuxiliary();
+ Output = FDMExec->GetOutput();
if (!State ||
!Atmosphere ||
!FCS ||
+ !Propulsion ||
+ !MassBalance ||
+ !Aerodynamics ||
+ !Inertial ||
!Aircraft ||
!Translation ||
!Rotation ||
else return(true);
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bool FGModel::Run()
{
+ if (debug_lvl & 4) cout << "Entering Run() for model " << Name << endl;
+
if (exe_ctr == 1) {
if (exe_ctr++ >= rate) exe_ctr = 1;
return false;
}
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGModel::Debug(void)
+{
+ //TODO: Add your source code here
+}