From c6d607e6b27712303cef454c2ed0aa8f41275acc Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 23 Nov 2020 20:18:28 +0000 Subject: [PATCH] Landing gear warning light, add emission animation and electrical dependency --- Models/FlightDeck/a320.flightdeck.xml | 66 +++++++++++++++++++++++---- Nasal/ECAM/ECAM-logic.nas | 6 +++ Nasal/ECAM/ECAM-main.nas | 3 +- 3 files changed, 64 insertions(+), 11 deletions(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index bbd645a8..2848a11b 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -5444,18 +5444,64 @@ select gear_lever_down_arrow - - - controls/switches/annun-test - 1 - - - systems/gear/landing-gear-warning-light - 1 - - + + + + systems/electrical/bus/ac-ess + 110 + + + systems/electrical/bus/ac-2 + 110 + + + + + controls/switches/annun-test + 1 + + + ECAM/warnings/landing-gear-warning-light + 1 + + + + + + material + gear_lever_down_arrow + + + + + systems/electrical/bus/ac-ess + 110 + + + systems/electrical/bus/ac-2 + 110 + + + + + controls/switches/annun-test + 1 + + + ECAM/warnings/landing-gear-warning-light + 1 + + + + + + 1.00 + 0.0 + 0.0 + + diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index b5adbd36..6c08e655 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -653,8 +653,14 @@ var messages_priority_3 = func { } if (gearNotDown.clearFlag == 0 and (warningNodes.Logic.gearNotDown1.getBoolValue() or warningNodes.Logic.gearNotDown2.getBoolValue()) and phaseVar3 != 3 and phaseVar3 != 4 and phaseVar3 != 5) { + if (!gearNotDown.active) { + gearWarnLight.setValue(1); + } gearNotDown.active = 1; } else { + if (gearNotDown.active) { + gearWarnLight.setValue(0); + } ECAM_controller.warningReset(gearNotDown); } diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index 0082292e..bf56df2a 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -19,10 +19,11 @@ var engStrtTimeSw = 0; var engStrtTime = 0; var page = 0; +var gearWarnLight = props.globals.initNode("/ECAM/warnings/landing-gear-warning-light", 0, "BOOL"); + var ECAM = { _cachePage: "", init: func() { - setprop("/systems/gear/landing-gear-warning-light", 0); page = props.globals.initNode("/ECAM/Lower/page", "door", "STRING"); apOffTime = props.globals.initNode("/ECAM/warnings/ap-off-time", 0, "INT");