2020-07-18 14:49:38 +00:00
|
|
|
# A350XWB Engine Parameter System by Joshua Davidson (it0uchpods/411), parts from Omega's A380-omega.
|
|
|
|
|
|
|
|
setlistener("/sim/signals/fdm-initialized", func {
|
|
|
|
setprop("/engines/engine[0]/thr", 0);
|
|
|
|
setprop("/engines/engine[1]/thr", 0);
|
2020-09-05 15:59:15 +00:00
|
|
|
}, 0, 0);
|
2020-07-18 14:49:38 +00:00
|
|
|
|
|
|
|
setlistener("/engines/engine[0]/n2", func {
|
|
|
|
var n2 = getprop("/engines/engine[0]/n2");
|
|
|
|
var thr = (n2-58)*(100/42);
|
|
|
|
if(thr < 0) {
|
|
|
|
thr = 0;
|
|
|
|
}
|
|
|
|
setprop("/engines/engine[0]/thr", thr);
|
2020-09-05 15:59:15 +00:00
|
|
|
}, 0, 0);
|
2020-07-18 14:49:38 +00:00
|
|
|
|
|
|
|
setlistener("/engines/engine[1]/n2", func {
|
|
|
|
var n2 = getprop("/engines/engine[1]/n2");
|
|
|
|
var thr = (n2-58)*(100/42);
|
|
|
|
if(thr < 0) {
|
|
|
|
thr = 0;
|
|
|
|
}
|
|
|
|
setprop("/engines/engine[1]/thr", thr);
|
2020-09-05 15:59:15 +00:00
|
|
|
}, 0, 0);
|
2020-07-18 14:49:38 +00:00
|
|
|
|
|
|
|
setlistener("/engines/engine[0]/egt-degf", func {
|
|
|
|
setprop("engines/engine[0]/egt-degc", (getprop("engines/engine[0]/egt-degf") - 32) / 1.8);
|
2020-09-05 15:59:15 +00:00
|
|
|
}, 0, 0);
|
2020-07-18 14:49:38 +00:00
|
|
|
|
|
|
|
setlistener("/engines/engine[1]/egt-degf", func {
|
|
|
|
setprop("engines/engine[1]/egt-degc", (getprop("engines/engine[1]/egt-degf") - 32) / 1.8);
|
2020-09-05 15:59:15 +00:00
|
|
|
}, 0, 0);
|
2020-07-18 14:49:38 +00:00
|
|
|
|
|
|
|
setlistener("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", func {
|
|
|
|
var rev = getprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad");
|
|
|
|
if (rev >= 5) {
|
|
|
|
setprop("/surface-positions/reverser-norm", 1);
|
|
|
|
} else {
|
|
|
|
setprop("/surface-positions/reverser-norm", 0);
|
|
|
|
}
|
2020-09-05 15:59:15 +00:00
|
|
|
}, 0, 0);
|
2020-07-18 14:49:38 +00:00
|
|
|
|
|
|
|
setlistener("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", func {
|
|
|
|
var rev = getprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad");
|
|
|
|
if (rev >= 5) {
|
|
|
|
setprop("/surface-positions/reverser-norm", 1);
|
|
|
|
} else {
|
|
|
|
setprop("/surface-positions/reverser-norm", 0);
|
|
|
|
}
|
2020-09-05 15:59:15 +00:00
|
|
|
}, 0, 0);
|