#include <sys/stat.h>
#include <sys/types.h>
-
+#include <iostream>
#include <cmath>
#include "FGAircraft.h"
#include "FGPropagate.h"
#include "FGPropulsion.h"
#include "input_output/FGPropertyManager.h"
-#include <iostream>
using namespace std;
GLOBAL DATA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-static const char *IdSrc = "$Id: FGAircraft.cpp,v 1.26 2010/02/15 03:28:24 jberndt Exp $";
+static const char *IdSrc = "$Id: FGAircraft.cpp,v 1.30 2010/11/29 12:33:57 jberndt Exp $";
static const char *IdHdr = ID_AIRCRAFT;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
vForces.InitMatrix();
if (!HoldDown) {
- vForces += Aerodynamics->GetForces();
- vForces += Propulsion->GetForces();
- vForces += GroundReactions->GetForces();
- vForces += ExternalReactions->GetForces();
- vForces += BuoyantForces->GetForces();
+ vForces += FDMExec->GetAerodynamics()->GetForces();
+ vForces += FDMExec->GetPropulsion()->GetForces();
+ vForces += FDMExec->GetGroundReactions()->GetForces();
+ vForces += FDMExec->GetExternalReactions()->GetForces();
+ vForces += FDMExec->GetBuoyantForces()->GetForces();
} else {
- const FGMatrix33& mTl2b = Propagate->GetTl2b();
- vForces = mTl2b * FGColumnVector3(0,0,-MassBalance->GetWeight());
+ const FGMatrix33& mTl2b = FDMExec->GetPropagate()->GetTl2b();
+ vForces = mTl2b * FGColumnVector3(0,0,-FDMExec->GetMassBalance()->GetWeight());
}
vMoments.InitMatrix();
if (!HoldDown) {
- vMoments += Aerodynamics->GetMoments();
- vMoments += Propulsion->GetMoments();
- vMoments += GroundReactions->GetMoments();
- vMoments += ExternalReactions->GetMoments();
- vMoments += BuoyantForces->GetMoments();
+ vMoments += FDMExec->GetAerodynamics()->GetMoments();
+ vMoments += FDMExec->GetPropulsion()->GetMoments();
+ vMoments += FDMExec->GetGroundReactions()->GetMoments();
+ vMoments += FDMExec->GetExternalReactions()->GetMoments();
+ vMoments += FDMExec->GetBuoyantForces()->GetMoments();
}
- vBodyAccel = vForces/MassBalance->GetMass();
+ vBodyAccel = vForces/FDMExec->GetMassBalance()->GetMass();
- vNcg = vBodyAccel/Inertial->gravity();
+ vNcg = vBodyAccel/FDMExec->GetInertial()->SLgravity();
- vNwcg = Aerodynamics->GetTb2w() * vNcg;
- vNwcg(3) = -1*vNwcg(3) + 1;
+ vNwcg = FDMExec->GetAerodynamics()->GetTb2w() * vNcg;
+ vNwcg(3) = 1.0 - vNwcg(3);
RunPostFunctions();
double FGAircraft::GetNlf(void) const
{
- return -1*Aerodynamics->GetvFw(3)/MassBalance->GetWeight();
+ if (FDMExec->GetMassBalance()->GetWeight() != 0)
+ return (-FDMExec->GetAerodynamics()->GetvFw(3))/FDMExec->GetMassBalance()->GetWeight();
+ else
+ return 0.;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
}
- FGModel::PostLoad(el);
+ PostLoad(el, PropertyManager);
Debug(2);