76 lines
2.2 KiB
C
76 lines
2.2 KiB
C
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
|
||
|
Header: FGFunction.h
|
||
|
Author: Jon Berndt
|
||
|
Date started: August 25 2004
|
||
|
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
SENTRY
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||
|
|
||
|
#ifndef FGFUNCTION_H
|
||
|
#define FGFUNCTION_H
|
||
|
|
||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
INCLUDES
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||
|
|
||
|
#include <vector>
|
||
|
#include <string>
|
||
|
#include "FGParameter.h"
|
||
|
#include <input_output/FGXMLElement.h>
|
||
|
#include <input_output/FGPropertyManager.h>
|
||
|
|
||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
DEFINITIONS
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||
|
|
||
|
#define ID_FUNCTION "$Id$"
|
||
|
|
||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
FORWARD DECLARATIONS
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||
|
|
||
|
namespace JSBSim {
|
||
|
|
||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
CLASS DOCUMENTATION
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||
|
|
||
|
/** Represents various types of parameters.
|
||
|
@author Jon Berndt
|
||
|
*/
|
||
|
|
||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
DECLARATION: FGFunction
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||
|
|
||
|
class FGFunction : public FGParameter
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
FGFunction(FGPropertyManager* propMan, Element* el, string prefix="");
|
||
|
~FGFunction();
|
||
|
|
||
|
double GetValue(void) const;
|
||
|
string GetValueAsString(void) const;
|
||
|
string GetName(void) const {return Name;}
|
||
|
void cacheValue(bool);
|
||
|
|
||
|
private:
|
||
|
vector <FGParameter*> Parameters;
|
||
|
FGPropertyManager* const PropertyManager;
|
||
|
bool cached;
|
||
|
string Prefix;
|
||
|
double cachedValue;
|
||
|
enum functionType {eTopLevel=0, eProduct, eDifference, eSum, eQuotient, ePow,
|
||
|
eAbs, eSin, eCos, eTan, eASin, eACos, eATan, eATan2} Type;
|
||
|
string Name;
|
||
|
void bind(void);
|
||
|
void Debug(int from);
|
||
|
};
|
||
|
|
||
|
} // namespace JSBSim
|
||
|
|
||
|
#endif
|