PSIL updates stored value before notifying subscribers
This commit is contained in:
parent
fe78360948
commit
170cba702c
@ -53,12 +53,12 @@ function psil.create()
|
|||||||
if ic[key] == nil then alloc(key) end
|
if ic[key] == nil then alloc(key) end
|
||||||
|
|
||||||
if ic[key].value ~= value then
|
if ic[key].value ~= value then
|
||||||
|
ic[key].value = value
|
||||||
|
|
||||||
for i = 1, #ic[key].subscribers do
|
for i = 1, #ic[key].subscribers do
|
||||||
ic[key].subscribers[i].notify(value)
|
ic[key].subscribers[i].notify(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ic[key].value = value
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- publish a toggled boolean value to a given key, passing it to all subscribers if it has changed<br>
|
-- publish a toggled boolean value to a given key, passing it to all subscribers if it has changed<br>
|
||||||
|
|||||||
@ -24,7 +24,7 @@ local t_pack = table.pack
|
|||||||
local util = {}
|
local util = {}
|
||||||
|
|
||||||
-- scada-common version
|
-- scada-common version
|
||||||
util.version = "1.5.2"
|
util.version = "1.5.3"
|
||||||
|
|
||||||
util.TICK_TIME_S = 0.05
|
util.TICK_TIME_S = 0.05
|
||||||
util.TICK_TIME_MS = 50
|
util.TICK_TIME_MS = 50
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user