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