mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#353 fixed auto lock not restoring on reconnect
This commit is contained in:
parent
f95ac8be8c
commit
24c787f47d
@ -590,6 +590,9 @@ function plc.new_session(id, s_addr, reactor_id, in_queue, out_queue, timeout, f
|
||||
end
|
||||
end
|
||||
|
||||
-- check if the auto lock is active
|
||||
function public.is_auto_locked() return self.auto_lock end
|
||||
|
||||
-- set the burn rate on behalf of automatic control
|
||||
---@param rate number burn rate
|
||||
---@param ramp boolean true to ramp, false to not
|
||||
|
@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
|
||||
|
||||
local svsessions = require("supervisor.session.svsessions")
|
||||
|
||||
local SUPERVISOR_VERSION = "v1.0.8"
|
||||
local SUPERVISOR_VERSION = "v1.0.9"
|
||||
|
||||
local println = util.println
|
||||
local println_ts = util.println_ts
|
||||
|
@ -498,7 +498,6 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
||||
self.plc_s = nil
|
||||
self.plc_i = nil
|
||||
self.db.control.br100 = 0
|
||||
self.db.control.lim_br100 = 0
|
||||
end
|
||||
|
||||
-- unlink RTU unit sessions if they are closed
|
||||
@ -525,12 +524,14 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
||||
end
|
||||
end
|
||||
|
||||
-- check plc formed/faulted
|
||||
-- plc instance checks
|
||||
if self.plc_i ~= nil then
|
||||
-- check if degraded
|
||||
local rps = self.plc_i.get_rps()
|
||||
if rps.fault or rps.sys_fail then
|
||||
self.db.control.degraded = true
|
||||
end
|
||||
if rps.fault or rps.sys_fail then self.db.control.degraded = true end
|
||||
|
||||
-- re-engage auto lock if it reconnected without it
|
||||
if self.auto_engaged and not self.plc_i.is_auto_locked() then self.plc_i.auto_lock(true) end
|
||||
end
|
||||
|
||||
-- update deltas
|
||||
|
@ -75,7 +75,7 @@ function logic.update_annunciator(self)
|
||||
(next(self.plc_i.get_status()) ~= nil) and (next(self.plc_i.get_struct()) ~= nil)
|
||||
|
||||
-- update auto control limit
|
||||
if (self.db.control.lim_br100 == 0) or ((self.db.control.lim_br100 / 100) > plc_db.mek_struct.max_burn) then
|
||||
if (plc_db.mek_struct.max_burn > 0) and ((self.db.control.lim_br100 / 100) > plc_db.mek_struct.max_burn) then
|
||||
self.db.control.lim_br100 = math.floor(plc_db.mek_struct.max_burn * 100)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user