From 03923850375fed2a8b97ac4f106cff721f4616a6 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Fri, 12 Sep 2025 19:45:15 -0400 Subject: [PATCH] #622 reinforced induction matrix support --- rtu/config/check.lua | 2 +- rtu/config/peripherals.lua | 14 +++++++------- rtu/startup.lua | 4 ++-- rtu/threads.lua | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rtu/config/check.lua b/rtu/config/check.lua index fbc7c4c..2956560 100644 --- a/rtu/config/check.lua +++ b/rtu/config/check.lua @@ -200,7 +200,7 @@ local function self_check() else valid = true - if p_type ~= nil and not (p_type == "inductionPort" or p_type == "spsPort") then + if p_type ~= nil and not (p_type == "inductionPort" or p_type == "reinforcedInductionPort" or p_type == "spsPort") then self.self_check_msg("> check " .. entry.name .. " valid...", false, "unrecognized device type") end end diff --git a/rtu/config/peripherals.lua b/rtu/config/peripherals.lua index cbb3a06..1723b02 100644 --- a/rtu/config/peripherals.lua +++ b/rtu/config/peripherals.lua @@ -43,7 +43,7 @@ local self = { local peripherals = {} -local RTU_DEV_TYPES = { "boilerValve", "turbineValve", "dynamicValve", "inductionPort", "spsPort", "solarNeutronActivator", "environmentDetector", "environment_detector" } +local RTU_DEV_TYPES = { "boilerValve", "turbineValve", "dynamicValve", "inductionPort", "reinforcedInductionPort", "spsPort", "solarNeutronActivator", "environmentDetector", "environment_detector" } local NEEDS_UNIT = { "boilerValve", "turbineValve", "dynamicValve", "solarNeutronActivator", "environmentDetector", "environment_detector" } -- create the peripherals configuration view @@ -171,8 +171,8 @@ function peripherals.create(tool_ctl, main_pane, cfg_sys, peri_cfg, style) self.p_assign_btn.redraw() if self.p_assign_btn.get_value() == 1 then self.p_unit.disable() else self.p_unit.enable() end self.p_desc.set_value("You can connect more than one environment detector for a particular unit or the facility. In that case, the maximum radiation reading from those assigned to that particular unit or the facility will be used for alarms and display.") - elseif type == "inductionPort" or type == "spsPort" then - local dev = tri(type == "inductionPort", "induction matrix", "SPS") + elseif type == "inductionPort" or type == "reinforcedInductionPort" or type == "spsPort" then + local dev = tri(type == "inductionPort" or type == "reinforcedInductionPort", "induction matrix", "SPS") self.p_idx.hide(true) self.p_unit.hide(true) self.p_prompt.set_value("This is the " .. dev .. " for the facility.") @@ -212,10 +212,10 @@ function peripherals.create(tool_ctl, main_pane, cfg_sys, peri_cfg, style) tool_ctl.update_peri_list() - TextBox{parent=peri_c_3,x=1,y=1,height=4,text="This feature is intended for advanced users. If you are clicking this just because your device is not shown, follow the connection instructions in 'I don't see my device!'."} - TextBox{parent=peri_c_3,x=1,y=6,height=4,text="Peripheral Name"} - local p_name = TextField{parent=peri_c_3,x=1,y=7,width=49,height=1,max_len=128,fg_bg=bw_fg_bg} - local p_type = Radio2D{parent=peri_c_3,x=1,y=9,rows=4,columns=2,default=1,options=RTU_DEV_TYPES,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.purple} + TextBox{parent=peri_c_3,x=1,y=1,height=4,text="This feature is intended for advanced users. If you just can't see your device, click 'I don't see my device!' instead."} + TextBox{parent=peri_c_3,x=1,y=5,height=4,text="Peripheral Name"} + local p_name = TextField{parent=peri_c_3,x=1,y=6,width=49,height=1,max_len=128,fg_bg=bw_fg_bg} + local p_type = Radio2D{parent=peri_c_3,x=1,y=8,rows=5,columns=2,default=1,options=RTU_DEV_TYPES,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.purple} local man_p_err = TextBox{parent=peri_c_3,x=8,y=14,width=35,text="Please enter a peripheral name.",fg_bg=cpair(colors.red,colors.lightGray),hidden=true} man_p_err.hide(true) diff --git a/rtu/startup.lua b/rtu/startup.lua index d7cfe97..f052ff2 100644 --- a/rtu/startup.lua +++ b/rtu/startup.lua @@ -440,8 +440,8 @@ local function main() println_ts(util.c("sys_config> failed to check if '", name, "' is formed")) log.warning(util.c("sys_config> failed to check if '", name, "' is a formed dynamic tank multiblock")) end - elseif type == "inductionPort" then - -- induction matrix multiblock + elseif type == "inductionPort" or type == "reinforcedInductionPort" then + -- induction matrix multiblock (reinforced or normal) if not validate_assign(true) then return false end rtu_type = RTU_UNIT_TYPE.IMATRIX diff --git a/rtu/threads.lua b/rtu/threads.lua index ac875aa..54dc388 100644 --- a/rtu/threads.lua +++ b/rtu/threads.lua @@ -74,7 +74,7 @@ local function handle_unit_mount(smem, println_ts, iface, type, device, unit) end unit.type = RTU_UNIT_TYPE.DYNAMIC_VALVE - elseif type == "inductionPort" then + elseif type == "inductionPort" or type == "reinforcedInductionPort" then -- induction matrix multiblock if unit.reactor ~= 0 then fail(util.c("induction matrix '", unit.name, "' cannot init, not assigned to facility")) end