From ba639551a0ff2fe761dd89c1f14401573f28df30 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Tue, 1 Aug 2017 20:19:34 -0400 Subject: [PATCH] A3XX: Fix bug where MCDU locks you out after pushing MCDU --- Nasal/MCDU1/MCDU.nas | 20 +++++++++++++------- Nasal/MCDU2/MCDU.nas | 20 +++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Nasal/MCDU1/MCDU.nas b/Nasal/MCDU1/MCDU.nas index a1f181af..263ed2a7 100644 --- a/Nasal/MCDU1/MCDU.nas +++ b/Nasal/MCDU1/MCDU.nas @@ -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") { diff --git a/Nasal/MCDU2/MCDU.nas b/Nasal/MCDU2/MCDU.nas index e5c81ff9..0863f8c8 100644 --- a/Nasal/MCDU2/MCDU.nas +++ b/Nasal/MCDU2/MCDU.nas @@ -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") {