diff --git a/Models/Instruments/IESI/IESI.nas b/Models/Instruments/IESI/IESI.nas index 33076dcd..9142a3cb 100644 --- a/Models/Instruments/IESI/IESI.nas +++ b/Models/Instruments/IESI/IESI.nas @@ -240,9 +240,7 @@ var IESIRecipient = NewIESIRecipient.MainScreen = canvas_IESI.new("Aircraft/A320-family/Models/Instruments/IESI/res/iesi.svg", "A320 IESI"); } - #if (!math.mod(notifications.frameNotification.FrameCount,2)){ - NewIESIRecipient.MainScreen.update(notification); - #} + NewIESIRecipient.MainScreen.update(notification); return emesary.Transmitter.ReceiptStatus_OK; } return emesary.Transmitter.ReceiptStatus_NotProcessed; diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index 505e5826..4f9aa916 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -973,14 +973,13 @@ var UpperECAMRecipient = } } - #if (!math.mod(notifications.frameNotification.FrameCount,2)){ - if (EWDRecipient.type) { - EWDRecipient.MainScreen.updateIAE(notification); - } else { - EWDRecipient.MainScreen.updateCFM(notification); - - } - #} + + if (EWDRecipient.type) { + EWDRecipient.MainScreen.updateIAE(notification); + } else { + EWDRecipient.MainScreen.updateCFM(notification); + + } return emesary.Transmitter.ReceiptStatus_OK; } return emesary.Transmitter.ReceiptStatus_NotProcessed; diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 378b67b9..85dadb04 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -26,6 +26,7 @@ var flash = 0; var hasCleared = 0; var statusFlag = 0; var counter = 0; +var counterClear = 0; var noMainMsg = 0; var storeFirstWarning = nil; @@ -260,22 +261,16 @@ var status = { var ECAM_controller = { _recallCounter: 0, _noneActive: 0, - counter: 0, + _ready: 0, init: func() { - ECAMloopTimer.start(); - me.counter = 0; me.reset(); + me._ready = 1; }, - loop: func() { + loop: func(notification) { + if (!me._ready) { + return; + } if ((systems.ELEC.Bus.acEss.getValue() >= 110 or systems.ELEC.Bus.ac2.getValue() >= 110) and !pts.Acconfig.running.getBoolValue()) { - # update FWC phases - if (me.counter == 0) { - phaseLoop(); - me.counter = 1; - return; - } - me.counter = 0; - # check active messages messages_priority_3(); messages_priority_2(); @@ -303,7 +298,7 @@ var ECAM_controller = { } # write to ECAM - var counter = 0; + counter = 0; if (!pts.Acconfig.running.getBoolValue()) { foreach (var w; warnings.vector) { @@ -352,6 +347,7 @@ var ECAM_controller = { } }, reset: func() { + me._ready = 0; foreach (var w; warnings.vector) { if (w.active == 1) { w.active = 0; @@ -390,15 +386,15 @@ var ECAM_controller = { }, clear: func() { hasCleared = 0; - counter = 0; + counterClear = 0; noMainMsg = 0; storeFirstWarning = nil; # first go through the first eight, see how many mainMsg there are foreach (var w; warnings.vector) { - if (counter >= 8) { break; } + if (counterClear >= 8) { break; } if (w.active == 1 and w.clearFlag != 1 and w.isMemo != 1) { - counter += 1; + counterClear += 1; if (w.isMainMsg == 1) { if (noMainMsg == 0) { storeFirstWarning = w; @@ -410,11 +406,11 @@ var ECAM_controller = { # then, if there is an overflow and noMainMsg == 1, we clear the first shown ones if (leftOverflow.getBoolValue() and noMainMsg == 1) { - counter = 0; + counterClear = 0; foreach (var w; warnings.vector) { - if (counter >= 8) { break; } + if (counterClear >= 8) { break; } if (w.active == 1 and w.clearFlag != 1 and w.isMemo != 1) { - counter += 1; + counterClear += 1; if (w.isMainMsg == 1) { continue; } w.clearFlag = 1; hasCleared = 1; @@ -482,10 +478,6 @@ setlistener("/systems/electrical/bus/dc-ess", func { } }, 0, 0); -var ECAMloopTimer = maketimer(0.15, func { - ECAM_controller.loop(); -}); - # Flash Master Warning Light var shutUpYou = func() { lights[0].setBoolValue(0); diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index 89a09b66..2a20d236 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -352,8 +352,13 @@ var ECAMRecipient = { if (notification.NotificationType == "FrameNotification") { - if (!math.mod(notifications.frameNotification.FrameCount,2)){ + debug.dump(notifications.frameNotification.FrameCount); + if (notifications.frameNotification.FrameCount == 5){ ECAM.loop(notification); + } elsif (notifications.frameNotification.FrameCount == 7){ + phaseLoop(); + } elsif (notifications.frameNotification.FrameCount == 10){ + ECAM_controller.loop(notification); } return emesary.Transmitter.ReceiptStatus_OK; } diff --git a/Nasal/emesary/M_frame_notification.nas b/Nasal/emesary/M_frame_notification.nas index 95716a51..228b79c1 100644 --- a/Nasal/emesary/M_frame_notification.nas +++ b/Nasal/emesary/M_frame_notification.nas @@ -96,3 +96,8 @@ var FrameNotificationAddProperty = # var frameNotification = FrameNotification.new(1); + +# Frame count +# 5 = ECAM +# 7 = FWC phases +# 10 = ECAM messages \ No newline at end of file diff --git a/Nasal/emesary/exec.nas b/Nasal/emesary/exec.nas index 40661a0b..0f5460b6 100644 --- a/Nasal/emesary/exec.nas +++ b/Nasal/emesary/exec.nas @@ -24,7 +24,7 @@ var cur_frame_inc = 0.05; var execLoop = func { notifications.frameNotification.fetchvars(); - if (notifications.frameNotification.FrameCount >= 1) { + if (notifications.frameNotification.FrameCount > 10) { notifications.frameNotification.FrameCount = 0; } emesary.GlobalTransmitter.NotifyAll(notifications.frameNotification);