1 /*******************************************************************************
3 Header: FGCoefficient.h
7 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 You should have received a copy of the GNU General Public License along with
20 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21 Place - Suite 330, Boston, MA 02111-1307, USA.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
27 --------------------------------------------------------------------------------
30 ********************************************************************************
32 *******************************************************************************/
34 #ifndef FGCOEFFICIENT_H
35 #define FGCOEFFICIENT_H
37 /*******************************************************************************
39 *******************************************************************************/
42 # include <simgear/compiler.h>
47 #include "FGConfigFile.h"
50 /*******************************************************************************
52 *******************************************************************************/
54 /*******************************************************************************
56 *******************************************************************************/
68 /*******************************************************************************
69 COMMENTS, REFERENCES, and NOTES
70 ********************************************************************************
72 This class models the stability derivative coefficient lookup tables or
73 equations. Note that the coefficients need not be calculated each delta-t.
90 FG_ELEVATOR_POS 32768L
93 FG_SPDBRAKE_POS 262144L
95 FG_ELEVATOR_CMD 1048576L
96 FG_AILERON_CMD 2097152L
97 FG_RUDDER_CMD 4194304L
98 FG_SPDBRAKE_CMD 8388608L
99 FG_FLAPS_CMD 16777216L
105 FG_SPARE6 1073741824L
107 The above definitions are found in FGDefs.h
109 ********************************************************************************
111 *******************************************************************************/
116 FGCoefficient(FGFDMExec*, FGConfigFile*);
117 ~FGCoefficient(void);
119 bool Allocate(int, int);
120 float Value(float, float);
123 float TotalValue(void);
124 inline string Getname(void) {return name;}
125 inline float GetSD(void) {return SD;}
126 // inline float GetSDValue(void) {return SD;}
127 // inline void SetSDValue(float tt) {SD = tt;}
128 inline long int Getmultipliers(void) {return multipliers;}
130 enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
143 float LookupR, LookupC;
144 long int multipliers;
145 long int mult_idx[10];
149 float SD; // Actual stability derivative (or other coefficient) value
153 FGAtmosphere* Atmosphere;
155 FGAircraft* Aircraft;
156 FGTranslation* Translation;
157 FGRotation* Rotation;
158 FGPosition* Position;
159 FGAuxiliary* Auxiliary;
163 /******************************************************************************/