]> git.mxchange.org Git - flightgear.git/blob - JSBsim/FGEngine.h
bafc38ebcab6bc7f33f6a92b4435266806b01305
[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 /*******************************************************************************
48 DEFINES
49 *******************************************************************************/
50
51 /*******************************************************************************
52 CLASS DECLARATION
53 *******************************************************************************/
54
55 class FGFDMExec;
56 class FGState;
57 class FGAtmosphere;
58 class FGFCS;
59 class FGAircraft;
60 class FGTranslation;
61 class FGRotation;
62 class FGPosition;
63 class FGAuxiliary;
64 class FGOutput;
65
66 class FGEngine
67 {
68 public:
69   FGEngine(FGFDMExec*, char*, int);
70   ~FGEngine(void);
71
72   float GetThrust(void) {return Thrust;}
73   bool  GetStarved(void) {return Starved;}
74   bool  GetFlameout(void) {return Flameout;}
75   float GetThrottle(void) {return Throttle;}
76   char* GetName() {return Name;}
77
78   void SetStarved(bool tt) {Starved = tt;}
79   void SetStarved(void) {Starved = true;}
80
81   int GetType(void) {return Type;}
82
83   float CalcThrust(void);
84   float CalcFuelNeed(void);
85   float CalcOxidizerNeed(void);
86
87 private:
88   char  Name[30];
89   float X, Y, Z;
90   int   Type;
91   float SLThrustMax;
92   float VacThrustMax;
93   float SLFuelFlowMax;
94   float SLOxiFlowMax;
95   float MaxThrottle;
96   float MinThrottle;
97
98   float Thrust;
99   float Throttle;
100   float FuelNeed, OxidizerNeed;
101   bool  Starved;
102   bool  Flameout;
103   float PctPower;
104   int   EngineNumber;
105
106   FGFDMExec*      FDMExec;
107   FGState*        State;
108   FGAtmosphere*   Atmosphere;
109   FGFCS*          FCS;
110   FGAircraft*     Aircraft;
111   FGTranslation*  Translation;
112   FGRotation*     Rotation;
113   FGPosition*     Position;
114   FGAuxiliary*    Auxiliary;
115   FGOutput*       Output;
116   
117 protected:
118   float CalcRocketThrust(void);
119   float CalcPistonThrust(void);
120
121 };
122
123 /******************************************************************************/
124 #endif