FlightGear next
JSBSim::FGFDMExec Class Reference

#include <FGFDMExec.h>

Inherits JSBSim::FGJSBBase.

Classes

struct  PropertyCatalogStructure
 

Public Types

enum  eModels {
  ePropagate =0 , eInput , eInertial , eAtmosphere ,
  eWinds , eSystems , eMassBalance , eAuxiliary ,
  ePropulsion , eAerodynamics , eGroundReactions , eExternalReactions ,
  eBuoyantForces , eAircraft , eAccelerations , eOutput ,
  eNumStandardModels
}
 
- Public Types inherited from JSBSim::FGJSBBase
enum  { eL = 1 , eM , eN }
 Moments L, M, N. More...
 
enum  { eP = 1 , eQ , eR }
 Rates P, Q, R. More...
 
enum  { eU = 1 , eV , eW }
 Velocities U, V, W. More...
 
enum  { eX = 1 , eY , eZ }
 Positions X, Y, Z. More...
 
enum  { ePhi = 1 , eTht , ePsi }
 Euler angles Phi, Theta, Psi. More...
 
enum  { eDrag = 1 , eSide , eLift }
 Stability axis forces, Drag, Side force, Lift. More...
 
enum  { eRoll = 1 , ePitch , eYaw }
 Local frame orientation Roll, Pitch, Yaw. More...
 
enum  { eNorth = 1 , eEast , eDown }
 Local frame position North, East, Down. More...
 
enum  { eLat = 1 , eLong , eRad }
 Locations Radius, Latitude, Longitude. More...
 
enum  {
  inNone = 0 , inDegrees , inRadians , inMeters ,
  inFeet
}
 Conversion specifiers. More...
 

Public Member Functions

 FGFDMExec (FGPropertyManager *root=0, unsigned int *fdmctr=0)
 Default constructor.
 
 ~FGFDMExec ()
 Default destructor.
 
void Unbind (void)
 Unbind all tied JSBSim properties.
 
bool Run (void)
 This function executes each scheduled model in succession.
 
bool RunIC (void)
 Initializes the sim from the initial condition object and executes each scheduled model without integrating i.e.
 
bool LoadModel (const SGPath &AircraftPath, const SGPath &EnginePath, const SGPath &SystemsPath, const std::string &model, bool addModelToPath=true)
 Loads an aircraft model.
 
bool LoadModel (const std::string &model, bool addModelToPath=true)
 Loads an aircraft model.
 
bool LoadScript (const SGPath &Script, double deltaT=0.0, const SGPath &initfile=SGPath())
 Load a script.
 
bool SetEnginePath (const SGPath &path)
 Set the path to the engine config file directories.
 
bool SetAircraftPath (const SGPath &path)
 Set the path to the aircraft config file directories.
 
bool SetSystemsPath (const SGPath &path)
 Set the path to the systems config file directories.
 
bool SetOutputPath (const SGPath &path)
 Set the directory where the output files will be written.
 
const SGPath & GetEnginePath (void)
 Retrieves the engine path.
 
const SGPath & GetAircraftPath (void)
 Retrieves the aircraft path.
 
const SGPath & GetSystemsPath (void)
 Retrieves the systems path.
 
const SGPath & GetFullAircraftPath (void)
 Retrieves the full aircraft path name.
 
const SGPath & GetOutputPath (void)
 Retrieves the path to the output files.
 
double GetPropertyValue (const std::string &property)
 Retrieves the value of a property.
 
void SetPropertyValue (const std::string &property, double value)
 Sets a property value.
 
const std::string & GetModelName (void) const
 Returns the model name.
 
FGPropertyManagerGetPropertyManager (void)
 Returns a pointer to the property manager object.
 
std::vector< std::string > EnumerateFDMs (void)
 Returns a vector of strings representing the names of all loaded models (future)
 
int GetFDMCount (void) const
 Gets the number of child FDMs.
 
childData * GetChildFDM (int i) const
 Gets a particular child FDM.
 
void SetChild (bool ch)
 Marks this instance of the Exec object as a "child" object.
 
bool SetOutputDirectives (const SGPath &fname)
 Sets the output (logging) mechanism for this run.
 
void ForceOutput (int idx=0)
 Forces the specified output object to print its items once.
 
void SetLoggingRate (double rate)
 Sets the logging rate in Hz for all output objects (if any).
 
bool SetOutputFileName (const int n, const std::string &fname)
 Sets (or overrides) the output filename.
 
std::string GetOutputFileName (int n) const
 Retrieves the current output filename.
 
void DoTrim (int mode)
 Executes trimming in the selected mode.
 
void DisableOutput (void)
 Disables data logging to all outputs.
 
void EnableOutput (void)
 Enables data logging to all outputs.
 
void Hold (void)
 Pauses execution by preventing time from incrementing.
 
void EnableIncrementThenHold (int Timesteps)
 Turn on hold after increment.
 
void CheckIncrementalHold (void)
 Checks if required to hold afer increment.
 
void Resume (void)
 Resumes execution from a "Hold".
 
bool Holding (void)
 Returns true if the simulation is Holding (i.e. simulation time is not moving).
 
void ResetToInitialConditions (int mode)
 Resets the initial conditions object and prepares the simulation to run again.
 
void SetDebugLevel (int level)
 Sets the debug level.
 
void BuildPropertyCatalog (struct PropertyCatalogStructure *pcs)
 Builds a catalog of properties.
 
std::string QueryPropertyCatalog (const std::string &check)
 Retrieves property or properties matching the supplied string.
 
void PrintPropertyCatalog (void)
 
void PrintSimulationConfiguration (void) const
 
std::vector< std::string > & GetPropertyCatalog (void)
 
void SetTrimStatus (bool status)
 
bool GetTrimStatus (void) const
 
void SetTrimMode (int mode)
 
int GetTrimMode (void) const
 
std::string GetPropulsionTankReport ()
 
double GetSimTime (void) const
 Returns the cumulative simulation time in seconds.
 
double GetDeltaT (void) const
 Returns the simulation delta T.
 
void SuspendIntegration (void)
 Suspends the simulation and sets the delta T to zero.
 
void ResumeIntegration (void)
 Resumes the simulation by resetting delta T to the correct value.
 
bool IntegrationSuspended (void) const
 Returns the simulation suspension state.
 
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.
 
void SetRootDir (const SGPath &rootDir)
 Set the root directory that is used to obtain absolute paths from relative paths.
 
const SGPath & GetRootDir (void) const
 Retrieve the Root Directory.
 
double IncrTime (void)
 Increments the simulation time if not in Holding mode.
 
unsigned int GetFrame (void) const
 Retrieves the current frame count.
 
int GetDebugLevel (void) const
 Retrieves the current debug level setting.
 
void Initialize (FGInitialCondition *FGIC)
 Initializes the simulation with initial conditions.
 
void SetHoldDown (bool hd)
 Sets the property forces/hold-down.
 
bool GetHoldDown (void) const
 Gets the value of the property forces/hold-down.
 
FGTemplateFuncGetTemplateFunc (const std::string &name)
 
void AddTemplateFunc (const std::string &name, Element *el)
 
const std::shared_ptr< std::default_random_engine > & GetRandomEngine (void) const
 
Top-level executive State and Model retrieval mechanism
FGAtmosphereGetAtmosphere (void)
 
FGAccelerationsGetAccelerations (void)
 Returns the FGAccelerations pointer.
 
FGWindsGetWinds (void)
 Returns the FGWinds pointer.
 
FGFCSGetFCS (void)
 Returns the FGFCS pointer.
 
FGPropulsionGetPropulsion (void)
 Returns the FGPropulsion pointer.
 
FGMassBalanceGetMassBalance (void)
 Returns the FGAircraft pointer.
 
FGAerodynamicsGetAerodynamics (void)
 Returns the FGAerodynamics pointer.
 
FGInertialGetInertial (void)
 Returns the FGInertial pointer.
 
FGGroundReactionsGetGroundReactions (void)
 Returns the FGGroundReactions pointer.
 
FGExternalReactionsGetExternalReactions (void)
 Returns the FGExternalReactions pointer.
 
FGBuoyantForcesGetBuoyantForces (void)
 Returns the FGBuoyantForces pointer.
 
FGAircraftGetAircraft (void)
 Returns the FGAircraft pointer.
 
FGPropagateGetPropagate (void)
 Returns the FGPropagate pointer.
 
FGAuxiliaryGetAuxiliary (void)
 Returns the FGAuxiliary pointer.
 
FGInputGetInput (void)
 Returns the FGInput pointer.
 
FGOutputGetOutput (void)
 Returns the FGOutput pointer.
 
FGScriptGetScript (void)
 Retrieves the script object.
 
FGInitialConditionGetIC (void)
 Returns a pointer to the FGInitialCondition object.
 
FGTrimGetTrim (void)
 Returns a pointer to the FGTrim object.
 
- Public Member Functions inherited from JSBSim::FGJSBBase
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
void PutMessage (const Message &msg)
 Places a Message structure on the Message queue.
 
void PutMessage (const std::string &text)
 Creates a message with the given text and places it on the queue.
 
void PutMessage (const std::string &text, bool bVal)
 Creates a message with the given text and boolean value and places it on the queue.
 
void PutMessage (const std::string &text, int iVal)
 Creates a message with the given text and integer value and places it on the queue.
 
void PutMessage (const std::string &text, double dVal)
 Creates a message with the given text and double value and places it on the queue.
 
int SomeMessages (void) const
 Reads the message on the queue (but does not delete it).
 
void ProcessMessage (void)
 Reads the message on the queue and removes it from the queue.
 
MessageProcessNextMessage (void)
 Reads the next message on the queue and removes it from the queue.
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 

Static Public Attributes

static const int START_NEW_OUTPUT = 0x1
 Mode flags for ResetToInitialConditions.
 
static const int DONT_EXECUTE_RUN_IC = 0x2
 
- Static Public Attributes inherited from JSBSim::FGJSBBase
static char highint [5] = {27, '[', '1', 'm', '\0' }
 highlights text
 
static char halfint [5] = {27, '[', '2', 'm', '\0' }
 low intensity text
 
static char normint [6] = {27, '[', '2', '2', 'm', '\0' }
 normal intensity text
 
static char reset [5] = {27, '[', '0', 'm', '\0' }
 resets text properties
 
static char underon [5] = {27, '[', '4', 'm', '\0' }
 underlines text
 
static char underoff [6] = {27, '[', '2', '4', 'm', '\0' }
 underline off
 
static char fgblue [6] = {27, '[', '3', '4', 'm', '\0' }
 blue text
 
static char fgcyan [6] = {27, '[', '3', '6', 'm', '\0' }
 cyan text
 
static char fgred [6] = {27, '[', '3', '1', 'm', '\0' }
 red text
 
static char fggreen [6] = {27, '[', '3', '2', 'm', '\0' }
 green text
 
static char fgdef [6] = {27, '[', '3', '9', 'm', '\0' }
 default text
 
static short debug_lvl = 1
 

Additional Inherited Members

static const std::string & GetVersion (void)
 Returns the version number of JSBSim.
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit.
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine.
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius.
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine.
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin.
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius.
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit.
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin.
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius.
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters.
 
static double PitotTotalPressure (double mach, double p)
 Compute the total pressure in front of the Pitot tube.
 
static double MachFromImpactPressure (double qc, double p)
 Compute the Mach number from the differential pressure (qc) and the static pressure.
 
static double VcalibratedFromMach (double mach, double p)
 Calculate the calibrated airspeed from the Mach number.
 
static double MachFromVcalibrated (double vcas, double p)
 Calculate the Mach number from the calibrated airspeed.Based on the formulas in the US Air Force Aircraft Performance Flight Testing Manual (AFFTC-TIH-99-01).
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison.
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison.
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison.
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison.
 
static constexpr double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static constexpr double sign (double num)
 
static double GaussianRandomNumber (void)
 
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
static Message localMsg
 
static std::queue< MessageMessages
 
static unsigned int messageId = 0
 
static constexpr double radtodeg = 180. / 3.14159265358979323846
 
static constexpr double degtorad = 3.14159265358979323846 / 180.
 
static constexpr double hptoftlbssec = 550.0
 
static constexpr double psftoinhg = 0.014138
 
static constexpr double psftopa = 47.88
 
static constexpr double ktstofps = 1.68781
 
static constexpr double fpstokts = 1.0 / ktstofps
 
static constexpr double inchtoft = 1.0/12.0
 
static constexpr double fttom = 0.3048
 
static constexpr double m3toft3 = 1.0/(fttom*fttom*fttom)
 
static constexpr double in3tom3 = inchtoft*inchtoft*inchtoft/m3toft3
 
static constexpr double inhgtopa = 3386.38
 
static constexpr double slugtolb = 32.174049
 Note that definition of lbtoslug by the inverse of slugtolb and not to a different constant you can also get from some tables will make lbtoslug*slugtolb == 1 up to the magnitude of roundoff.
 
static constexpr double lbtoslug = 1.0/slugtolb
 
static constexpr double kgtolb = 2.20462
 
static constexpr double kgtoslug = 0.06852168
 
static const std::string needed_cfg_version = "2.0"
 
static const std::string JSBSim_version = JSBSIM_VERSION " " __DATE__ " " __TIME__
 
static int gaussian_random_number_phase = 0
 

Detailed Description

Definition at line 185 of file FGFDMExec.h.

Member Enumeration Documentation

◆ eModels

Enumerator
ePropagate 
eInput 
eInertial 
eAtmosphere 
eWinds 
eSystems 
eMassBalance 
eAuxiliary 
ePropulsion 
eAerodynamics 
eGroundReactions 
eExternalReactions 
eBuoyantForces 
eAircraft 
eAccelerations 
eOutput 
eNumStandardModels 

Definition at line 230 of file FGFDMExec.h.

Constructor & Destructor Documentation

◆ FGFDMExec()

JSBSim::FGFDMExec::FGFDMExec ( FGPropertyManager * root = 0,
unsigned int * fdmctr = 0 )

Default constructor.

Definition at line 76 of file FGFDMExec.cpp.

◆ ~FGFDMExec()

JSBSim::FGFDMExec::~FGFDMExec ( )

Default destructor.

Definition at line 181 of file FGFDMExec.cpp.

Member Function Documentation

◆ AddTemplateFunc()

void JSBSim::FGFDMExec::AddTemplateFunc ( const std::string & name,
Element * el )
inline

Definition at line 615 of file FGFDMExec.h.

◆ BuildPropertyCatalog()

void JSBSim::FGFDMExec::BuildPropertyCatalog ( struct PropertyCatalogStructure * pcs)

Builds a catalog of properties.

This function descends the property tree and creates a list (an STL vector) containing the name and node for all properties.

Parameters
pcsThe "root" property catalog structure pointer.

Definition at line 924 of file FGFDMExec.cpp.

◆ CheckIncrementalHold()

void JSBSim::FGFDMExec::CheckIncrementalHold ( void )

Checks if required to hold afer increment.

Definition at line 1137 of file FGFDMExec.cpp.

◆ DisableOutput()

void JSBSim::FGFDMExec::DisableOutput ( void )
inline

Disables data logging to all outputs.

Definition at line 478 of file FGFDMExec.h.

◆ DoTrim()

void JSBSim::FGFDMExec::DoTrim ( int mode)

Executes trimming in the selected mode.

Parameters
modeSpecifies how to trim:
  • tLongitudinal=0
  • tFull
  • tGround
  • tPullup
  • tCustom
  • tTurn
  • tNone

Definition at line 1161 of file FGFDMExec.cpp.

◆ EnableIncrementThenHold()

void JSBSim::FGFDMExec::EnableIncrementThenHold ( int Timesteps)
inline

Turn on hold after increment.

Definition at line 484 of file FGFDMExec.h.

◆ EnableOutput()

void JSBSim::FGFDMExec::EnableOutput ( void )
inline

Enables data logging to all outputs.

Definition at line 480 of file FGFDMExec.h.

◆ EnumerateFDMs()

vector< string > JSBSim::FGFDMExec::EnumerateFDMs ( void )

Returns a vector of strings representing the names of all loaded models (future)

Definition at line 642 of file FGFDMExec.cpp.

◆ ForceOutput()

void JSBSim::FGFDMExec::ForceOutput ( int idx = 0)
inline

Forces the specified output object to print its items once.

Definition at line 449 of file FGFDMExec.h.

◆ GetAccelerations()

FGAccelerations * JSBSim::FGFDMExec::GetAccelerations ( void )
inline

Returns the FGAccelerations pointer.

Definition at line 355 of file FGFDMExec.h.

◆ GetAerodynamics()

FGAerodynamics * JSBSim::FGFDMExec::GetAerodynamics ( void )
inline

Returns the FGAerodynamics pointer.

Definition at line 365 of file FGFDMExec.h.

◆ GetAircraft()

FGAircraft * JSBSim::FGFDMExec::GetAircraft ( void )
inline

Returns the FGAircraft pointer.

Definition at line 375 of file FGFDMExec.h.

◆ GetAircraftPath()

const SGPath & JSBSim::FGFDMExec::GetAircraftPath ( void )
inline

Retrieves the aircraft path.

Definition at line 395 of file FGFDMExec.h.

◆ GetAtmosphere()

FGAtmosphere * JSBSim::FGFDMExec::GetAtmosphere ( void )
inline

Returns the FGAtmosphere pointer.

Definition at line 353 of file FGFDMExec.h.

◆ GetAuxiliary()

FGAuxiliary * JSBSim::FGFDMExec::GetAuxiliary ( void )
inline

Returns the FGAuxiliary pointer.

Definition at line 379 of file FGFDMExec.h.

◆ GetBuoyantForces()

FGBuoyantForces * JSBSim::FGFDMExec::GetBuoyantForces ( void )
inline

Returns the FGBuoyantForces pointer.

Definition at line 373 of file FGFDMExec.h.

◆ GetChildFDM()

childData * JSBSim::FGFDMExec::GetChildFDM ( int i) const
inline

Gets a particular child FDM.

Definition at line 426 of file FGFDMExec.h.

◆ GetDebugLevel()

int JSBSim::FGFDMExec::GetDebugLevel ( void ) const
inline

Retrieves the current debug level setting.

Definition at line 594 of file FGFDMExec.h.

◆ GetDeltaT()

double JSBSim::FGFDMExec::GetDeltaT ( void ) const
inline

Returns the simulation delta T.

Definition at line 545 of file FGFDMExec.h.

◆ GetEnginePath()

const SGPath & JSBSim::FGFDMExec::GetEnginePath ( void )
inline

Retrieves the engine path.

Definition at line 393 of file FGFDMExec.h.

◆ GetExternalReactions()

FGExternalReactions * JSBSim::FGFDMExec::GetExternalReactions ( void )
inline

Returns the FGExternalReactions pointer.

Definition at line 371 of file FGFDMExec.h.

◆ GetFCS()

FGFCS * JSBSim::FGFDMExec::GetFCS ( void )
inline

Returns the FGFCS pointer.

Definition at line 359 of file FGFDMExec.h.

◆ GetFDMCount()

int JSBSim::FGFDMExec::GetFDMCount ( void ) const
inline

Gets the number of child FDMs.

Definition at line 424 of file FGFDMExec.h.

◆ GetFrame()

unsigned int JSBSim::FGFDMExec::GetFrame ( void ) const
inline

Retrieves the current frame count.

Definition at line 591 of file FGFDMExec.h.

◆ GetFullAircraftPath()

const SGPath & JSBSim::FGFDMExec::GetFullAircraftPath ( void )
inline

Retrieves the full aircraft path name.

Definition at line 399 of file FGFDMExec.h.

◆ GetGroundReactions()

FGGroundReactions * JSBSim::FGFDMExec::GetGroundReactions ( void )
inline

Returns the FGGroundReactions pointer.

Definition at line 369 of file FGFDMExec.h.

◆ GetHoldDown()

bool JSBSim::FGFDMExec::GetHoldDown ( void ) const
inline

Gets the value of the property forces/hold-down.

Returns
zero if the 'hold-down' function is disabled, non-zero otherwise.

Definition at line 609 of file FGFDMExec.h.

◆ GetIC()

FGInitialCondition * JSBSim::FGFDMExec::GetIC ( void )
inline

Returns a pointer to the FGInitialCondition object.

Definition at line 387 of file FGFDMExec.h.

◆ GetInertial()

FGInertial * JSBSim::FGFDMExec::GetInertial ( void )
inline

Returns the FGInertial pointer.

Definition at line 367 of file FGFDMExec.h.

◆ GetInput()

FGInput * JSBSim::FGFDMExec::GetInput ( void )
inline

Returns the FGInput pointer.

Definition at line 381 of file FGFDMExec.h.

◆ GetMassBalance()

FGMassBalance * JSBSim::FGFDMExec::GetMassBalance ( void )
inline

Returns the FGAircraft pointer.

Definition at line 363 of file FGFDMExec.h.

◆ GetModelName()

const std::string & JSBSim::FGFDMExec::GetModelName ( void ) const
inline

Returns the model name.

Definition at line 417 of file FGFDMExec.h.

◆ GetOutput()

FGOutput * JSBSim::FGFDMExec::GetOutput ( void )
inline

Returns the FGOutput pointer.

Definition at line 383 of file FGFDMExec.h.

◆ GetOutputFileName()

std::string JSBSim::FGFDMExec::GetOutputFileName ( int n) const
inline

Retrieves the current output filename.

Parameters
nindex of file
Returns
the name of the output file for the output specified by the flight model. If none is specified, the empty string is returned.

Definition at line 464 of file FGFDMExec.h.

◆ GetOutputPath()

const SGPath & JSBSim::FGFDMExec::GetOutputPath ( void )
inline

Retrieves the path to the output files.

Definition at line 401 of file FGFDMExec.h.

◆ GetPropagate()

FGPropagate * JSBSim::FGFDMExec::GetPropagate ( void )
inline

Returns the FGPropagate pointer.

Definition at line 377 of file FGFDMExec.h.

◆ GetPropertyCatalog()

std::vector< std::string > & JSBSim::FGFDMExec::GetPropertyCatalog ( void )
inline

Definition at line 532 of file FGFDMExec.h.

◆ GetPropertyManager()

FGPropertyManager * JSBSim::FGFDMExec::GetPropertyManager ( void )

Returns a pointer to the property manager object.

Definition at line 1121 of file FGFDMExec.cpp.

◆ GetPropertyValue()

double JSBSim::FGFDMExec::GetPropertyValue ( const std::string & property)
inline

Retrieves the value of a property.

Parameters
propertythe name of the property
Returns
the value of the specified property

Definition at line 406 of file FGFDMExec.h.

◆ GetPropulsion()

FGPropulsion * JSBSim::FGFDMExec::GetPropulsion ( void )
inline

Returns the FGPropulsion pointer.

Definition at line 361 of file FGFDMExec.h.

◆ GetPropulsionTankReport()

string JSBSim::FGFDMExec::GetPropulsionTankReport ( )

Definition at line 917 of file FGFDMExec.cpp.

◆ GetRandomEngine()

const std::shared_ptr< std::default_random_engine > & JSBSim::FGFDMExec::GetRandomEngine ( void ) const
inline

Definition at line 619 of file FGFDMExec.h.

◆ GetRootDir()

const SGPath & JSBSim::FGFDMExec::GetRootDir ( void ) const
inline

Retrieve the Root Directory.

Returns
the path to the root (base) JSBSim directory.
See also
SetRootDir

Definition at line 583 of file FGFDMExec.h.

◆ GetScript()

FGScript * JSBSim::FGFDMExec::GetScript ( void )
inline

Retrieves the script object.

Definition at line 385 of file FGFDMExec.h.

◆ GetSimTime()

double JSBSim::FGFDMExec::GetSimTime ( void ) const
inline

Returns the cumulative simulation time in seconds.

Definition at line 542 of file FGFDMExec.h.

◆ GetSystemsPath()

const SGPath & JSBSim::FGFDMExec::GetSystemsPath ( void )
inline

Retrieves the systems path.

Definition at line 397 of file FGFDMExec.h.

◆ GetTemplateFunc()

FGTemplateFunc * JSBSim::FGFDMExec::GetTemplateFunc ( const std::string & name)
inline

Definition at line 611 of file FGFDMExec.h.

◆ GetTrim()

FGTrim * JSBSim::FGFDMExec::GetTrim ( void )

Returns a pointer to the FGTrim object.

Definition at line 1128 of file FGFDMExec.cpp.

◆ GetTrimMode()

int JSBSim::FGFDMExec::GetTrimMode ( void ) const
inline

Definition at line 537 of file FGFDMExec.h.

◆ GetTrimStatus()

bool JSBSim::FGFDMExec::GetTrimStatus ( void ) const
inline

Definition at line 535 of file FGFDMExec.h.

◆ GetWinds()

FGWinds * JSBSim::FGFDMExec::GetWinds ( void )
inline

Returns the FGWinds pointer.

Definition at line 357 of file FGFDMExec.h.

◆ Hold()

void JSBSim::FGFDMExec::Hold ( void )
inline

Pauses execution by preventing time from incrementing.

Definition at line 482 of file FGFDMExec.h.

◆ Holding()

bool JSBSim::FGFDMExec::Holding ( void )
inline

Returns true if the simulation is Holding (i.e. simulation time is not moving).

Definition at line 490 of file FGFDMExec.h.

◆ IncrTime()

double JSBSim::FGFDMExec::IncrTime ( void )

Increments the simulation time if not in Holding mode.

The Frame counter is also incremented.

Returns
the new simulation time.

Definition at line 221 of file FGFDMExec.cpp.

◆ Initialize()

void JSBSim::FGFDMExec::Initialize ( FGInitialCondition * FGIC)

Initializes the simulation with initial conditions.

Parameters
FGICThe initial conditions that will be passed to the simulation.

Definition at line 599 of file FGFDMExec.cpp.

◆ IntegrationSuspended()

bool JSBSim::FGFDMExec::IntegrationSuspended ( void ) const
inline

Returns the simulation suspension state.

Returns
true if suspended, false if executing

Definition at line 555 of file FGFDMExec.h.

◆ LoadModel() [1/2]

bool JSBSim::FGFDMExec::LoadModel ( const SGPath & AircraftPath,
const SGPath & EnginePath,
const SGPath & SystemsPath,
const std::string & model,
bool addModelToPath = true )

Loads an aircraft model.

Parameters
AircraftPathpath to the aircraft/ directory. For instance: "aircraft". Under aircraft, then, would be directories for various modeled aircraft such as C172/, x15/, etc.
EnginePathpath to the directory under which engine config files are kept, for instance "engine"
SystemsPathpath to the directory under which systems config files are kept, for instance "systems"
modelthe name of the aircraft model itself. This file will be looked for in the directory specified in the AircraftPath variable, and in turn under the directory with the same name as the model. For instance: "aircraft/x15/x15.xml"
addModelToPathset to true to add the model name to the AircraftPath, defaults to true
Returns
true if successful

◆ LoadModel() [2/2]

bool JSBSim::FGFDMExec::LoadModel ( const std::string & model,
bool addModelToPath = true )

Loads an aircraft model.

The paths to the aircraft and engine config file directories must be set prior to calling this. See below.

Parameters
modelthe name of the aircraft model itself. This file will be looked for in the directory specified in the AircraftPath variable, and in turn under the directory with the same name as the model. For instance: "aircraft/x15/x15.xml"
addModelToPathset to true to add the model name to the AircraftPath, defaults to true
Returns
true if successful

◆ LoadScript()

bool JSBSim::FGFDMExec::LoadScript ( const SGPath & Script,
double deltaT = 0.0,
const SGPath & initfile = SGPath() )

Load a script.

Parameters
ScriptThe full path name and file name for the script to be loaded.
deltaTThe simulation integration step size, if given. If no value is supplied then 0.0 is used and the value is expected to be supplied in the script file itself.
initfileThe initialization file that will override the initialization file specified in the script file. If no file name is given on the command line, the file specified in the script will be used. If an initialization file is not given in either place, an error will result.
Returns
true if successfully loads; false otherwise.

Definition at line 658 of file FGFDMExec.cpp.

◆ PrintPropertyCatalog()

void JSBSim::FGFDMExec::PrintPropertyCatalog ( void )

Definition at line 964 of file FGFDMExec.cpp.

◆ PrintSimulationConfiguration()

void JSBSim::FGFDMExec::PrintSimulationConfiguration ( void ) const

Definition at line 976 of file FGFDMExec.cpp.

◆ QueryPropertyCatalog()

string JSBSim::FGFDMExec::QueryPropertyCatalog ( const std::string & check)

Retrieves property or properties matching the supplied string.

A string is returned that contains a carriage return delimited list of all strings in the property catalog that matches the supplied check string.

Parameters
checkThe string to search for in the property catalog.
Returns
the carriage-return-delimited string containing all matching strings in the catalog.

Definition at line 952 of file FGFDMExec.cpp.

◆ ResetToInitialConditions()

void JSBSim::FGFDMExec::ResetToInitialConditions ( int mode)

Resets the initial conditions object and prepares the simulation to run again.

If the mode's first bit is set the output instances will take special actions such as closing the current output file and open a new one with a different name. If the second bit is set then RunIC() won't be executed, leaving it to the caller to call RunIC(), e.g. in case the caller wants to set some other state like control surface deflections which would've been reset.

Parameters
modeSets the reset mode.

Definition at line 608 of file FGFDMExec.cpp.

◆ Resume()

void JSBSim::FGFDMExec::Resume ( void )
inline

Resumes execution from a "Hold".

Definition at line 488 of file FGFDMExec.h.

◆ ResumeIntegration()

void JSBSim::FGFDMExec::ResumeIntegration ( void )
inline

Resumes the simulation by resetting delta T to the correct value.

Definition at line 551 of file FGFDMExec.h.

◆ Run()

bool JSBSim::FGFDMExec::Run ( void )

This function executes each scheduled model in succession.

Returns
true if successful, false if sim should be ended

Definition at line 325 of file FGFDMExec.cpp.

◆ RunIC()

bool JSBSim::FGFDMExec::RunIC ( void )

Initializes the sim from the initial condition object and executes each scheduled model without integrating i.e.

dt=0.

Returns
true if successful

Definition at line 560 of file FGFDMExec.cpp.

◆ SetAircraftPath()

bool JSBSim::FGFDMExec::SetAircraftPath ( const SGPath & path)
inline

Set the path to the aircraft config file directories.

Under this path, then, would be directories for various modeled aircraft such as C172/, x15/, etc. Relative paths are taken from the root directory.

Parameters
pathpath to the aircraft directory, for instance "aircraft".
See also
SetRootDir
GetAircraftPath

Definition at line 323 of file FGFDMExec.h.

◆ SetChild()

void JSBSim::FGFDMExec::SetChild ( bool ch)
inline

Marks this instance of the Exec object as a "child" object.

Definition at line 428 of file FGFDMExec.h.

◆ SetDebugLevel()

void JSBSim::FGFDMExec::SetDebugLevel ( int level)
inline

Sets the debug level.

Definition at line 503 of file FGFDMExec.h.

◆ Setdt()

void JSBSim::FGFDMExec::Setdt ( double delta_t)
inline

Sets the integration time step for the simulation executive.

Parameters
delta_tthe time step in seconds.

Definition at line 564 of file FGFDMExec.h.

◆ SetEnginePath()

bool JSBSim::FGFDMExec::SetEnginePath ( const SGPath & path)
inline

Set the path to the engine config file directories.

Relative paths are taken from the root directory.

Parameters
pathpath to the directory under which engine config files are kept, for instance "engine".
See also
SetRootDir
GetEnginePath

Definition at line 311 of file FGFDMExec.h.

◆ SetHoldDown()

void JSBSim::FGFDMExec::SetHoldDown ( bool hd)

Sets the property forces/hold-down.

This allows to do hard 'hold-down' such as for rockets on a launch pad with engines ignited.

Parameters
hdenables the 'hold-down' function if non-zero

Definition at line 629 of file FGFDMExec.cpp.

◆ SetLoggingRate()

void JSBSim::FGFDMExec::SetLoggingRate ( double rate)
inline

Sets the logging rate in Hz for all output objects (if any).

Definition at line 452 of file FGFDMExec.h.

◆ SetOutputDirectives()

bool JSBSim::FGFDMExec::SetOutputDirectives ( const SGPath & fname)
inline

Sets the output (logging) mechanism for this run.

Calling this function passes the name of an output directives file to the FGOutput object associated with this run. The call to this function should be made prior to loading an aircraft model. This call results in an FGOutput object being built as the first Output object in the FDMExec-managed list of Output objects that may be created for an aircraft model. If this call is made after an aircraft model is loaded, there is no effect. Any Output objects added by the aircraft model itself (in an <output> element) will be added after this one. Care should be taken not to refer to the same file name. An output directives file contains an <output> </output> element, within which should be specified the parameters or parameter groups that should be logged.

Parameters
fnamethe filename of an output directives file.

Definition at line 445 of file FGFDMExec.h.

◆ SetOutputFileName()

bool JSBSim::FGFDMExec::SetOutputFileName ( const int n,
const std::string & fname )
inline

Sets (or overrides) the output filename.

Parameters
nindex of file
fnamethe name of the file to output data to
Returns
true if successful, false if there is no output specified for the flight model

Definition at line 458 of file FGFDMExec.h.

◆ SetOutputPath()

bool JSBSim::FGFDMExec::SetOutputPath ( const SGPath & path)
inline

Set the directory where the output files will be written.

Relative paths are taken from the root directory.

Parameters
pathpath to the directory under which the output files will be written.
See also
SetRootDir
GetOutputPath

Definition at line 345 of file FGFDMExec.h.

◆ SetPropertyValue()

void JSBSim::FGFDMExec::SetPropertyValue ( const std::string & property,
double value )
inline

Sets a property value.

Parameters
propertythe property to be set
valuethe value to set the property to

Definition at line 412 of file FGFDMExec.h.

◆ SetRootDir()

void JSBSim::FGFDMExec::SetRootDir ( const SGPath & rootDir)
inline

Set the root directory that is used to obtain absolute paths from relative paths.

Aircraft, engine, systems and output paths are not updated by this method. You must call each methods (SetAircraftPath(), SetEnginePath(), etc.) individually if you need to update these paths as well.

Parameters
rootDirthe path to the root directory.
See also
GetRootDir
SetAircraftPath
SetEnginePath
SetSystemsPath
SetOutputPath

Definition at line 578 of file FGFDMExec.h.

◆ Setsim_time()

double JSBSim::FGFDMExec::Setsim_time ( double cur_time)

Sets the current sim time.

Parameters
cur_timethe current time
Returns
the current simulation time.

Definition at line 213 of file FGFDMExec.cpp.

◆ SetSystemsPath()

bool JSBSim::FGFDMExec::SetSystemsPath ( const SGPath & path)
inline

Set the path to the systems config file directories.

Relative paths are taken from the root directory.

Parameters
pathpath to the directory under which systems config files are kept, for instance "systems"
See also
SetRootDir
GetSystemsPath

Definition at line 334 of file FGFDMExec.h.

◆ SetTrimMode()

void JSBSim::FGFDMExec::SetTrimMode ( int mode)
inline

Definition at line 536 of file FGFDMExec.h.

◆ SetTrimStatus()

void JSBSim::FGFDMExec::SetTrimStatus ( bool status)
inline

Definition at line 534 of file FGFDMExec.h.

◆ SuspendIntegration()

void JSBSim::FGFDMExec::SuspendIntegration ( void )
inline

Suspends the simulation and sets the delta T to zero.

Definition at line 548 of file FGFDMExec.h.

◆ Unbind()

void JSBSim::FGFDMExec::Unbind ( void )
inline

Unbind all tied JSBSim properties.

Definition at line 249 of file FGFDMExec.h.

Member Data Documentation

◆ DONT_EXECUTE_RUN_IC

const int JSBSim::FGFDMExec::DONT_EXECUTE_RUN_IC = 0x2
static

Definition at line 493 of file FGFDMExec.h.

◆ START_NEW_OUTPUT

const int JSBSim::FGFDMExec::START_NEW_OUTPUT = 0x1
static

Mode flags for ResetToInitialConditions.

Definition at line 492 of file FGFDMExec.h.


The documentation for this class was generated from the following files: