namespace JSBSim {
-IDENT(IdSrc,"$Id: FGTrim.cpp,v 1.29 2015/12/13 08:19:57 bcoconni Exp $");
+IDENT(IdSrc,"$Id: FGTrim.cpp,v 1.30 2015/12/29 13:44:39 ehofman Exp $");
IDENT(IdHdr,ID_TRIM);
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Debug=0;DebugLevel=0;
fdmex=FDMExec;
+ fgic = *fdmex->GetIC();
total_its=0;
gamma_fallback=false;
mode=tt;
double aileron0 = FCS->GetDaCmd();
double rudder0 = FCS->GetDrCmd();
double PitchTrim0 = FCS->GetPitchTrimCmd();
- fgic = *fdmex->GetIC();
for(int i=0;i < fdmex->GetGroundReactions()->GetNumGearUnits();i++){
fdmex->GetGroundReactions()->GetGearUnit(i)->SetReport(false);
fgic.SetRRadpsIC(0.0);
if (mode == tGround) {
+ fdmex->Initialize(&fgic);
+ fdmex->Run();
trimOnGround();
double theta = fgic.GetThetaRadIC();
double phi = fgic.GetPhiRadIC();
void FGTrim::SetMode(TrimMode tt) {
ClearStates();
- fdmex->GetPropagate()->SetInitialState(&fgic);
mode=tt;
switch(tt) {
case tFull:
case tAltAGL:
control_min=0;
control_max=30;
- control_value=fdmex->GetPropagate()->GetDistanceAGL();
+ control_value=ic->GetAltitudeAGLFtIC();
solver_eps=tolerance/100;
break;
case tTheta:
- control_min=fdmex->GetPropagate()->GetEuler(eTht) - 5*degtorad;
- control_max=fdmex->GetPropagate()->GetEuler(eTht) + 5*degtorad;
+ control_min=ic->GetThetaRadIC() - 5*degtorad;
+ control_max=ic->GetThetaRadIC() + 5*degtorad;
state_convert=radtodeg;
break;
case tPhi:
- control_min=fdmex->GetPropagate()->GetEuler(ePhi) - 30*degtorad;
- control_max=fdmex->GetPropagate()->GetEuler(ePhi) + 30*degtorad;
+ control_min=ic->GetPhiRadIC() - 30*degtorad;
+ control_max=ic->GetPhiRadIC() + 30*degtorad;
state_convert=radtodeg;
control_convert=radtodeg;
break;
control_convert=radtodeg;
break;
case tHeading:
- control_min=fdmex->GetPropagate()->GetEuler(ePsi) - 30*degtorad;
- control_max=fdmex->GetPropagate()->GetEuler(ePsi) + 30*degtorad;
+ control_min=ic->GetPsiRadIC() - 30*degtorad;
+ control_max=ic->GetPsiRadIC() + 30*degtorad;
state_convert=radtodeg;
break;
}