From 8e4bb583a850e90dd226c7815b8dad58af258994 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Fri, 26 Jul 2024 23:06:42 -0400 Subject: [PATCH] #528 reactor PLC configurator fixes --- reactor-plc/config/check.lua | 7 +++++++ reactor-plc/config/system.lua | 6 +++--- reactor-plc/configure.lua | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/reactor-plc/config/check.lua b/reactor-plc/config/check.lua index de1d296..95994f3 100644 --- a/reactor-plc/config/check.lua +++ b/reactor-plc/config/check.lua @@ -124,6 +124,13 @@ local function self_check(sc_log) if valid_cfg and modem then self.self_check_msg("> check supervisor connection...") + -- init mac as needed + if self.settings.AuthKey and string.len(self.settings.AuthKey) >= 8 then + network.init_mac(self.settings.AuthKey) + else + network.deinit_mac() + end + self.nic = network.nic(modem) self.nic.closeAll() diff --git a/reactor-plc/config/system.lua b/reactor-plc/config/system.lua index 49630b0..5e49e62 100644 --- a/reactor-plc/config/system.lua +++ b/reactor-plc/config/system.lua @@ -63,13 +63,13 @@ local system = {} -- create the system configuration view ---@param tool_ctl _plc_cfg_tool_ctl ---@param main_pane graphics_element ----@param settings table +---@param cfg_sys table ---@param divs table ---@param style table ---@param exit function -function system.create(tool_ctl, main_pane, settings, divs, style, exit) +function system.create(tool_ctl, main_pane, cfg_sys, divs, style, exit) ---@type plc_config, plc_config, plc_config, table, function - local settings_cfg, ini_cfg, tmp_cfg, fields, load_settings = table.unpack(settings) + local settings_cfg, ini_cfg, tmp_cfg, fields, load_settings = table.unpack(cfg_sys) ---@type graphics_element, graphics_element, graphics_element, graphics_element, graphics_element local plc_cfg, net_cfg, log_cfg, clr_cfg, summary = table.unpack(divs) diff --git a/reactor-plc/configure.lua b/reactor-plc/configure.lua index fbcd888..ac28cc0 100644 --- a/reactor-plc/configure.lua +++ b/reactor-plc/configure.lua @@ -277,7 +277,7 @@ function configurator.configure(ask_config) elseif event == "paste" then display.handle_paste(param1) elseif event == "modem_message" then - check.handle_msg(param1, param2, param3, param4, param5) + check.receive_sv(param1, param2, param3, param4, param5) end if event == "terminate" then return end