]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGEngine.h
Updates from the Jon and Tony show.
[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 BrakeHorsePower;
110   float SpeedSlope;
111   float SpeedIntercept;
112   float AltitudeSlope;
113
114   float Thrust;
115   float Throttle;
116   float FuelNeed, OxidizerNeed;
117   bool  Starved;
118   bool  Flameout;
119   float PctPower;
120   int   EngineNumber;
121
122   FGFDMExec*      FDMExec;
123   FGState*        State;
124   FGAtmosphere*   Atmosphere;
125   FGFCS*          FCS;
126   FGAircraft*     Aircraft;
127   FGTranslation*  Translation;
128   FGRotation*     Rotation;
129   FGPosition*     Position;
130   FGAuxiliary*    Auxiliary;
131   FGOutput*       Output;
132
133 protected:
134   float CalcRocketThrust(void);
135   float CalcPistonThrust(void);
136
137 };
138
139 /******************************************************************************/
140 #endif