From fed0432e0214be4416b48e8c1bd471de71882324 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 15 Nov 2020 17:03:39 +0000 Subject: [PATCH] IESI power: now refers to 7XB relay. Also, 200ms delay before IESI power is lost. --- Models/Instruments/IESI/IESI.nas | 22 ++++++++++++++++------ Nasal/Systems/electrical.nas | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Models/Instruments/IESI/IESI.nas b/Models/Instruments/IESI/IESI.nas index 85258f17..fa2d41a0 100644 --- a/Models/Instruments/IESI/IESI.nas +++ b/Models/Instruments/IESI/IESI.nas @@ -186,9 +186,8 @@ var canvas_IESI = { me["QNH_std"].hide(); } }, + _transientVar: 0, updatePower: func(notification) { - # todo consider relay 7XB for power of DC HOT 1 - # todo transient max 0.2s # todo 20W power consumption if (notification.attReset == 1) { if (notification.iesiInit and _IESITime + 90 >= notification.elapsed_seconds) { @@ -199,7 +198,7 @@ var canvas_IESI = { iesi_init.setBoolValue(0); } - if (notification.dcEss >= 25 or (notification.dcHot1 >= 25 and notification.airspeed >= 50 and notification.elapsed_seconds >= 5)) { + if (notification.dcEss >= 25 or (notification.relay7XB and notification.dcHot1 >= 25)) { _showIESI = 1; if (notification.acconfig != 1 and notification.iesiInit != 1) { iesi_init.setBoolValue(1); @@ -213,9 +212,19 @@ var canvas_IESI = { iesi_init.setBoolValue(1); _IESITime = notification.elapsed_seconds - 87; } - } else { - _showIESI = 0; - iesi_init.setBoolValue(0); + } elsif (notification.iesiInit) { + if (!me._transientVar) { + me._transientVar = 1; + settimer(func() { + if (systems.ELEC.Bus.dcEss.getValue() >= 25 or (systems.ELEC.Bus.dcHot1.getValue() >= 25 and systems.ELEC.Relay.relay7XB.getValue())) { + me._transientVar = 0; + } else { + _showIESI = 0; + iesi_init.setBoolValue(0); + me._transientVar = 0; + } + }, 0.2); + } } if (_showIESI and notification.iesiBrt > 0.01) { @@ -271,6 +280,7 @@ var input = { "qnh_inhg": "/instrumentation/altimeter[0]/setting-inhg", "roll": "/orientation/roll-deg", "skid": "/instrumentation/iesi/slip-skid", + "relay7XB": "/systems/electrical/sources/si-1/inverter-control/relay-7xb", }; foreach (var name; keys(input)) { diff --git a/Nasal/Systems/electrical.nas b/Nasal/Systems/electrical.nas index 1ff311e2..4089fcd3 100644 --- a/Nasal/Systems/electrical.nas +++ b/Nasal/Systems/electrical.nas @@ -90,6 +90,7 @@ var ELEC = { glc2: props.globals.getNode("/systems/electrical/relay/gen-2-glc/contact-pos"), tr1Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/contact-pos"), tr2Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-2/contact-pos"), + relay7XB: props.globals.getNode("/systems/electrical/sources/si-1/inverter-control/relay-7xb"), }, SomeThing: { emerGenSignal: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-gen-operate"),