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