]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/PropEngine.hpp
Moved JSBSim.hxx to src/FDM/JSBSim/
[flightgear.git] / src / FDM / YASim / PropEngine.hpp
1 #ifndef _PROPENGINE_HPP
2 #define _PROPENGINE_HPP
3
4 #include "Thruster.hpp"
5
6 namespace yasim {
7
8 class Propeller;
9 class PistonEngine;
10
11 class PropEngine : public Thruster {
12 public:
13     PropEngine(Propeller* prop, PistonEngine* eng, float moment);
14     virtual ~PropEngine();
15
16     void setMagnetos(int magnetos);
17     void setAdvance(float advance);
18     void setVariableProp(float min, float max);
19
20     virtual PropEngine* getPropEngine() { return this; }
21     virtual PistonEngine* getPistonEngine() { return _eng; }
22     virtual Propeller* getPropeller() { return _prop; }
23
24     // Dynamic output
25     virtual bool isRunning();
26     virtual bool isCranking();
27     virtual void getThrust(float* out);
28     virtual void getTorque(float* out);
29     virtual void getGyro(float* out);
30     virtual float getFuelFlow();
31
32     // Runtime instructions
33     virtual void integrate(float dt);
34     virtual void stabilize();
35
36     float getOmega();
37     
38 private:
39     float _moment;
40     Propeller* _prop;
41     PistonEngine* _eng;
42
43     bool _variable;
44     int _magnetos;  // 0=off, 1=right, 2=left, 3=both
45     float _advance; // control input, 0-1
46     float _maxOmega;
47     float _minOmega;
48
49     float _omega; // RPM, in radians/sec
50     float _thrust[3];
51     float _torque[3];
52     float _gyro[3];
53     float _fuelFlow;
54 };
55
56 }; // namespace yasim
57 #endif // _PROPENGINE_HPP