]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Jet.hpp
Added minimal support for magnetos, so that engines can be shut off.
[flightgear.git] / src / FDM / YASim / Jet.hpp
1 #ifndef _JET_HPP
2 #define _JET_HPP
3
4 #include "Thruster.hpp"
5
6 namespace yasim {
7
8 class Jet : public Thruster {
9 public:
10     Jet();
11
12     virtual Jet* getJet() { return this; }
13     
14     void setMaxThrust(float thrust, float afterburner=0);
15     void setVMax(float spd);
16     void setTSFC(float tsfc);
17     void setRPMs(float idleN1, float maxN1, float idleN2, float maxN2);
18     void setEGT(float takeoffEGT);
19     void setEPR(float takeoffEPR);
20     void setVectorAngle(float angle);
21
22     // The time it takes the engine to reach 90% thrust from idle
23     void setSpooling(float time);
24
25     // Sets the reheat control
26     void setReheat(float reheat);
27
28     // Sets the thrust vector control (0-1)
29     void setRotation(float rot);
30
31     float getN1();
32     float getN2();
33     float getEPR();
34     float getEGT();
35
36     // From Thruster:
37     virtual bool isRunning();
38     virtual bool isCranking();
39     virtual void getThrust(float* out);
40     virtual void getTorque(float* out);
41     virtual void getGyro(float* out);
42     virtual float getFuelFlow();
43     virtual void integrate(float dt);
44     virtual void stabilize();
45
46 private:
47     float _reheat;
48
49     float _maxThrust; // Max dry thrust at sea level
50     float _abFactor;  // Afterburner thrust multiplier
51
52     float _maxRot;
53     float _rotControl;
54
55     float _decay;  // time constant for the exponential integration
56     float _vMax;   // speed at which thrust is zero
57     float _epr0;   // EPR at takeoff thrust
58     float _tsfc;   // TSFC ((lb/hr)/lb) at takeoff thrust and zero airspeed
59     float _egt0;   // EGT at takeoff thrust
60     float _n1Min;  // N1 at ground idle
61     float _n1Max;  // N1 at takeoff thrust
62     float _n2Min;  // N2 at ground idle
63     float _n2Max;  // N2 at takeoff thrust
64
65     bool _running;   // Is the engine running?
66     bool _cranking;  // Is the engine cranking?
67     float _thrust;   // Current thrust
68     float _epr;      // Current EPR
69     float _n1;       // Current UNCORRECTED N1 (percent)
70     float _n2;       // Current UNCORRECTED N2 (percent)
71     float _fuelFlow; // Current UNCORRECTED fuel flow (kg/s)
72     float _egt;      // Current UNCORRECTED EGT (kelvin)
73
74     float _tempCorrect; // Intake temp / std temp (273 K)
75     float _pressureCorrect; // Intake pressure / std pressure
76 };
77
78 }; // namespace yasim
79 #endif // _JET_HPP