#include "FGFDMExec.h"
#include "FGState.h"
#include "FGAtmosphere.h"
+#include "FGAerodynamics.h"
#include "FGFCS.h"
#include "FGAircraft.h"
#include "FGTranslation.h"
#include "FGConfigFile.h"
#include "FGPropertyManager.h"
+namespace JSBSim {
+
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_INITIALCONDITION;
if(vt < 0.01) return 0;
xlo=xhi=0;
- xmin=fdmex->GetAircraft()->GetAlphaCLMin();
- xmax=fdmex->GetAircraft()->GetAlphaCLMax();
+ xmin=fdmex->GetAerodynamics()->GetAlphaCLMin();
+ xmax=fdmex->GetAerodynamics()->GetAlphaCLMax();
sfunc=&FGInitialCondition::GammaEqOfAlpha;
if(findInterval(0,guess)){
if(solve(&alpha,0)){
//******************************************************************************
-bool FGInitialCondition::Load(string acpath, string acname, string rstfile)
+bool FGInitialCondition::Load(string rstfile, bool useStoredPath)
{
string resetDef;
string token="";
double temp;
-
-# ifndef macintosh
- resetDef = acpath + "/" + acname + "/" + rstfile + ".xml";
-# else
- resetDef = acpath + ";" + acname + ";" + rstfile + ".xml";
-# endif
-
+ # ifndef macintosh
+ string sep = "/";
+ # else
+ string sep = ";";
+ #endif
+
+ if( useStoredPath ) {
+ string acpath = fdmex->GetAircraftPath() + sep + fdmex->GetModelName();
+ resetDef = acpath + sep + rstfile + ".xml";
+ } else {
+ resetDef = rstfile;
+ }
+
FGConfigFile resetfile(resetDef);
if (!resetfile.IsOpen()) {
cerr << "Failed to open reset file: " << resetDef << endl;
resetfile >> token;
}
- fdmex->RunIC(this);
+ fdmex->RunIC();
return true;
}
}
}
}
-
+}