From 0b44b47a7d71d4f443d2d123d4f08975d90ce2b0 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 29 Jul 2021 23:40:38 +0100 Subject: [PATCH] Bugfix MCDU scratchpad / message queue --- Nasal/FMGC/mcdu-messages.nas | 3 ++- Nasal/MCDU/MCDU.nas | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Nasal/FMGC/mcdu-messages.nas b/Nasal/FMGC/mcdu-messages.nas index b3274ff5..f7643d6e 100644 --- a/Nasal/FMGC/mcdu-messages.nas +++ b/Nasal/FMGC/mcdu-messages.nas @@ -190,6 +190,7 @@ var MessageController = { TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),TypeIIMessage.new("V1/VR/V2 DISAGREE", "amb", 0), TypeIIMessage.new("TO SPEED TOO LOW", "amb", 0), TypeIIMessage.new("CHECK DEST DATA", "amb", 0), #p.533 + TypeIIMessage.new("GPS PRIMARY"),TypeIIMessage.new("GPS PRIMARY LOST", "amb", 0), ]), # to speed to low - new on a320, margin against vmcg / vs1g @@ -202,7 +203,7 @@ var MessageController = { }, getMsgByText: func(text, theVector) { foreach (var message; theVector) { - if (message.msgText = text) { + if (message.msgText == text) { return message; } } diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index d092eca9..5e130ad7 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -217,14 +217,14 @@ var lskbutton = func(btn, i) { setprop("/MCDU[" ~ i ~ "]/active", 1); settimer(func(){ pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); - mcdu_scratchpad.scratchpads[i].empty(); + mcdu_scratchpad.scratchpads[i].clear(); setprop("/MCDU[" ~ i ~ "]/active", 2); setprop("/MCDU[" ~ i ~ "]/active-system","fmgc"); }, 2); } else { pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); setprop("/MCDU[" ~ i ~ "]/active-system","fmgc"); - mcdu_scratchpad.scratchpads[i].empty(); + mcdu_scratchpad.scratchpads[i].clear(); } } } else if (page == "IRSINIT") { @@ -377,14 +377,14 @@ var lskbutton = func(btn, i) { setprop("/MCDU[" ~ i ~ "]/atsu-active", 1); settimer(func(){ pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page")); - mcdu_scratchpad.scratchpads[i].empty(); + mcdu_scratchpad.scratchpads[i].clear(); setprop("/MCDU[" ~ i ~ "]/atsu-active", 2); setprop("/MCDU[" ~ i ~ "]/active-system","atsu"); }, 2); } else { pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page")); setprop("/MCDU[" ~ i ~ "]/active-system","atsu"); - mcdu_scratchpad.scratchpads[i].empty(); + mcdu_scratchpad.scratchpads[i].clear(); } } } else if (page == "INITA") {