From 1f02d485f13b9a357f632aba7da9e722137e1837 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Sat, 29 Dec 2018 17:41:26 +0000 Subject: [PATCH] Reset when elec power lost --- Nasal/ECAM/ECAM-controller.nas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 3e2a4c4c..ea4f61c2 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -133,6 +133,7 @@ var status = { var ECAM_controller = { init: func() { ECAMloopTimer.start(); + me.reset(); }, loop: func() { # check active messages @@ -220,6 +221,12 @@ var ECAM_controller = { }, }; +setlistener("/systems/electrical/bus/ac-ess", func { + if (getprop("/systems/electrical/bus/ac-ess") < 110) { + ECAM_controller.reset(); + } +}, 0, 0); + var ECAMloopTimer = maketimer(0.2, func { ECAM_controller.loop(); });