A3XX: Fix bug where MCDU locks you out after pushing MCDU

This commit is contained in:
Joshua Davidson 2017-08-01 20:19:34 -04:00
parent 9c2ff8e51d
commit ba639551a0
2 changed files with 26 additions and 14 deletions

View file

@ -77,16 +77,22 @@ var MCDU_reset = func {
var lskbutton = func(btn) {
if (btn == "1") {
if (getprop("/MCDU[0]/page") == "MCDU" and getprop("/MCDU[0]/active") != 2) {
setprop("/MCDU[0]/scratchpad-msg", "1");
setprop("/MCDU[0]/scratchpad", "WAIT FOR SYSTEM RESPONSE");
setprop("/MCDU[0]/active", 1);
settimer(func(){
if (getprop("/MCDU[0]/page") == "MCDU") {
if (getprop("/MCDU[0]/active") != 2) {
setprop("/MCDU[0]/scratchpad-msg", "1");
setprop("/MCDU[0]/scratchpad", "WAIT FOR SYSTEM RESPONSE");
setprop("/MCDU[0]/active", 1);
settimer(func(){
setprop("/MCDU[0]/page", getprop("/MCDU[0]/last-fmgc-page"));
setprop("/MCDU[0]/scratchpad", "");
setprop("/MCDU[0]/scratchpad-msg", "0");
setprop("/MCDU[0]/active", 2);
}, 2);
} else {
setprop("/MCDU[0]/page", getprop("/MCDU[0]/last-fmgc-page"));
setprop("/MCDU[0]/scratchpad", "");
setprop("/MCDU[0]/scratchpad-msg", "0");
setprop("/MCDU[0]/active", 2);
}, 2);
}
} else if (getprop("/MCDU[0]/page") == "TO") {
perfTOInput("L1");
} else if (getprop("/MCDU[0]/page") == "RADNAV") {

View file

@ -77,16 +77,22 @@ var MCDU_reset = func {
var lskbutton = func(btn) {
if (btn == "1") {
if (getprop("/MCDU[1]/page") == "MCDU" and getprop("/MCDU[1]/active") != 2) {
setprop("/MCDU[1]/scratchpad-msg", "1");
setprop("/MCDU[1]/scratchpad", "WAIT FOR SYSTEM RESPONSE");
setprop("/MCDU[1]/active", 1);
settimer(func(){
if (getprop("/MCDU[1]/page") == "MCDU") {
if (getprop("/MCDU[1]/active") != 2) {
setprop("/MCDU[1]/scratchpad-msg", "1");
setprop("/MCDU[1]/scratchpad", "WAIT FOR SYSTEM RESPONSE");
setprop("/MCDU[1]/active", 1);
settimer(func(){
setprop("/MCDU[1]/page", getprop("/MCDU[1]/last-fmgc-page"));
setprop("/MCDU[1]/scratchpad", "");
setprop("/MCDU[1]/scratchpad-msg", "0");
setprop("/MCDU[1]/active", 2);
}, 2);
} else {
setprop("/MCDU[1]/page", getprop("/MCDU[1]/last-fmgc-page"));
setprop("/MCDU[1]/scratchpad", "");
setprop("/MCDU[1]/scratchpad-msg", "0");
setprop("/MCDU[1]/active", 2);
}, 2);
}
} else if (getprop("/MCDU[1]/page") == "TO") {
perfTOInput("L1");
} else if (getprop("/MCDU[1]/page") == "RADNAV") {