From 704fc63fe2ae0537539f35a438e7698a0427867d Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Thu, 26 Aug 2021 22:11:45 +0200 Subject: [PATCH] autoland pulse logic rewritten --- Models/FlightDeck/a320.flightdeck.xml | 14 ++++---------- Models/Instruments/PFD/PFD.nas | 22 ++++++++++++++++++++-- Sounds/A320-common-sound.xml | 2 +- Systems/a320-fwc.xml | 15 ++++++++------- Systems/pfd.xml | 11 ----------- 5 files changed, 33 insertions(+), 31 deletions(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 6889804a..864c0048 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -6453,16 +6453,10 @@ controls/switches/annun-test 1 - - - instrumentation/pfd/lights/autoland-armed - 1 - - - instrumentation/pfd/lights/autoland-on - 1 - - + + instrumentation/pfd/lights/autoland-on + 1 + diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 956e118a..57b710d1 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -164,8 +164,8 @@ var amberFlash1 = props.globals.initNode("/instrumentation/pfd/flash-indicators/ var amberFlash2 = props.globals.initNode("/instrumentation/pfd/flash-indicators/amber-flash-2", 0, "BOOL"); var dhFlash = props.globals.initNode("/instrumentation/pfd/flash-indicators/dh-flash", 0, "BOOL"); -var light_autoland_armed = props.globals.initNode("/instrumentation/pfd/lights/autoland-armed", 0, "BOOL"); -var light_autoland_on = props.globals.initNode("/instrumentation/pfd/lights/autoland-on", 0, "BOOL"); +var autoland_alarm = props.globals.initNode("/instrumentation/pfd/logic/autoland/autoland-alarm", 0, "BOOL"); +var autoland_pulse = props.globals.initNode("/instrumentation/pfd/logic/autoland/autoland-sw-pulse", 0, "BOOL"); var canvas_PFD_base = { init: func(canvas_group, file) { @@ -2967,3 +2967,21 @@ var dhTimer = maketimer(0.50, func { dh_count = dh_count + 1; } }); + +var autolandTimer = maketimer(1.0, func { + if (autoland_pulse.getBoolValue()) { + autoland_pulse.setBoolValue(0); + } else { + autoland_pulse.setBoolValue(1); + } +}); + +setlistener(autoland_alarm, func(alarm) { + if (alarm.getBoolValue()) { + autoland_pulse.setBoolValue(1); + autolandTimer.start(); + } else { + autolandTimer.stop(); + autoland_pulse.setBoolValue(0); + } +}, 0, 0); diff --git a/Sounds/A320-common-sound.xml b/Sounds/A320-common-sound.xml index a51e3b6a..2cf14d65 100644 --- a/Sounds/A320-common-sound.xml +++ b/Sounds/A320-common-sound.xml @@ -1016,7 +1016,7 @@ Aircraft/A320-family/Sounds/Cockpit/calvary-charge-once.wav - /instrumentation/pfd/lights/autoland-alarm + /instrumentation/pfd/logic/autoland/autoland-alarm 1 diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 1821e7e5..6d444378 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2301,7 +2301,7 @@ - + @@ -2321,12 +2321,12 @@ - + - /instrumentation/pfd/lights/autoland-armed eq 1 + /instrumentation/pfd/logic/autoland/autoland-armed eq 1 - /it-autoflight/output/vert eq 2 + /it-autoflight/output/vert eq 2 /it-autoflight/output/ap1 eq 0 @@ -2345,11 +2345,12 @@ - /instrumentation/pfd/lights/autoland-alarm eq 1 - /instrumentation/pfd/lights/autoland-sw-pulse eq 1 + /instrumentation/pfd/logic/autoland/autoland-alarm eq 1 + /instrumentation/pfd/logic/autoland/autoland-sw-pulse eq 1 - /it-autoflight/output/ap-warning eq 1 + /instrumentation/pfd/logic/autoland/autoland-alarm eq 1 + /it-autoflight/output/ap-warning ge 1 /ECAM/warnings/master-warning-flash eq 1 diff --git a/Systems/pfd.xml b/Systems/pfd.xml index 2e73b76c..a4741f0a 100644 --- a/Systems/pfd.xml +++ b/Systems/pfd.xml @@ -676,16 +676,5 @@ 0 256 - - - monostable - - - /instrumentation/pfd/lights/autoland-armed - - /instrumentation/pfd/lights/autoland-sw-pulse -