/** 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>
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
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; }
/// 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.
*/
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.
*/
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
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);
};