+ /// @name Top-level executive State and Model retrieval mechanism
+ //@{
+ /// Returns the FGAtmosphere pointer.
+ FGAtmosphere* GetAtmosphere(void) {return Atmosphere;}
+ /// Returns the FGFCS pointer.
+ FGFCS* GetFCS(void) {return FCS;}
+ /// Returns the FGPropulsion pointer.
+ FGPropulsion* GetPropulsion(void) {return Propulsion;}
+ /// Returns the FGAircraft pointer.
+ FGMassBalance* GetMassBalance(void) {return MassBalance;}
+ /// Returns the FGAerodynamics pointer
+ FGAerodynamics* GetAerodynamics(void){return Aerodynamics;}
+ /// Returns the FGInertial pointer.
+ FGInertial* GetInertial(void) {return Inertial;}
+ /// Returns the FGGroundReactions pointer.
+ FGGroundReactions* GetGroundReactions(void) {return GroundReactions;}
+ /// Returns the FGExternalReactions pointer.
+ FGExternalReactions* GetExternalReactions(void) {return ExternalReactions;}
+ /// Returns the FGBuoyantForces pointer.
+ FGBuoyantForces* GetBuoyantForces(void) {return BuoyantForces;}
+ /// Returns the FGAircraft pointer.
+ FGAircraft* GetAircraft(void) {return Aircraft;}
+ /// Returns the FGPropagate pointer.
+ FGPropagate* GetPropagate(void) {return Propagate;}
+ /// Returns the FGAuxiliary pointer.
+ FGAuxiliary* GetAuxiliary(void) {return Auxiliary;}
+ /// Returns the FGInput pointer.
+ FGInput* GetInput(void) {return Input;}
+ /// Returns the FGGroundCallback pointer.
+ FGGroundCallback* GetGroundCallback(void) {return GroundCallback;}
+ /// Retrieves the script object
+ FGScript* GetScript(void) {return Script;}
+ // Returns a pointer to the FGInitialCondition object
+ FGInitialCondition* GetIC(void) {return IC;}
+ // Returns a pointer to the FGTrim object
+ FGTrim* GetTrim(void);
+ //@}
+
+ /// Retrieves the engine path.
+ const string& GetEnginePath(void) {return EnginePath;}
+ /// Retrieves the aircraft path.
+ const string& GetAircraftPath(void) {return AircraftPath;}
+ /// Retrieves the systems path.
+ const string& GetSystemsPath(void) {return SystemsPath;}
+ /// Retrieves the full aircraft path name.
+ const string& GetFullAircraftPath(void) {return FullAircraftPath;}
+
+ /** Retrieves the value of a property.
+ @param property the name of the property
+ @result the value of the specified property */
+ inline double GetPropertyValue(const string& property) {return instance->GetDouble(property);}
+
+ /** Sets a property value.
+ @param property the property to be set
+ @param value the value to set the property to */
+ inline void SetPropertyValue(const string& property, double value) {
+ instance->SetDouble(property, value);
+ }
+
+ /// Returns the model name.
+ const string& GetModelName(void) { return modelName; }
+/*
+ /// Returns the current time.
+ double GetSimTime(void);
+
+ /// Returns the current frame time (delta T).
+ double GetDeltaT(void);
+*/
+ /// Returns a pointer to the property manager object.
+ FGPropertyManager* GetPropertyManager(void);
+ /// Returns a vector of strings representing the names of all loaded models (future)
+ vector <string> EnumerateFDMs(void);
+ /// Gets the number of child FDMs.
+ int GetFDMCount(void) {return (int)ChildFDMList.size();}
+ /// Gets a particular child FDM.
+ childData* GetChildFDM(int i) {return ChildFDMList[i];}
+ /// Marks this instance of the Exec object as a "child" object.
+ void SetChild(bool ch) {IsChild = ch;}
+
+ /** 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.
+ @param fname the filename of an output directives file.
+ */
+ bool SetOutputDirectives(const string& fname);
+
+ /** Sets (or overrides) the output filename
+ @param fname the name of the file to output data to
+ @return true if successful, false if there is no output specified for the flight model */
+ bool SetOutputFileName(const string& fname) {
+ if (Outputs.size() > 0) Outputs[0]->SetOutputFileName(fname);
+ else return false;
+ return true;
+ }
+
+ /** Retrieves the current output filename.
+ @return the name of the output file for the first output specified by the flight model.
+ If none is specified, the empty string is returned. */
+ string GetOutputFileName(void) {
+ if (Outputs.size() > 0) return Outputs[0]->GetOutputFileName();
+ else return string("");
+ }
+
+ /** Executes trimming in the selected mode.
+ * @param mode Specifies how to trim:
+ * - tLongitudinal=0
+ * - tFull
+ * - tGround
+ * - tPullup
+ * - tCustom
+ * - tTurn
+ * - tNone */
+ void DoTrim(int mode);
+// void DoTrimAnalysis(int mode);
+
+ /// Disables data logging to all outputs.
+ void DisableOutput(void);
+ /// Enables data logging to all outputs.
+ void EnableOutput(void);
+ /// Pauses execution by preventing time from incrementing.
+ void Hold(void) {holding = true;}
+ /// Resumes execution from a "Hold".
+ void Resume(void) {holding = false;}
+ /// Returns true if the simulation is Holding (i.e. simulation time is not moving).
+ bool Holding(void) {return holding;}
+ /// Resets the initial conditions object and prepares the simulation to run again.
+ void ResetToInitialConditions(void);
+ /// Sets the debug level.
+ void SetDebugLevel(int level) {debug_lvl = level;}
+
+ struct PropertyCatalogStructure {
+ /// Name of the property.
+ string base_string;
+ /// The node for the property.
+ FGPropertyManager *node;
+ };
+
+ /** 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.
+ * @param pcs The "root" property catalog structure pointer. */
+ void BuildPropertyCatalog(struct PropertyCatalogStructure* pcs);
+
+ /** 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.
+ * @param check The string to search for in the property catalog.
+ * @return the carriage-return-delimited string containing all matching strings
+ * in the catalog. */
+ string QueryPropertyCatalog(const string& check);
+
+ // Print the contents of the property catalog for the loaded aircraft.
+ void PrintPropertyCatalog(void);
+
+ vector<string>& GetPropertyCatalog(void) {return PropertyCatalog;}
+
+ /// Use the MSIS atmosphere model.
+ void UseAtmosphereMSIS(void);
+
+ /// Use the Mars atmosphere model. (Not operative yet.)
+ void UseAtmosphereMars(void);
+
+ void SetTrimStatus(bool status){ trim_status = status; }
+ bool GetTrimStatus(void) const { return trim_status; }
+ void SetTrimMode(int mode){ ta_mode = mode; }
+ int GetTrimMode(void) const { return ta_mode; }
+
+ /// Returns the cumulative simulation time in seconds.
+ double GetSimTime(void) const { return sim_time; }
+
+ /// Returns the simulation delta T.
+ double GetDeltaT(void) {return dT;}
+
+ /// Suspends the simulation and sets the delta T to zero.
+ void SuspendIntegration(void) {saved_dT = dT; dT = 0.0;}
+
+ /// Resumes the simulation by resetting delta T to the correct value.
+ void ResumeIntegration(void) {dT = saved_dT;}
+
+ /** Returns the simulation suspension state.
+ @return true if suspended, false if executing */
+ bool IntegrationSuspended(void) {return dT == 0.0;}
+
+ /** Sets the current sim time.
+ @param cur_time the current time
+ @return the current simulation time. */
+ double Setsim_time(double cur_time) {
+ sim_time = cur_time;
+ return sim_time;
+ }
+
+ /** Sets the integration time step for the simulation executive.
+ @param delta_t the time step in seconds. */
+ void Setdt(double delta_t) { dT = delta_t; }
+
+ /** Sets the root directory where JSBSim starts looking for its system directories.
+ @param rootDir the string containing the root directory. */
+ void SetRootDir(const string& rootDir) {RootDir = rootDir;}
+
+ /** Retrieves teh Root Directory.
+ @return the string representing the root (base) JSBSim directory. */
+ const string& GetRootDir(void) const {return RootDir;}
+
+ /** Increments the simulation time.
+ @return the new simulation time. */
+ double IncrTime(void) {
+ sim_time += dT;
+ return sim_time;
+ }
+
+ /** Retrieves the current debug level setting. */
+ int GetDebugLevel(void) const {return debug_lvl;};