]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/PistonEngine.hpp
Add support for a turbo prop condition lever.
[flightgear.git] / src / FDM / YASim / PistonEngine.hpp
index 1e61da539a511c860c6d9cdb0eb52984a573e8f1..2df500d9936b86f15f6f7f59a2c1f31689864710 100644 (file)
@@ -1,34 +1,28 @@
 #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 setStarter(bool starter);
-    void setMagnetos(int magnetos);
-    void setMixture(float mixture);
-    void setBoost(float boost); // fraction of turbo-mul used
-
-    // For solver use
-    void setRunning(bool r);
-
-    float getMaxPower(); // max sea-level power
-
-    void calc(float pressure, float temp, float speed);
-    bool isRunning();
     bool isCranking();
-    float getTorque();
-    float getFuelFlow();
     float getMP();
     float getEGT();
+    float getMaxPower(); // max sea-level power
+
+    virtual void calc(float pressure, float temp, float speed);
+    virtual float getTorque();
+    virtual float getFuelFlow();
 
 private:
     // Static configuration:
@@ -42,16 +36,7 @@ private:
     float _displacement; // piston stroke volume
     float _compression;  // compression ratio (>1)
 
-    // Runtime settables:
-    float _throttle;
-    bool _starter; // true=engaged, false=disengaged
-    int _magnetos; // 0=off, 1=right, 2=left, 3=both
-    float _mixture;
-    float _boost;
-
     // Runtime state/output:
-    bool _running;
-    bool _cranking;
     float _mp;
     float _torque;
     float _fuelFlow;