]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBsim/FGEngine.h
source tree reorganization prior to flightgear 0.7
[flightgear.git] / src / FDM / JSBsim / FGEngine.h
1 /*******************************************************************************
2
3  Header:       FGEngine.h
4  Author:       Jon S. Berndt
5  Date started: 01/21/99
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 FUNCTIONAL DESCRIPTION
27 --------------------------------------------------------------------------------
28
29 Based on Flightgear code, which is based on LaRCSim. This class simulates
30 a generic engine.
31
32 HISTORY
33 --------------------------------------------------------------------------------
34 01/21/99   JSB   Created
35
36 ********************************************************************************
37 SENTRY
38 *******************************************************************************/
39
40 #ifndef FGEngine_H
41 #define FGEngine_H
42
43 /*******************************************************************************
44 INCLUDES
45 *******************************************************************************/
46
47 #ifdef FGFS
48 #  include <Include/compiler.h>
49 #  include STL_STRING
50    FG_USING_STD(string);
51 #else
52 #  include <string>
53 #endif
54
55 /*******************************************************************************
56 DEFINES
57 *******************************************************************************/
58
59 using namespace std;
60
61 /*******************************************************************************
62 CLASS DECLARATION
63 *******************************************************************************/
64
65 class FGFDMExec;
66 class FGState;
67 class FGAtmosphere;
68 class FGFCS;
69 class FGAircraft;
70 class FGTranslation;
71 class FGRotation;
72 class FGPosition;
73 class FGAuxiliary;
74 class FGOutput;
75
76 class FGEngine
77 {
78 public:
79   FGEngine(FGFDMExec*, string, string, int);
80   ~FGEngine(void);
81
82   enum EngineType {etUnknown, etRocket, etPiston, etTurboProp, etTurboJet};
83
84   float  GetThrottle(void) {return Throttle;}
85   float  GetThrust(void) {return Thrust;}
86   bool   GetStarved(void) {return Starved;}
87   bool   GetFlameout(void) {return Flameout;}
88   int    GetType(void) {return Type;}
89   string GetName() {return Name;}
90
91   void SetStarved(bool tt) {Starved = tt;}
92   void SetStarved(void) {Starved = true;}
93
94   float CalcThrust(void);
95   float CalcFuelNeed(void);
96   float CalcOxidizerNeed(void);
97
98 private:
99   string Name;
100   EngineType Type;
101   float X, Y, Z;
102   float SLThrustMax;
103   float VacThrustMax;
104   float SLFuelFlowMax;
105   float SLOxiFlowMax;
106   float MaxThrottle;
107   float MinThrottle;
108
109   float Thrust;
110   float Throttle;
111   float FuelNeed, OxidizerNeed;
112   bool  Starved;
113   bool  Flameout;
114   float PctPower;
115   int   EngineNumber;
116
117   FGFDMExec*      FDMExec;
118   FGState*        State;
119   FGAtmosphere*   Atmosphere;
120   FGFCS*          FCS;
121   FGAircraft*     Aircraft;
122   FGTranslation*  Translation;
123   FGRotation*     Rotation;
124   FGPosition*     Position;
125   FGAuxiliary*    Auxiliary;
126   FGOutput*       Output;
127
128 protected:
129   float CalcRocketThrust(void);
130   float CalcPistonThrust(void);
131
132 };
133
134 /******************************************************************************/
135 #endif