Added auto call of door, wheel and crz page

Signed-off-by: merspieler <merspieler@airmail.cc>
This commit is contained in:
merspieler 2018-09-14 15:35:05 +02:00
parent 10d786e989
commit c3399a9954

View file

@ -18,6 +18,7 @@ var ECAM = {
setprop("/ECAM/ldg-memo-enable", 0);
setprop("/ECAM/Lower/page", "door");
setprop("/ECAM/Lower/man-select", 0);
setprop("/ECAM/Lower/fault-select", 0);
setprop("/ECAM/Lower/light/apu", 0);
setprop("/ECAM/Lower/light/bleed", 0);
setprop("/ECAM/Lower/light/cond", 0);
@ -158,6 +159,7 @@ var LowerECAM = {
button: func(b) {
var man_sel = getprop("/ECAM/Lower/man-select");
if(!getprop("/ECAM/lower/fault-select")) {
if(!man_sel) {
setprop("/ECAM/Lower/man-select", 1);
setprop("/ECAM/Lower/page", b);
@ -173,18 +175,29 @@ var LowerECAM = {
setprop("/ECAM/Lower/light/" ~ b, 1);
}
}
}
},
loop: func() {
var man_sel = getprop("/ECAM/Lower/man-select");
var fault_sel = getprop("/ECAM/Lower/fault-select");
if(!man_sel) {
if(!fault_sel) {
#TODO auto select page for ENG, F/CTL and APU
if(((getprop("/engines/engine[0]/n2-actual") >= 59 or getprop("/engines/engine[1]/n2-actual") >= 59) and getprop("/gear/gear[1]/wow") == 1) or (getprop("/instrumentation/altimeter/indicated-altitude-ft") <= 16000 and getprop("/controls/gear/gear-down") == 1 and getprop("/gear/gear[1]/wow") == 0)) {
setprop("/ECAM/Lower/page", "wheel");
} else if(getprop("/gear/gear[1]/wow") == 1) {
setprop("/ECAM/Lower/page", "door");
} else {
setprop("/ECAM/Lower/page", "crz");
#TODO auto select page
}
}
}
},
reset: func() {
setprop("/ECAM/Lower/page", "door");
setprop("/ECAM/Lower/man-select", 0);
setprop("/ECAM/Lower/fault-select", 0);
setprop("/ECAM/Lower/light/apu", 0);
setprop("/ECAM/Lower/light/bleed", 0);
setprop("/ECAM/Lower/light/cond", 0);