37 #ifndef FGFDMEXEC_HEADER_H 38 #define FGFDMEXEC_HEADER_H 47 #include "FGJSBBase.h" 48 #include "input_output/FGPropertyManager.h" 49 #include "models/FGPropagate.h" 50 #include "math/FGColumnVector3.h" 51 #include "models/FGOutput.h" 52 #include "simgear/misc/sg_path.hxx" 58 #define ID_FDMEXEC "$Id: FGFDMExec.h,v 1.106 2017/02/25 14:23:18 bcoconni Exp $" 71 class FGAccelerations;
74 class FGBuoyantForces;
75 class FGExternalReactions;
76 class FGGroundReactions;
207 void Run(
void) {exec->
Run();}
209 exec->
GetPropagate()->SetVState(source_prop->GetVState());
234 enum eModels { ePropagate=0,
250 eNumStandardModels };
288 bool LoadModel(
const SGPath& AircraftPath,
const SGPath& EnginePath,
289 const SGPath& SystemsPath,
const std::string& model,
290 bool addModelToPath =
true);
302 bool LoadModel(
const std::string& model,
bool addModelToPath =
true);
314 bool LoadScript(
const SGPath& Script,
double deltaT=0.0,
315 const SGPath& initfile=SGPath());
321 EnginePath = GetFullPath(path);
330 AircraftPath = GetFullPath(path);
338 SystemsPath = GetFullPath(path);
403 {
return instance->GetNode()->GetDouble(property); }
409 instance->GetNode()->SetDouble(property, value);
442 {
return Output->SetDirectivesFile(GetFullPath(fname)); }
454 bool SetOutputFileName(
const int n,
const std::string& fname) {
return Output->SetOutputName(n, fname); }
478 void Hold(
void) {holding =
true;}
518 void PrintPropertyCatalog(
void);
521 void PrintSimulationConfiguration(
void)
const;
523 std::vector<std::string>& GetPropertyCatalog(
void) {
return PropertyCatalog;}
525 void SetTrimStatus(
bool status){ trim_status = status; }
526 bool GetTrimStatus(
void)
const {
return trim_status; }
527 void SetTrimMode(
int mode){ ta_mode = mode; }
528 int GetTrimMode(
void)
const {
return ta_mode; }
530 std::string GetPropulsionTankReport();
559 void Setdt(
double delta_t) { dT = delta_t; }
607 unsigned short Terminate;
612 bool IncrementThenHolding;
613 int TimeStepsUntilHold;
618 std::string modelName;
620 SGPath FullAircraftPath;
623 std::string CFGVersion;
646 unsigned int ResetMode;
660 unsigned int* FDMctr;
662 std::vector <std::string> PropertyCatalog;
663 std::vector <childData*> ChildFDMList;
664 std::vector <FGModel*> Models;
670 int SRand(
void)
const {
return RandomSeed;}
671 void LoadInputs(
unsigned int idx);
672 void LoadPlanetConstants(
void);
673 void LoadModelConstants(
void);
675 bool DeAllocate(
void);
676 int GetDisperse(
void)
const {
return disperse;}
677 SGPath GetFullPath(
const SGPath& name) {
678 if (name.isRelative())
679 return RootDir/name.utf8Str();
684 void Debug(
int from);
Encapsulates an Aircraft and its systems.
static void SetGroundCallback(FGGroundCallback *gc)
Sets the ground callback pointer.
FGAccelerations * GetAccelerations(void)
Returns the FGAccelerations pointer.
void ForceOutput(int idx=0)
Forces the specified output object to print its items once.
FGInitialCondition * GetIC(void)
Returns a pointer to the FGInitialCondition object.
FGInertial * GetInertial(void)
Returns the FGInertial pointer.
Encapsulates the Buoyant forces calculations.
bool LoadScript(const SGPath &Script, double deltaT=0.0, const SGPath &initfile=SGPath())
Loads a script.
const std::string & GetModelName(void) const
Returns the model name.
FGTrim * GetTrim(void)
Returns a pointer to the FGTrim object.
FGOutput * GetOutput(void)
Returns the FGOutput pointer.
std::vector< std::string > EnumerateFDMs(void)
Returns a vector of strings representing the names of all loaded models (future)
void SuspendIntegration(void)
Suspends the simulation and sets the delta T to zero.
bool RunIC(void)
Initializes the sim from the initial condition object and executes each scheduled model without integ...
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
FGAuxiliary * GetAuxiliary(void)
Returns the FGAuxiliary pointer.
Encapsulates the aerodynamic calculations.
This class provides callback slots to get ground specific data.
void SetPropertyValue(const std::string &property, double value)
Sets a property value.
FGInput * GetInput(void)
Returns the FGInput pointer.
const SGPath & GetAircraftPath(void)
Retrieves the aircraft path.
double GetPropertyValue(const std::string &property)
Retrieves the value of a property.
void DoTrim(int mode)
Executes trimming in the selected mode.
void DisableOutput(void)
Disables data logging to all outputs.
void SetGroundCallback(FGGroundCallback *gc)
Sets the ground callback pointer.
void SetHoldDown(bool hd)
Sets the property forces/hold-down.
Models inertial forces (e.g.
void SetChild(bool ch)
Marks this instance of the Exec object as a "child" object.
void EnableOutput(void)
Enables data logging to all outputs.
std::string base_string
Name of the property.
void BuildPropertyCatalog(struct PropertyCatalogStructure *pcs)
Builds a catalog of properties.
bool SetOutputFileName(const int n, const std::string &fname)
Sets (or overrides) the output filename.
FGPropertyManager * GetPropertyManager(void)
Returns a pointer to the property manager object.
void SetRootDir(const SGPath &rootDir)
Sets the root directory where JSBSim starts looking for its system directories.
void Initialize(FGInitialCondition *FGIC)
Initializes the simulation with initial conditions.
void SetDebugLevel(int level)
Sets the debug level.
Models atmospheric disturbances: winds, gusts, turbulence, downbursts, etc.
void SetLoggingRate(double rate)
Sets the logging rate in Hz for all output objects (if any).
double Setsim_time(double cur_time)
Sets the current sim time.
void Setdt(double delta_t)
Sets the integration time step for the simulation executive.
FGExternalReactions * GetExternalReactions(void)
Returns the FGExternalReactions pointer.
FGBuoyantForces * GetBuoyantForces(void)
Returns the FGBuoyantForces pointer.
int GetDebugLevel(void) const
Retrieves the current debug level setting.
Models the EOM and integration/propagation of state.
FGWinds * GetWinds(void)
Returns the FGWinds pointer.
Propulsion management class.
childData * GetChildFDM(int i) const
Gets a particular child FDM.
void Hold(void)
Pauses execution by preventing time from incrementing.
FGAircraft * GetAircraft(void)
Returns the FGAircraft pointer.
Encapsulates the JSBSim scripting capability.
FGGroundReactions * GetGroundReactions(void)
Returns the FGGroundReactions pointer.
int GetFDMCount(void) const
Gets the number of child FDMs.
std::string GetOutputFileName(int n) const
Retrieves the current output filename.
const SGPath & GetRootDir(void) const
Retrieves the Root Directory.
void EnableIncrementThenHold(int Timesteps)
Turn on hold after increment.
FGGroundCallback * GetGroundCallback(void)
Get a pointer to the ground callback currently used.
bool SetOutputDirectives(const SGPath &fname)
Sets the output (logging) mechanism for this run.
FGPropertyNode_ptr node
The node for the property.
Models an empty, abstract base atmosphere class.
This class implements a 3 element column vector.
void ResumeIntegration(void)
Resumes the simulation by resetting delta T to the correct value.
The trimming routine for JSBSim.
bool Holding(void)
Returns true if the simulation is Holding (i.e. simulation time is not moving).
Initializes the simulation run.
FGFCS * GetFCS(void)
Returns the FGFCS pointer.
Encapsulates the Flight Control System (FCS) functionality.
bool SetSystemsPath(const SGPath &path)
Sets the path to the systems config file directories.
bool SetEnginePath(const SGPath &path)
Sets the path to the engine config file directories.
bool IntegrationSuspended(void) const
Returns the simulation suspension state.
std::string QueryPropertyCatalog(const std::string &check)
Retrieves property or properties matching the supplied string.
double GetSimTime(void) const
Returns the cumulative simulation time in seconds.
void Resume(void)
Resumes execution from a "Hold".
Manages ground reactions modeling.
Handles the calculation of accelerations.
Encapsulates various uncategorized scheduled functions.
FGFDMExec(FGPropertyManager *root=0, unsigned int *fdmctr=0)
Default constructor.
double GetDeltaT(void) const
Returns the simulation delta T.
FGAerodynamics * GetAerodynamics(void)
Returns the FGAerodynamics pointer.
FGPropulsion * GetPropulsion(void)
Returns the FGPropulsion pointer.
void CheckIncrementalHold(void)
Checks if required to hold afer increment.
bool Run(void)
This function executes each scheduled model in succession.
static FGGroundCallback * GetGroundCallback(void)
Get a pointer to the ground callback currently used.
FGScript * GetScript(void)
Retrieves the script object.
Encapsulates the JSBSim simulation executive.
unsigned int GetFrame(void) const
Retrieves the current frame count.
const SGPath & GetSystemsPath(void)
Retrieves the systems path.
Models weight, balance and moment of inertia information.
~FGFDMExec()
Default destructor.
bool LoadModel(const SGPath &AircraftPath, const SGPath &EnginePath, const SGPath &SystemsPath, const std::string &model, bool addModelToPath=true)
Loads an aircraft model.
void ResetToInitialConditions(int mode)
Resets the initial conditions object and prepares the simulation to run again.
const SGPath & GetEnginePath(void)
Retrieves the engine path.
bool GetHoldDown(void) const
Gets the value of the property forces/hold-down.
void Unbind(void)
Unbind all tied JSBSim properties.
Manages the external and/or arbitrary forces.
bool SetAircraftPath(const SGPath &path)
Sets the path to the aircraft config file directories.
Handles simulation output.
FGPropagate * GetPropagate(void)
Returns the FGPropagate pointer.
double IncrTime(void)
Increments the simulation time if not in Holding mode.
FGMassBalance * GetMassBalance(void)
Returns the FGAircraft pointer.