00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef FGFUNCTION_H
00031 #define FGFUNCTION_H
00032
00033
00034
00035
00036
00037 #include <vector>
00038 #include <string>
00039 #include "FGParameter.h"
00040 #include <input_output/FGXMLElement.h>
00041 #include <input_output/FGPropertyManager.h>
00042
00043
00044
00045
00046
00047 #define ID_FUNCTION "$Id: FGFunction.h,v 1.16 2009/03/04 13:13:36 jberndt Exp $"
00048
00049
00050
00051
00052
00053 namespace JSBSim {
00054
00055
00056
00057
00058
00143
00144
00145
00146
00147
00148
00149 class FGFunction : public FGParameter
00150 {
00151 public:
00152
00168 FGFunction(FGPropertyManager* PropertyManager, Element* element, string prefix="");
00170 virtual ~FGFunction();
00171
00174 double GetValue(void) const;
00175
00178 string GetValueAsString(void) const;
00179
00181 string GetName(void) const {return Name;}
00182
00189 void cacheValue(bool shouldCache);
00190
00191 private:
00192 vector <FGParameter*> Parameters;
00193 FGPropertyManager* const PropertyManager;
00194 bool cached;
00195 string Prefix;
00196 string description_string;
00197 string property_string;
00198 string value_string;
00199 string table_string;
00200 string p_string;
00201 string v_string;
00202 string t_string;
00203 string function_string;
00204 string sum_string;
00205 string difference_string;
00206 string product_string;
00207 string quotient_string;
00208 string pow_string;
00209 string exp_string;
00210 string abs_string;
00211 string sin_string;
00212 string cos_string;
00213 string tan_string;
00214 string asin_string;
00215 string acos_string;
00216 string atan_string;
00217 string atan2_string;
00218 string min_string;
00219 string max_string;
00220 string avg_string;
00221 string fraction_string;
00222 string mod_string;
00223 string random_string;
00224 string integer_string;
00225 double cachedValue;
00226 enum functionType {eTopLevel=0, eProduct, eDifference, eSum, eQuotient, ePow,
00227 eExp, eAbs, eSin, eCos, eTan, eASin, eACos, eATan, eATan2,
00228 eMin, eMax, eAvg, eFrac, eInteger, eMod, eRandom} Type;
00229 string Name;
00230 void bind(void);
00231 void Debug(int from);
00232 };
00233
00234 }
00235
00236 #endif