]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGCoefficient.h
Friday the 13th JSBSim update ... :-0 !!!
[flightgear.git] / src / FDM / JSBSim / FGCoefficient.h
1 /*******************************************************************************
2
3  Header:       FGCoefficient.h
4  Author:       Jon Berndt
5  Date started: 12/28/98
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8
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
12  version.
13
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
17  details.
18
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.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 12/28/98   JSB   Created
29
30 ********************************************************************************
31 SENTRY
32 *******************************************************************************/
33
34 #ifndef FGCOEFFICIENT_H
35 #define FGCOEFFICIENT_H
36
37 /*******************************************************************************
38 INCLUDES
39 *******************************************************************************/
40
41 #ifdef FGFS
42 #  include <simgear/compiler.h>
43 #endif
44
45 #include <vector>
46 #include <string>
47 #include "FGConfigFile.h"
48 #include "FGDefs.h"
49
50 /*******************************************************************************
51 DEFINES
52 *******************************************************************************/
53
54 #define ID_COEFFICIENT "$Header"
55
56 /*******************************************************************************
57 FORWARD DECLARATIONS
58 *******************************************************************************/
59
60 class FGFDMExec;
61 class FGState;
62 class FGAtmosphere;
63 class FGFCS;
64 class FGAircraft;
65 class FGTranslation;
66 class FGRotation;
67 class FGPosition;
68 class FGAuxiliary;
69 class FGOutput;
70
71 /*******************************************************************************
72 COMMENTS, REFERENCES,  and NOTES
73 ********************************************************************************
74
75 This class models the stability derivative coefficient lookup tables or 
76 equations. Note that the coefficients need not be calculated each delta-t.
77
78 ********************************************************************************
79 CLASS DECLARATION
80 *******************************************************************************/
81
82 using std::vector;
83
84 class FGCoefficient
85 {
86   typedef vector <eParam> MultVec;
87   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
88
89   int numInstances;
90   string filename;
91   string description;
92   string name;
93   string method;
94   float StaticValue;
95   float **Table;
96   eParam LookupR, LookupC;
97   MultVec multipliers;
98   int rows, columns;
99   Type type;
100   float SD; // Actual stability derivative (or other coefficient) value
101
102   FGFDMExec*      FDMExec;
103   FGState*        State;
104   FGAtmosphere*   Atmosphere;
105   FGFCS*          FCS;
106   FGAircraft*     Aircraft;
107   FGTranslation*  Translation;
108   FGRotation*     Rotation;
109   FGPosition*     Position;
110   FGAuxiliary*    Auxiliary;
111   FGOutput*       Output;
112   
113   bool DeAllocate(void);
114   bool Allocate(int, int);
115
116 public:
117   FGCoefficient(FGFDMExec*, FGConfigFile*);
118   ~FGCoefficient(void);
119   
120   float Value(float, float);
121   float Value(float);
122   float Value(void);
123   float TotalValue(void);
124   inline string Getname(void) {return name;}
125   inline float GetSD(void) {return SD;}
126   inline MultVec Getmultipliers(void) {return multipliers;}
127   void DumpSD(void);
128
129 };
130
131 /******************************************************************************/
132 #endif