#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;
}
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-// The bitmasked value choices are as follows:
-// unset: In this case (the default) JSBSim would only print
-// out the normally expected messages, essentially echoing
-// the config files as they are read. If the environment
-// variable is not set, debug_lvl is set to 1 internally
-// 0: This requests JSBSim not to output any messages
-// whatsoever.
-// 1: This value explicity requests the normal JSBSim
-// startup messages
-// 2: This value asks for a message to be printed out when
-// a class is instantiated
-// 4: When this value is set, a message is displayed when a
-// FGModel object executes its Run() method
-// 8: When this value is set, various runtime state variables
-// are printed out periodically
-// 16: When set various parameters are sanity checked and
-// a message is printed out when they go out of bounds
-
-void FGInitialCondition::Debug(int from)
-{
- if (debug_lvl <= 0) return;
-
- if (debug_lvl & 1) { // Standard console startup message output
- }
- if (debug_lvl & 2 ) { // Instantiation/Destruction notification
- if (from == 0) cout << "Instantiated: FGInitialCondition" << endl;
- if (from == 1) cout << "Destroyed: FGInitialCondition" << endl;
- }
- if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
- }
- if (debug_lvl & 8 ) { // Runtime state variables
- }
- if (debug_lvl & 16) { // Sanity checking
- }
- if (debug_lvl & 64) {
- if (from == 0) { // Constructor
- cout << IdSrc << endl;
- cout << IdHdr << endl;
- }
- }
-}
+//******************************************************************************
void FGInitialCondition::bind(void){
PropertyManager->Tie("ic/vc-kts", this,
true);
}
+//******************************************************************************
+
void FGInitialCondition::unbind(void){
PropertyManager->Untie("ic/vc-kts");
PropertyManager->Untie("ic/ve-kts");
PropertyManager->Untie("ic/lat-gc-rad");
PropertyManager->Untie("ic/long-gc-rad");
}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+// The bitmasked value choices are as follows:
+// unset: In this case (the default) JSBSim would only print
+// out the normally expected messages, essentially echoing
+// the config files as they are read. If the environment
+// variable is not set, debug_lvl is set to 1 internally
+// 0: This requests JSBSim not to output any messages
+// whatsoever.
+// 1: This value explicity requests the normal JSBSim
+// startup messages
+// 2: This value asks for a message to be printed out when
+// a class is instantiated
+// 4: When this value is set, a message is displayed when a
+// FGModel object executes its Run() method
+// 8: When this value is set, various runtime state variables
+// are printed out periodically
+// 16: When set various parameters are sanity checked and
+// a message is printed out when they go out of bounds
+
+void FGInitialCondition::Debug(int from)
+{
+ if (debug_lvl <= 0) return;
+
+ if (debug_lvl & 1) { // Standard console startup message output
+ }
+ if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+ if (from == 0) cout << "Instantiated: FGInitialCondition" << endl;
+ if (from == 1) cout << "Destroyed: FGInitialCondition" << endl;
+ }
+ if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
+ }
+ if (debug_lvl & 8 ) { // Runtime state variables
+ }
+ if (debug_lvl & 16) { // Sanity checking
+ }
+ if (debug_lvl & 64) {
+ if (from == 0) { // Constructor
+ cout << IdSrc << endl;
+ cout << IdHdr << endl;
+ }
+ }
+}
+}