#ifndef _PISTONENGINE_HPP
#define _PISTONENGINE_HPP
+#include "Engine.hpp"
+
namespace yasim {
-class PistonEngine {
+class PistonEngine : public Engine {
public:
+ virtual PistonEngine* isPistonEngine() { return this; }
+
// Initializes an engine from known "takeoff" parameters.
PistonEngine(float power, float spd);
void setTurboParams(float mul, float maxMP);
void setDisplacement(float d);
void setCompression(float c);
- void setThrottle(float throttle);
- void setMixture(float mixture);
- void setBoost(float boost); // fraction of turbo-mul used
-
- float getMaxPower(); // max sea-level power
-
- void calc(float pressure, float temp, float speed);
- float getTorque();
- float getFuelFlow();
+ bool isCranking();
float getMP();
float getEGT();
+ float getMaxPower(); // max sea-level power
+ float getBoost() { return _boostPressure; }
+ float getOilTemp() { return _oilTemp; }
+
+ virtual void calc(float pressure, float temp, float speed);
+ virtual void stabilize();
+ virtual void integrate(float dt);
+ virtual float getTorque();
+ virtual float getFuelFlow();
private:
// Static configuration:
float _displacement; // piston stroke volume
float _compression; // compression ratio (>1)
- // Runtime settables:
- float _throttle;
- float _mixture;
- float _boost;
-
// Runtime state/output:
float _mp;
float _torque;
float _fuelFlow;
float _egt;
+ float _boostPressure;
+ float _oilTemp;
+ float _oilTempTarget;
+ float _dOilTempdt;
};
}; // namespace yasim