cleanup
This commit is contained in:
parent
54167e2113
commit
3b2fb00285
@ -19,7 +19,7 @@ local renderer = require("coordinator.renderer")
|
|||||||
local sounder = require("coordinator.sounder")
|
local sounder = require("coordinator.sounder")
|
||||||
local threads = require("coordinator.threads")
|
local threads = require("coordinator.threads")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "v1.6.4"
|
local COORDINATOR_VERSION = "v1.6.5"
|
||||||
|
|
||||||
local CHUNK_LOAD_DELAY_S = 30.0
|
local CHUNK_LOAD_DELAY_S = 30.0
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ function facility.new(config)
|
|||||||
io_ctl = nil, ---@type rs_controller
|
io_ctl = nil, ---@type rs_controller
|
||||||
-- process control
|
-- process control
|
||||||
recovery = RCV_STATE.INACTIVE, ---@type RECOVERY_STATE
|
recovery = RCV_STATE.INACTIVE, ---@type RECOVERY_STATE
|
||||||
recovery_boot_state = nil, ---@type sv_control_state|nil
|
recovery_boot_state = nil, ---@type sv_boot_state|nil
|
||||||
last_unit_states = {}, ---@type boolean[]
|
last_unit_states = {}, ---@type boolean[]
|
||||||
units_ready = false,
|
units_ready = false,
|
||||||
mode = PROCESS.INACTIVE, ---@type PROCESS
|
mode = PROCESS.INACTIVE, ---@type PROCESS
|
||||||
@ -403,7 +403,7 @@ function facility.new(config)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- initialize startup recovery
|
-- initialize startup recovery
|
||||||
---@param state sv_control_state|nil
|
---@param state sv_boot_state|nil
|
||||||
function public.startup_recovery_init(state)
|
function public.startup_recovery_init(state)
|
||||||
if self.recovery == RCV_STATE.INACTIVE and state then
|
if self.recovery == RCV_STATE.INACTIVE and state then
|
||||||
self.recovery_boot_state = state
|
self.recovery_boot_state = state
|
||||||
|
|||||||
@ -240,11 +240,11 @@ function coordinator.new_session(id, s_addr, i_seq_num, in_queue, out_queue, tim
|
|||||||
|
|
||||||
---@type start_auto_config
|
---@type start_auto_config
|
||||||
local config = {
|
local config = {
|
||||||
mode = pkt.data[1], ---@type PROCESS
|
mode = pkt.data[1],
|
||||||
burn_target = pkt.data[2], ---@type number
|
burn_target = pkt.data[2],
|
||||||
charge_target = pkt.data[3], ---@type number
|
charge_target = pkt.data[3],
|
||||||
gen_target = pkt.data[4], ---@type number
|
gen_target = pkt.data[4],
|
||||||
limits = pkt.data[5] ---@type number[]
|
limits = pkt.data[5]
|
||||||
}
|
}
|
||||||
|
|
||||||
facility.startup_recovery_start(config)
|
facility.startup_recovery_start(config)
|
||||||
|
|||||||
@ -392,9 +392,8 @@ function svsessions.init(nic, fp_ok, config, facility)
|
|||||||
conns.tanks[1] = true
|
conns.tanks[1] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
self.dev_dbg.connected.units[i] = conns
|
|
||||||
|
|
||||||
self.plc_ini_reset[i] = true
|
self.plc_ini_reset[i] = true
|
||||||
|
self.dev_dbg.connected.units[i] = conns
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -19,11 +19,14 @@ local config = {}
|
|||||||
|
|
||||||
supervisor.config = config
|
supervisor.config = config
|
||||||
|
|
||||||
|
-- control state from last unexpected shutdown
|
||||||
|
supervisor.boot_state = nil ---@type sv_boot_state|nil
|
||||||
|
|
||||||
-- load the supervisor configuration and startup state
|
-- load the supervisor configuration and startup state
|
||||||
function supervisor.load_config()
|
function supervisor.load_config()
|
||||||
if not settings.load("/supervisor.settings") then return false end
|
if not settings.load("/supervisor.settings") then return false end
|
||||||
|
|
||||||
---@class sv_control_state
|
---@class sv_boot_state
|
||||||
local boot_state = {
|
local boot_state = {
|
||||||
mode = settings.get("LastProcessState"), ---@type PROCESS
|
mode = settings.get("LastProcessState"), ---@type PROCESS
|
||||||
unit_states = settings.get("LastUnitStates") ---@type boolean[]
|
unit_states = settings.get("LastUnitStates") ---@type boolean[]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user