From 170cba702c2436d361db8b51e26b4a1b20ca984e Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Wed, 13 Aug 2025 10:46:09 -0300 Subject: [PATCH] PSIL updates stored value before notifying subscribers --- scada-common/psil.lua | 4 ++-- scada-common/util.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scada-common/psil.lua b/scada-common/psil.lua index 82e99f6..b646d37 100644 --- a/scada-common/psil.lua +++ b/scada-common/psil.lua @@ -53,12 +53,12 @@ function psil.create() if ic[key] == nil then alloc(key) end if ic[key].value ~= value then + ic[key].value = value + for i = 1, #ic[key].subscribers do ic[key].subscribers[i].notify(value) end end - - ic[key].value = value end -- publish a toggled boolean value to a given key, passing it to all subscribers if it has changed
diff --git a/scada-common/util.lua b/scada-common/util.lua index 2a2f81a..8230fca 100644 --- a/scada-common/util.lua +++ b/scada-common/util.lua @@ -24,7 +24,7 @@ local t_pack = table.pack local util = {} -- scada-common version -util.version = "1.5.2" +util.version = "1.5.3" util.TICK_TIME_S = 0.05 util.TICK_TIME_MS = 50