From bf29c6ec268bbad4a59f4d7876adbfff11106952 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Mon, 7 Aug 2017 20:24:32 +0100 Subject: [PATCH] icing update --- Nasal/MCDU1/PERFTO.nas | 6 +++--- Nasal/MCDU2/PERFTO.nas | 6 +++--- Nasal/icing.nas | 16 ++++++++++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Nasal/MCDU1/PERFTO.nas b/Nasal/MCDU1/PERFTO.nas index dafa4269..76caddd9 100644 --- a/Nasal/MCDU1/PERFTO.nas +++ b/Nasal/MCDU1/PERFTO.nas @@ -153,8 +153,6 @@ var perfTOInput = func(key) { setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } - } else if (key == "R6") { - setprop("/MCDU[0]/page", "CLB"); } else if (key == "R3") { if (scratchpad == "CLR") { setprop("/FMGC/internal/to-flap", 0); @@ -236,5 +234,7 @@ var perfTOInput = func(key) { setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } - } + } else if (key == "R6") { + setprop("/MCDU[0]/page", "CLB"); + } } diff --git a/Nasal/MCDU2/PERFTO.nas b/Nasal/MCDU2/PERFTO.nas index 039b73bb..286dfab1 100644 --- a/Nasal/MCDU2/PERFTO.nas +++ b/Nasal/MCDU2/PERFTO.nas @@ -153,8 +153,6 @@ var perfTOInput = func(key) { setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } - } else if (key == "R6") { - setprop("/MCDU[1]/page", "CLB"); } else if (key == "R3") { if (scratchpad == "CLR") { setprop("/FMGC/internal/to-flap", 0); @@ -236,5 +234,7 @@ var perfTOInput = func(key) { setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } - } + } else if (key == "R6") { + setprop("/MCDU[1]/page", "CLB"); + } } diff --git a/Nasal/icing.nas b/Nasal/icing.nas index 173e5b40..d3475369 100644 --- a/Nasal/icing.nas +++ b/Nasal/icing.nas @@ -268,7 +268,7 @@ var icingModel = func { ################# setlistener("/controls/switches/leng", func { - if (lengBtn) { + if (lengBtn and stateL == 3) { setprop("/controls/switches/lengfault", 1); settimer(func() { setprop("/controls/switches/lengfault", 0); @@ -283,12 +283,18 @@ var icingModel = func { } }); + setlistener("/engines/engine[0]/state", func { + if (stateL != 3) { + setprop("/controls/switches/leng", 0); + } + }); + ################# # REng Anti-Ice # ################# setlistener("/controls/switches/reng", func { - if (rengBtn) { + if (rengBtn and stateR == 3) { setprop("/controls/switches/rengfault", 1); settimer(func() { setprop("/controls/switches/rengfault", 0); @@ -303,6 +309,12 @@ var icingModel = func { } }); + setlistener("/engines/engine[1]/state", func { + if (stateR != 3) { + setprop("/controls/switches/reng", 0); + } + }); + ################## # Probe Anti-Ice # ##################