]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGState.h
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGState.h
index 05c9a6025dccbff1065d2333a504f6ccacc1baf4..5d7b70dcdef868a70a7c26e946c0486862e7a9f1 100644 (file)
@@ -95,6 +95,10 @@ CLASS DOCUMENTATION
 /** Encapsulates the calculation of aircraft state.
     @author Jon S. Berndt
     @version $Id$
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGState.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/FGState.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Source File </a>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -166,17 +170,11 @@ public:
       */
   void Initialize(FGInitialCondition *FGIC);
 
-  /** Stores state data in the supplied file name.
-      @param filename the file to store the data in.
-      @return true if successful.
-      */
-  bool StoreData(string filename);
-
   /// returns the speed of sound in feet per second.
   inline double Geta(void) { return a; }
 
   /// Returns the simulation time in seconds.
-  inline double Getsim_time(void) { return sim_time; }
+  inline double Getsim_time(void) const { return sim_time; }
   /// Returns the simulation delta T.
   inline double Getdt(void) { return dt; }
 
@@ -185,38 +183,11 @@ public:
   /// Resumes the simulation by resetting delta T to the correct value.
   inline void Resume(void)  {dt = saved_dt;}
 
-  /** Retrieves a parameter.
-      The parameters that can be retrieved are enumerated in FGJSBBase.h.
-      @param val_idx one of the enumerated JSBSim parameters.
-      @return the value of the parameter.
-      */
-  double GetParameter(eParam val_idx);
-
-  /** Retrieves a parameter.
-      The parameters that can be retrieved are enumerated in FGJSBBase.h.
-      @param val_string a string representing one of the enumerated JSBSim parameters,
-             i.e. "FG_QBAR".
-      @return the value of the parameter.
-      */
-  double GetParameter(string val_string);
-
-  /** Retrieves the JSBSim parameter enumerated item given the text string.
-      @param val_string the parameter string, i.e. "FG_QBAR".
-      @return the JSBSim parameter index (an enumerated type) for the supplied string.
-      */
-  eParam GetParameterIndex(string val_string);
-
   /** Sets the speed of sound.
       @param speed the speed of sound in feet per second.
       */
   inline void Seta(double speed) { a = speed; }
 
-  /** Gets the name of the parameter given the index.
-      @param val_idx one of the enumerated JSBSim parameters.
-      @return the name of the parameter pointed to by the index.
-      */
-  string GetParameterName(eParam val_idx) {return paramdef[val_idx];}
-  
   /** Sets the current sim time.
       @param cur_time the current time
       @return the current time.
@@ -231,12 +202,6 @@ public:
       */
   inline void  Setdt(double delta_t) { dt = delta_t; }
 
-  /** Sets the JSBSim parameter to the supplied value.
-      @param prm the JSBSim parameter to set, i.e. FG_RUDDER_POS.
-      @param val the value to give the parameter.
-      */
-  void SetParameter(eParam prm, double val);
-
   /** Increments the simulation time.
       @return the new simulation time.
       */
@@ -308,6 +273,13 @@ public:
       configuration, etc.)
   */
   void ReportState(void);
+  
+  inline string GetPropertyName(string prm) { return ParamNameToProp[prm]; }
+  //inline string GetPropertyName(eParam prm) { return ParamIdxToProp[prm]; }
+  //inline eParam GetParam(string property) { return PropToParam[property]; }
+  
+  void bind();
+  void unbind();
 
 private:
   double a;                          // speed of sound
@@ -339,14 +311,26 @@ private:
   FGAerodynamics* Aerodynamics;
   FGGroundReactions* GroundReactions;
   FGPropulsion* Propulsion;
+  FGPropertyManager* PropertyManager;
 
-  typedef map<string, eParam> CoeffMap;
/*  typedef map<string, eParam> CoeffMap;
   CoeffMap coeffdef;
 
   typedef map<eParam, string> ParamMap;
-  ParamMap paramdef;
+  //ParamMap paramdef; */
+
+  
+  typedef map<string,string> ParamNameMap;
+  ParamNameMap ParamNameToProp;
+  
+  typedef map<eParam,string> ParamIdxMap;
+  ParamIdxMap ParamIdxToProp;
+  //CoeffMap PropToParam;
 
   int ActiveEngine;
+  
+  void InitPropertyMaps(void);
+  
   void Debug(int from);
 };