]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGFDMExec.h
Sync. w. JSBSim CVS.
[flightgear.git] / src / FDM / JSBSim / FGFDMExec.h
index a89ffbd26ac7e192579794057edc5d7589205070..ae9edb9999029b245b3a1bff7670d05c11fa6708 100644 (file)
@@ -27,7 +27,7 @@ HISTORY
 11/17/98   JSB   Created
 7/31/99     TP   Added RunIC function that runs the sim so that every frame
                  begins with the IC values from the given FGInitialCondition
-                                  object and dt=0.
+                 object and dt=0.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
@@ -44,10 +44,12 @@ INCLUDES
 #include "FGTrim.h"
 #include "FGInitialCondition.h"
 #include "FGJSBBase.h"
+#include "FGGroundCallback.h"
 #include "FGPropertyManager.h"
-
+#include "FGPropagate.h"
 
 #include <vector>
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -60,55 +62,45 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Encapsulates the JSBSim simulation executive.
-    @author Jon S. Berndt
-    @version $Id$
-    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
-         Header File </a>
-    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
-         Source File </a>
-
-    @doc This class is the interface class through which all other simulation classes
+    This class is the interface class through which all other simulation classes
     are instantiated, initialized, and run. When integrated with FlightGear (or
     other flight simulator) this class is typically instantiated by an interface
     class on the simulator side.
 
     When an aircraft model is loaded the config file is parsed and for each of the
     sections of the config file (propulsion, flight control, etc.) the
-    corresponding "ReadXXX()" method is called. From within this method the 
+    corresponding "ReadXXX()" method is called. From within this method the
     "Load()" method of that system is called (e.g. LoadFCS).
 
     <h4>JSBSim Debugging Directives</h4>
 
     This describes to any interested entity the debug level
     requested by setting the JSBSIM_DEBUG environment variable.
-    The bitmasked value choices are as follows:<ol>
-    <li><b>unset</b>: In this case (the default) JSBSim would only print
+    The bitmasked value choices are as follows:
+    <b>unset</b>: 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</li>
-    <li><b>0</b>: This requests JSBSim not to output any messages
-       whatsoever.</li>
-    <li><b>1</b>: This value explicity requests the normal JSBSim
-       startup messages</li>
-    <li><b>2</b>: This value asks for a message to be printed out when
-       a class is instantiated</li>
-    <li><b>4</b>: When this value is set, a message is displayed when a
-       FGModel object executes its Run() method</li>
-    <li><b>8</b>: When this value is set, various runtime state variables
-       are printed out periodically</li>
-    <li><b>16</b>: When set various parameters are sanity checked and
-       a message is printed out when they go out of bounds</li>
-    </ol>
+       variable is not set, debug_lvl is set to 1 internally
+    - <b>0</b>: This requests JSBSim not to output any messages
+       whatsoever
+    - <b>1</b>: This value explicity requests the normal JSBSim
+       startup messages
+    - <b>2</b>: This value asks for a message to be printed out when
+       a class is instantiated
+    - <b>4</b>: When this value is set, a message is displayed when a
+       FGModel object executes its Run() method
+    - <b>8</b>: When this value is set, various runtime state variables
+       are printed out periodically
+    - <b>16</b>: When set various parameters are sanity checked and
+       a message is printed out when they go out of bounds
 
+    @author Jon S. Berndt
+    @version $Id$
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -121,7 +113,7 @@ public:
 
   /// Default constructor
   FGFDMExec(FGPropertyManager* root = 0);
-  
+
   /// Default destructor
   ~FGFDMExec();
 
@@ -151,8 +143,10 @@ public:
 
   /// Resumes the sim
   void Resume(void) {frozen = false;}
-  
-  /** Loads an aircraft model.  
+
+  void SetGroundCallback(FGGroundCallback*);
+
+  /** Loads an aircraft model.
       @param AircraftPath path to the aircraft directory. For instance:
       "aircraft". Under aircraft, then, would be directories for various
       modeled aircraft such as C172/, x15/, etc.
@@ -162,9 +156,12 @@ public:
       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"
+      @param addModelToPath set to true to add the model name to the
+      AircraftPath, defaults to true
       @return true if successful*/
-  bool LoadModel(string AircraftPath, string EnginePath, string model);
-  
+  bool LoadModel(string AircraftPath, string EnginePath, 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
@@ -173,30 +170,32 @@ public:
       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"
+      @param addModelToPath set to true to add the model name to the
+      AircraftPath, defaults to true
       @return true if successful*/
-  bool LoadModel(string model);
-  
+  bool LoadModel(string model, bool addModelToPath = true);
+
 
   /** Sets the path to the engine config file directories.
-      @param EnginePath path to the directory under which engine config
+      @param path path to the directory under which engine config
       files are kept, for instance "engine"
   */
   bool SetEnginePath(string path)   { EnginePath = path; return true; }
 
   /** Sets the path to the aircraft config file directories.
-      @param AircraftPath path to the aircraft directory. For instance:
+      @param path path to the aircraft directory. For instance:
       "aircraft". Under aircraft, then, would be directories for various
       modeled aircraft such as C172/, x15/, etc.
   */
   bool SetAircraftPath(string path) { AircraftPath = path; return true; }
-  
+
   /** Sets the path to the autopilot config file directories.
-      @param ControlPath path to the control directory. For instance:
+      @param path path to the control directory. For instance:
       "control".
   */
-  bool SetControlPath(string path) { ControlPath = path; return true; }
-  
+//  bool SetControlPath(string path) { ControlPath = path; return true; }
+
+
   /// @name Top-level executive State and Model retrieval mechanism
   //@{
   /// Returns the FGState pointer.
@@ -205,6 +204,8 @@ public:
   inline FGAtmosphere* GetAtmosphere(void)    {return Atmosphere;}
   /// Returns the FGFCS pointer.
   inline FGFCS* GetFCS(void)                  {return FCS;}
+  /// Returns the FGGroundCallback pointer.
+  inline FGGroundCallback* GetGroundCallback(void) {return GroundCallback;}
   /// Returns the FGPropulsion pointer.
   inline FGPropulsion* GetPropulsion(void)    {return Propulsion;}
   /// Returns the FGAircraft pointer.
@@ -217,12 +218,8 @@ public:
   inline FGGroundReactions* GetGroundReactions(void) {return GroundReactions;}
   /// Returns the FGAircraft pointer.
   inline FGAircraft* GetAircraft(void)        {return Aircraft;}
-  /// Returns the FGTranslation pointer.
-  inline FGTranslation* GetTranslation(void)  {return Translation;}
-  /// Returns the FGRotation pointer.
-  inline FGRotation* GetRotation(void)        {return Rotation;}
-  /// Returns the FGPosition pointer.
-  inline FGPosition* GetPosition(void)        {return Position;}
+  /// Returns the FGPropagate pointer.
+  inline FGPropagate* GetPropagate(void)      {return Propagate;}
   /// Returns the FGAuxiliary pointer.
   inline FGAuxiliary* GetAuxiliary(void)      {return Auxiliary;}
   /// Returns the FGOutput pointer.
@@ -232,20 +229,20 @@ public:
   // Returns a pointer to the FGTrim object
   FGTrim* GetTrim(void);
   //@}
-  
+
   /// Retrieves the engine path.
   inline string GetEnginePath(void)          {return EnginePath;}
   /// Retrieves the aircraft path.
   inline string GetAircraftPath(void)        {return AircraftPath;}
-  /// Retrieves the control path.
-  inline string GetControlPath(void)        {return ControlPath;}
-  
+//  /// Retrieves the control path.
+//  inline string GetControlPath(void)        {return ControlPath;}
+
   string GetModelName(void) { return modelName; }
-  
+
   FGPropertyManager* GetPropertyManager(void);
   vector <string> EnumerateFDMs(void);
   void SetSlave(void) {IsSlave = true;}
-  
+
 private:
   FGModel* FirstModel;
 
@@ -260,7 +257,7 @@ private:
   bool IsSlave;
   static FGPropertyManager *master;
   FGPropertyManager *instance;
-  
+
   struct slaveData {
     FGFDMExec* exec;
     string info;
@@ -282,25 +279,25 @@ private:
 
   string AircraftPath;
   string EnginePath;
-  string ControlPath;
-  
+//  string ControlPath;
+
   string CFGVersion;
+  string Release;
 
   FGState*           State;
   FGAtmosphere*      Atmosphere;
   FGFCS*             FCS;
+  FGGroundCallback*  GroundCallback;
   FGPropulsion*      Propulsion;
   FGMassBalance*     MassBalance;
   FGAerodynamics*    Aerodynamics;
   FGInertial*        Inertial;
   FGGroundReactions* GroundReactions;
   FGAircraft*        Aircraft;
-  FGTranslation*     Translation;
-  FGRotation*        Rotation;
-  FGPosition*        Position;
+  FGPropagate*       Propagate;
   FGAuxiliary*       Auxiliary;
   FGOutput*          Output;
-  
+
   FGInitialCondition* IC;
   FGTrim *Trim;