#580 supervisor configurator fixes

This commit is contained in:
Mikayla Fischler
2025-11-02 17:44:24 -05:00
parent 6bfa26407a
commit 9a58bf1bb7
2 changed files with 11 additions and 4 deletions

View File

@@ -203,6 +203,9 @@ function system.create(tool_ctl, main_pane, cfg_sys, divs, fac_pane, style, exit
local function submit_channels()
local svr_c, plc_c, rtu_c = tonumber(svr_chan.get_value()), tonumber(plc_chan.get_value()), tonumber(rtu_chan.get_value())
local crd_c, pkt_c = tonumber(crd_chan.get_value()), tonumber(self.pkt_chan.get_value())
if not tmp_cfg.PocketEnabled then pkt_c = tmp_cfg.PKT_Channel or 16244 end
if svr_c ~= nil and plc_c ~= nil and rtu_c ~= nil and crd_c ~= nil and pkt_c ~= nil then
tmp_cfg.SVR_Channel, tmp_cfg.PLC_Channel, tmp_cfg.RTU_Channel = svr_c, plc_c, rtu_c
tmp_cfg.CRD_Channel, tmp_cfg.PKT_Channel = crd_c, pkt_c
@@ -235,17 +238,21 @@ function system.create(tool_ctl, main_pane, cfg_sys, divs, fac_pane, style, exit
local function submit_timeouts()
local plc_cto, rtu_cto, crd_cto, pkt_cto = tonumber(plc_timeout.get_value()), tonumber(rtu_timeout.get_value()), tonumber(crd_timeout.get_value()), tonumber(self.pkt_timeout.get_value())
if not tmp_cfg.PocketEnabled then pkt_cto = tmp_cfg.PKT_Timeout or 5 end
if plc_cto ~= nil and rtu_cto ~= nil and crd_cto ~= nil and pkt_cto ~= nil then
tmp_cfg.PLC_Timeout, tmp_cfg.RTU_Timeout, tmp_cfg.CRD_Timeout, tmp_cfg.PKT_Timeout = plc_cto, rtu_cto, crd_cto, pkt_cto
if tmp_cfg.WirelessModem then
net_pane.set_value(5)
ct_err.hide(true)
else
tmp_cfg.TrustedRange = 0
tmp_cfg.AuthKey = ""
main_pane.set_value(4)
end
ct_err.hide(true)
else ct_err.show() end
end

View File

@@ -93,13 +93,13 @@ local tmp_cfg = {
TankFluidTypes = {}, ---@type integer[] which type of fluid each tank in the tank list should be containing
AuxiliaryCoolant = {}, ---@type boolean[] if a unit has auxiliary coolant
ExtChargeIdling = false,
WirelessModem = true, ---@type boolean
WirelessModem = true,
WiredModem = false, ---@type string|false
PLC_Listen = 1, ---@type LISTEN_MODE
RTU_Listen = 1, ---@type LISTEN_MODE
CRD_Listen = 1, ---@type LISTEN_MODE
PocketEnabled = true, ---@type boolean
PocketTest = true, ---@type boolean
PocketEnabled = true,
PocketTest = true,
SVR_Channel = nil, ---@type integer
PLC_Channel = nil, ---@type integer
RTU_Channel = nil, ---@type integer