]> git.mxchange.org Git - flightgear.git/blob - JSBsim/FGEngine.h
MSVC++ portability tweaks contributed by Bernie Bright.
[flightgear.git] / 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 /*******************************************************************************
60 CLASS DECLARATION
61 *******************************************************************************/
62
63 class FGFDMExec;
64 class FGState;
65 class FGAtmosphere;
66 class FGFCS;
67 class FGAircraft;
68 class FGTranslation;
69 class FGRotation;
70 class FGPosition;
71 class FGAuxiliary;
72 class FGOutput;
73
74 class FGEngine
75 {
76 public:
77   FGEngine(FGFDMExec*, string, string, int);
78   ~FGEngine(void);
79
80   enum EngineType {etUnknown, etRocket, etPiston, etTurboProp, etTurboJet};
81
82   float  GetThrottle(void) {return Throttle;}
83   float  GetThrust(void) {return Thrust;}
84   bool   GetStarved(void) {return Starved;}
85   bool   GetFlameout(void) {return Flameout;}
86   int    GetType(void) {return Type;}
87   string GetName() {return Name;}
88
89   void SetStarved(bool tt) {Starved = tt;}
90   void SetStarved(void) {Starved = true;}
91
92   float CalcThrust(void);
93   float CalcFuelNeed(void);
94   float CalcOxidizerNeed(void);
95
96 private:
97   string Name;
98   EngineType Type;
99   float X, Y, Z;
100   float SLThrustMax;
101   float VacThrustMax;
102   float SLFuelFlowMax;
103   float SLOxiFlowMax;
104   float MaxThrottle;
105   float MinThrottle;
106
107   float Thrust;
108   float Throttle;
109   float FuelNeed, OxidizerNeed;
110   bool  Starved;
111   bool  Flameout;
112   float PctPower;
113   int   EngineNumber;
114
115   FGFDMExec*      FDMExec;
116   FGState*        State;
117   FGAtmosphere*   Atmosphere;
118   FGFCS*          FCS;
119   FGAircraft*     Aircraft;
120   FGTranslation*  Translation;
121   FGRotation*     Rotation;
122   FGPosition*     Position;
123   FGAuxiliary*    Auxiliary;
124   FGOutput*       Output;
125
126 protected:
127   float CalcRocketThrust(void);
128   float CalcPistonThrust(void);
129
130 };
131
132 /******************************************************************************/
133 #endif