]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/PistonEngine.hpp
-Removed .cvsignore from itself, since .cvsignore is now in the CVS
[flightgear.git] / src / FDM / YASim / PistonEngine.hpp
1 #ifndef _PISTONENGINE_HPP
2 #define _PISTONENGINE_HPP
3
4 namespace yasim {
5
6 class PistonEngine {
7 public:
8     // Initializes an engine from known "takeoff" parameters.
9     PistonEngine(float power, float spd);
10     void setTurboParams(float mul, float maxMP);
11
12     void setThrottle(float throttle);
13     void setMixture(float mixture);
14
15     float getPower();
16
17     // Calculates power output and fuel flow, based on a given
18     // throttle setting (0-1 corresponding to the fraction of
19     // "available" manifold pressure), mixture (fuel flux per rpm,
20     // 0-1, where 1 is "max rich", or a little bit more than needed
21     // for rated power at sea level)
22     void calc(float pressure, float temp, float speed,
23               float* powerOut, float* fuelFlowOut);
24
25 private:
26     float _power0;   // reference power setting
27     float _omega0;   //   "       engine speed
28     float _rho0;     //   "       manifold air density
29     float _f0;       // "ideal" fuel flow at P0/omega0
30     float _mixCoeff; // fuel flow per omega at full mixture
31
32     // Runtime settables:
33     float _throttle;
34     float _mixture;
35
36     float _turbo;
37     float _maxMP;
38 };
39
40 }; // namespace yasim
41 #endif // _PISTONENGINE_HPP