37#ifndef FGFDMEXEC_HEADER_H
38#define FGFDMEXEC_HEADER_H
203 void Run(
void) {exec->
Run();}
275 bool LoadModel(
const SGPath& AircraftPath,
const SGPath& EnginePath,
276 const SGPath& SystemsPath,
const std::string& model,
277 bool addModelToPath =
true);
289 bool LoadModel(
const std::string& model,
bool addModelToPath =
true);
302 bool LoadScript(
const SGPath& Script,
double deltaT=0.0,
303 const SGPath& initfile=SGPath());
312 EnginePath = GetFullPath(path);
324 AircraftPath = GetFullPath(path);
335 SystemsPath = GetFullPath(path);
346 OutputPath = GetFullPath(path);
407 {
return instance->GetNode()->GetDouble(property); }
413 instance->GetNode()->SetDouble(property, value);
446 {
return Output->SetDirectivesFile(GetFullPath(fname)); }
458 bool SetOutputFileName(
const int n,
const std::string& fname) {
return Output->SetOutputName(n, fname); }
482 void Hold(
void) {holding =
true;}
564 void Setdt(
double delta_t) { dT = delta_t; }
612 return TemplateFunctions.count(
name) ? TemplateFunctions[
name] :
nullptr;
620 {
return RandomEngine; }
626 unsigned short Terminate;
631 bool IncrementThenHolding;
632 int TimeStepsUntilHold;
636 std::string modelName;
638 SGPath FullAircraftPath;
642 std::string CFGVersion;
665 unsigned int ResetMode;
679 std::shared_ptr<std::default_random_engine> RandomEngine;
683 unsigned int* FDMctr;
685 std::vector <std::string> PropertyCatalog;
686 std::vector <childData*> ChildFDMList;
687 std::vector <FGModel*> Models;
688 std::map<std::string, FGTemplateFunc_ptr> TemplateFunctions;
694 int SRand(
void)
const {
return RandomSeed;}
695 void LoadInputs(
unsigned int idx);
696 void LoadPlanetConstants(
void);
697 void LoadModelConstants(
void);
699 bool DeAllocate(
void);
700 void InitializeModels(
void);
701 int GetDisperse(
void)
const {
return disperse;}
702 SGPath GetFullPath(
const SGPath&
name) {
703 if (
name.isRelative())
704 return RootDir/
name.utf8Str();
709 void Debug(
int from);
BaseException(const std::string &msg)
Encapsulates the aerodynamic calculations.
Encapsulates an Aircraft and its systems.
Encapsulates various uncategorized scheduled functions.
Encapsulates the Buoyant forces calculations.
This class implements a 3 element column vector.
Manages the external and/or arbitrary forces and moments.
bool GetTrimStatus(void) const
FGInitialCondition * GetIC(void)
Returns a pointer to the FGInitialCondition object.
void Unbind(void)
Unbind all tied JSBSim properties.
void EnableIncrementThenHold(int Timesteps)
Turn on hold after increment.
void ForceOutput(int idx=0)
Forces the specified output object to print its items once.
double IncrTime(void)
Increments the simulation time if not in Holding mode.
void Setdt(double delta_t)
Sets the integration time step for the simulation executive.
bool RunIC(void)
Initializes the sim from the initial condition object and executes each scheduled model without integ...
FGTrim * GetTrim(void)
Returns a pointer to the FGTrim object.
const SGPath & GetAircraftPath(void)
Retrieves the aircraft path.
int GetDebugLevel(void) const
Retrieves the current debug level setting.
const std::string & GetModelName(void) const
Returns the model name.
FGAerodynamics * GetAerodynamics(void)
Returns the FGAerodynamics pointer.
FGPropagate * GetPropagate(void)
Returns the FGPropagate pointer.
void ResumeIntegration(void)
Resumes the simulation by resetting delta T to the correct value.
void SetLoggingRate(double rate)
Sets the logging rate in Hz for all output objects (if any).
void AddTemplateFunc(const std::string &name, Element *el)
void PrintSimulationConfiguration(void) const
const SGPath & GetEnginePath(void)
Retrieves the engine path.
double GetDeltaT(void) const
Returns the simulation delta T.
static const int DONT_EXECUTE_RUN_IC
FGPropulsion * GetPropulsion(void)
Returns the FGPropulsion pointer.
childData * GetChildFDM(int i) const
Gets a particular child FDM.
FGFCS * GetFCS(void)
Returns the FGFCS pointer.
bool SetOutputPath(const SGPath &path)
Set the directory where the output files will be written.
void CheckIncrementalHold(void)
Checks if required to hold afer increment.
void BuildPropertyCatalog(struct PropertyCatalogStructure *pcs)
Builds a catalog of properties.
void DisableOutput(void)
Disables data logging to all outputs.
FGExternalReactions * GetExternalReactions(void)
Returns the FGExternalReactions pointer.
bool SetOutputFileName(const int n, const std::string &fname)
Sets (or overrides) the output filename.
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
int GetFDMCount(void) const
Gets the number of child FDMs.
void Initialize(FGInitialCondition *FGIC)
Initializes the simulation with initial conditions.
std::vector< std::string > EnumerateFDMs(void)
Returns a vector of strings representing the names of all loaded models (future)
bool Holding(void)
Returns true if the simulation is Holding (i.e. simulation time is not moving).
bool LoadModel(const std::string &model, bool addModelToPath=true)
Loads an aircraft model.
const SGPath & GetRootDir(void) const
Retrieve the Root Directory.
FGAccelerations * GetAccelerations(void)
Returns the FGAccelerations pointer.
double GetSimTime(void) const
Returns the cumulative simulation time in seconds.
const std::shared_ptr< std::default_random_engine > & GetRandomEngine(void) const
bool IntegrationSuspended(void) const
Returns the simulation suspension state.
FGFDMExec(FGPropertyManager *root=0, unsigned int *fdmctr=0)
Default constructor.
double GetPropertyValue(const std::string &property)
Retrieves the value of a property.
FGPropertyManager * GetPropertyManager(void)
Returns a pointer to the property manager object.
double Setsim_time(double cur_time)
Sets the current sim time.
void SetHoldDown(bool hd)
Sets the property forces/hold-down.
FGMassBalance * GetMassBalance(void)
Returns the FGAircraft pointer.
bool GetHoldDown(void) const
Gets the value of the property forces/hold-down.
bool SetAircraftPath(const SGPath &path)
Set the path to the aircraft config file directories.
FGAircraft * GetAircraft(void)
Returns the FGAircraft pointer.
std::string GetPropulsionTankReport()
static const int START_NEW_OUTPUT
Mode flags for ResetToInitialConditions.
FGGroundReactions * GetGroundReactions(void)
Returns the FGGroundReactions pointer.
void SetDebugLevel(int level)
Sets the debug level.
void SetRootDir(const SGPath &rootDir)
Set the root directory that is used to obtain absolute paths from relative paths.
bool LoadModel(const SGPath &AircraftPath, const SGPath &EnginePath, const SGPath &SystemsPath, const std::string &model, bool addModelToPath=true)
Loads an aircraft model.
unsigned int GetFrame(void) const
Retrieves the current frame count.
void SetPropertyValue(const std::string &property, double value)
Sets a property value.
bool Run(void)
This function executes each scheduled model in succession.
void PrintPropertyCatalog(void)
void SuspendIntegration(void)
Suspends the simulation and sets the delta T to zero.
FGOutput * GetOutput(void)
Returns the FGOutput pointer.
FGScript * GetScript(void)
Retrieves the script object.
bool LoadScript(const SGPath &Script, double deltaT=0.0, const SGPath &initfile=SGPath())
Load a script.
FGWinds * GetWinds(void)
Returns the FGWinds pointer.
void SetTrimMode(int mode)
void SetChild(bool ch)
Marks this instance of the Exec object as a "child" object.
FGInertial * GetInertial(void)
Returns the FGInertial pointer.
bool SetEnginePath(const SGPath &path)
Set the path to the engine config file directories.
FGAuxiliary * GetAuxiliary(void)
Returns the FGAuxiliary pointer.
std::vector< std::string > & GetPropertyCatalog(void)
FGTemplateFunc * GetTemplateFunc(const std::string &name)
std::string QueryPropertyCatalog(const std::string &check)
Retrieves property or properties matching the supplied string.
FGBuoyantForces * GetBuoyantForces(void)
Returns the FGBuoyantForces pointer.
void DoTrim(int mode)
Executes trimming in the selected mode.
void SetTrimStatus(bool status)
void EnableOutput(void)
Enables data logging to all outputs.
int GetTrimMode(void) const
FGInput * GetInput(void)
Returns the FGInput pointer.
bool SetSystemsPath(const SGPath &path)
Set the path to the systems config file directories.
std::string GetOutputFileName(int n) const
Retrieves the current output filename.
const SGPath & GetSystemsPath(void)
Retrieves the systems path.
const SGPath & GetOutputPath(void)
Retrieves the path to the output files.
void Hold(void)
Pauses execution by preventing time from incrementing.
void ResetToInitialConditions(int mode)
Resets the initial conditions object and prepares the simulation to run again.
~FGFDMExec()
Default destructor.
void Resume(void)
Resumes execution from a "Hold".
FGAtmosphere * GetAtmosphere(void)
bool SetOutputDirectives(const SGPath &fname)
Sets the output (logging) mechanism for this run.
Manages ground reactions modeling.
Models inertial forces (e.g.
FGJSBBase()
Constructor for FGJSBBase.
Models weight, balance and moment of inertia information.
Handles simulation output.
Models the EOM and integration/propagation of state.
void SetVState(const VehicleState &vstate)
const VehicleState & GetVState(void) const
Propulsion management class.
Encapsulates the JSBSim scripting capability.
The trimming routine for JSBSim.
Models atmospheric disturbances: winds, gusts, turbulence, downbursts, etc.
TrimFailureException(const std::string &msg)
SGSharedPtr< FGPropertyNode > FGPropertyNode_ptr
std::string base_string
Name of the property.
FGPropertyNode_ptr node
The node for the property.