X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FYASim%2FPropEngine.hpp;h=7b43254707a5a6dcbfdd4d442a270964bab37a68;hb=d66903e9ad63b91182ccc25d9bb82f18f8dd98b6;hp=481552a29343d8cb73bad5876aafe58532a8b3d1;hpb=5b84ae51a54afb63effb8841ed08643bb5701aa7;p=flightgear.git diff --git a/src/FDM/YASim/PropEngine.hpp b/src/FDM/YASim/PropEngine.hpp index 481552a29..7b4325470 100644 --- a/src/FDM/YASim/PropEngine.hpp +++ b/src/FDM/YASim/PropEngine.hpp @@ -2,34 +2,59 @@ #define _PROPENGINE_HPP #include "Thruster.hpp" +#include "Engine.hpp" namespace yasim { class Propeller; -class PistonEngine; class PropEngine : public Thruster { public: - PropEngine(Propeller* prop, PistonEngine* eng, float moment); + PropEngine(Propeller* prop, Engine* eng, float moment); virtual ~PropEngine(); - - virtual Thruster* clone(); + + void setEngine(Engine* eng) { delete _eng; _eng = eng; } + + void setMagnetos(int magnetos); + void setAdvance(float advance); + void setPropPitch(float proppitch); + void setVariableProp(float min, float max); + void setPropFeather(int state); + void setGearRatio(float ratio) { _gearRatio = ratio; } + void setContraPair(bool contra) { _contra = contra; } + + virtual PropEngine* getPropEngine() { return this; } + virtual Engine* getEngine() { return _eng; } + virtual Propeller* getPropeller() { return _prop; } // Dynamic output + virtual bool isRunning(); + virtual bool isCranking(); virtual void getThrust(float* out); virtual void getTorque(float* out); virtual void getGyro(float* out); virtual float getFuelFlow(); // Runtime instructions + virtual void init(); virtual void integrate(float dt); + virtual void stabilize(); float getOmega(); + void setOmega (float omega); private: float _moment; Propeller* _prop; - PistonEngine* _eng; + Engine* _eng; + + bool _variable; + bool _contra; // contra-rotating propeller pair + int _magnetos; // 0=off, 1=right, 2=left, 3=both + float _gearRatio; + float _advance; // control input, 0-1 + float _maxOmega; + float _minOmega; float _omega; // RPM, in radians/sec float _thrust[3];