1 #ifndef _PISTONENGINE_HPP
2 #define _PISTONENGINE_HPP
8 // Initializes an engine from known "takeoff" parameters.
9 PistonEngine(float power, float spd);
10 void setTurboParams(float mul, float maxMP);
11 void setDisplacement(float d);
12 void setCompression(float c);
14 void setThrottle(float throttle);
15 void setStarter(bool starter);
16 void setMagnetos(int magnetos);
17 void setMixture(float mixture);
18 void setBoost(float boost); // fraction of turbo-mul used
21 void setRunning(bool r);
23 float getMaxPower(); // max sea-level power
25 void calc(float pressure, float temp, float speed);
34 // Static configuration:
35 float _power0; // reference power setting
36 float _omega0; // " engine speed
37 float _rho0; // " manifold air density
38 float _f0; // "ideal" fuel flow at P0/omega0
39 float _mixCoeff; // fuel flow per omega at full mixture
40 float _turbo; // (or super-)charger pressure multiplier
41 float _maxMP; // wastegate setting
42 float _displacement; // piston stroke volume
43 float _compression; // compression ratio (>1)
47 bool _starter; // true=engaged, false=disengaged
48 int _magnetos; // 0=off, 1=right, 2=left, 3=both
52 // Runtime state/output:
62 #endif // _PISTONENGINE_HPP