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
20 float getMaxPower(); // max sea-level power
22 void calc(float pressure, float temp, float speed);
31 // Static configuration:
32 float _power0; // reference power setting
33 float _omega0; // " engine speed
34 float _rho0; // " manifold air density
35 float _f0; // "ideal" fuel flow at P0/omega0
36 float _mixCoeff; // fuel flow per omega at full mixture
37 float _turbo; // (or super-)charger pressure multiplier
38 float _maxMP; // wastegate setting
39 float _displacement; // piston stroke volume
40 float _compression; // compression ratio (>1)
44 bool _starter; // true=engaged, false=disengaged
45 int _magnetos; // 0=off, 1=right, 2=left, 3=both
49 // Runtime state/output:
59 #endif // _PISTONENGINE_HPP