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 *******************************************************************************/
41 # include <simgear/compiler.h>
49 #include "FGConfigFile.h"
52 /*******************************************************************************
54 *******************************************************************************/
58 /*******************************************************************************
60 *******************************************************************************/
72 /*******************************************************************************
73 COMMENTS, REFERENCES, and NOTES
74 ********************************************************************************
76 This class models the stability derivative coefficient lookup tables or
77 equations. Note that the coefficients need not be calculated each delta-t.
94 FG_ELEVATOR_POS 32768L
97 FG_SPDBRAKE_POS 262144L
99 FG_ELEVATOR_CMD 1048576L
100 FG_AILERON_CMD 2097152L
101 FG_RUDDER_CMD 4194304L
102 FG_SPDBRAKE_CMD 8388608L
103 FG_FLAPS_CMD 16777216L
109 FG_SPARE6 1073741824L
111 The above definitions are found in FGDefs.h
113 ********************************************************************************
115 *******************************************************************************/
120 FGCoefficient(FGFDMExec*, FGConfigFile*);
121 ~FGCoefficient(void);
123 bool Allocate(int, int);
124 float Value(float, float);
127 float TotalValue(void);
128 inline float GetSDValue(void) {return SD;}
129 inline void SetSDValue(float tt) {SD = tt;}
130 inline long int Getmultipliers(void) {return multipliers;}
132 enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
145 float LookupR, LookupC;
146 long int multipliers;
147 long int mult_idx[10];
151 float SD; // Actual stability derivative (or other coefficient) value
155 FGAtmosphere* Atmosphere;
157 FGAircraft* Aircraft;
158 FGTranslation* Translation;
159 FGRotation* Rotation;
160 FGPosition* Position;
161 FGAuxiliary* Auxiliary;
165 /******************************************************************************/