From 95419562ee97df7665675372da0a2b1717df6852 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 31 Dec 2023 13:17:49 -0500 Subject: [PATCH 1/6] no longer mention config.lua for supervisor update --- ccmsi.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index 7edf026..9b9a98c 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -18,7 +18,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.12" +local CCMSI_VERSION = "v1.12a" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -345,8 +345,7 @@ elseif mode == "install" or mode == "update" then if mode == "install" then println("Installing " .. app .. " files...") elseif mode == "update" then - if app == "supervisor" or app == "coordinator" or app == "pocket" then - println("Updating " .. app .. " files... (keeping old config.lua)") + if app == "coordinator" or app == "pocket" then println("Updating " .. app .. " files... (keeping old config.lua)") else println("Updating " .. app .. " files...") end end white() From 1eede97c0897f27055f05baed5caf83993523561 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 31 Dec 2023 14:04:22 -0500 Subject: [PATCH 2/6] fixed supervisor not using proper config on front panel --- supervisor/panel/front_panel.lua | 4 ++-- supervisor/startup.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/supervisor/panel/front_panel.lua b/supervisor/panel/front_panel.lua index 981dd5e..8e37400 100644 --- a/supervisor/panel/front_panel.lua +++ b/supervisor/panel/front_panel.lua @@ -4,8 +4,8 @@ local util = require("scada-common.util") -local config = require("supervisor.config") local databus = require("supervisor.databus") +local supervisor = require("supervisor.supervisor") local pgi = require("supervisor.panel.pgi") local style = require("supervisor.panel.style") @@ -88,7 +88,7 @@ local function init(panel) local plc_page = Div{parent=page_div,x=1,y=1,hidden=true} local plc_list = Div{parent=plc_page,x=2,y=2,width=49} - for i = 1, config.NUM_REACTORS do + for i = 1, supervisor.config.UnitCount do local ps_prefix = "plc_" .. i .. "_" local plc_entry = Div{parent=plc_list,height=3,fg_bg=bw_fg_bg} diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 96cda57..c576d9d 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.2.1" +local SUPERVISOR_VERSION = "v1.2.2" local println = util.println local println_ts = util.println_ts From 4f952eff838045ed6a094d8b3c5535c5cf2b177d Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 31 Dec 2023 14:14:35 -0500 Subject: [PATCH 3/6] fixed supervisor incorrectly trying to validate tank defs when tank mode is zero --- supervisor/startup.lua | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/supervisor/startup.lua b/supervisor/startup.lua index c576d9d..ca0db1f 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.2.2" +local SUPERVISOR_VERSION = "v1.2.3" local println = util.println local println_ts = util.println_ts @@ -44,16 +44,6 @@ local config = supervisor.config local cfv = util.new_validator() -assert((config.FacilityTankMode == 0) or (config.UnitCount == #config.FacilityTankDefs), - "startup> the number of facility tank definitions must be equal to the number of units in facility tank mode") - -for i = 1, config.UnitCount do - local def = config.FacilityTankDefs[i] - cfv.assert_type_int(def) - cfv.assert_range(def, 0, 2) - assert(cfv.valid(), "startup> invalid facility tank definition for reactor unit " .. i) -end - cfv.assert_eq(#config.CoolingConfig, config.UnitCount) assert(cfv.valid(), "startup> the number of reactor cooling configurations is different than the number of units") @@ -69,6 +59,17 @@ for i = 1, config.UnitCount do assert(cfv.valid(), "startup> out-of-range number of boilers and/or turbines provided for reactor unit " .. i) end +if config.FacilityTankMode > 0 then + assert(config.UnitCount == #config.FacilityTankDefs, "startup> the number of facility tank definitions must be equal to the number of units in facility tank mode") + + for i = 1, config.UnitCount do + local def = config.FacilityTankDefs[i] + cfv.assert_type_int(def) + cfv.assert_range(def, 0, 2) + assert(cfv.valid(), "startup> invalid facility tank definition for reactor unit " .. i) + end +end + ---------------------------------------- -- log init ---------------------------------------- From fb00e98a5ba10684ad567387bc18f2768e7446c7 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 31 Dec 2023 15:00:08 -0500 Subject: [PATCH 4/6] more supervisor configurator bugfixes --- supervisor/configure.lua | 6 +++--- supervisor/startup.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/supervisor/configure.lua b/supervisor/configure.lua index bfe0ed7..c249c44 100644 --- a/supervisor/configure.lua +++ b/supervisor/configure.lua @@ -247,7 +247,7 @@ local function config_view(display) if ini_cfg.CoolingConfig[i] then local conf = ini_cfg.CoolingConfig[i] if util.is_int(conf.TurbineCount) then num_t = math.min(3, math.max(1, conf.TurbineCount or 1)) end - if util.is_int(conf.BoilerCount) then num_b = math.min(2, math.max(1, conf.BoilerCount or 0)) end + if util.is_int(conf.BoilerCount) then num_b = math.min(2, math.max(0, conf.BoilerCount or 0)) end has_t = conf.TankConnection == true end @@ -416,8 +416,8 @@ local function config_view(display) for i = 2, 4 do local line = Div{parent=vis,x=1,y=(i-1)*2,width=13,height=2} local pipe_conn = TextBox{parent=line,x=13,y=2,width=1,height=1,text="\x8c",fg_bg=pipe_cpair} - local pipe_chain = TextBox{parent=line,x=12,y=1,width=1,height=2,text="",fg_bg=pipe_cpair} - local pipe_direct = TextBox{parent=line,x=9,y=2,width=4,height=1,text="",fg_bg=pipe_cpair} + local pipe_chain = TextBox{parent=line,x=12,y=1,width=1,height=2,text="\x95\n\x8d",fg_bg=pipe_cpair} + local pipe_direct = TextBox{parent=line,x=9,y=2,width=4,height=1,text="\x8c\x8c\x8c\x8c",fg_bg=pipe_cpair} local label = TextBox{parent=line,x=1,y=2,width=7,height=1,text=""} tool_ctl.vis_ftanks[i] = { line = line, pipe_conn = pipe_conn, pipe_chain = pipe_chain, pipe_direct = pipe_direct, label = label } end diff --git a/supervisor/startup.lua b/supervisor/startup.lua index ca0db1f..71b5b53 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.2.3" +local SUPERVISOR_VERSION = "v1.2.4" local println = util.println local println_ts = util.println_ts From 6edeb3e3b8d424cb8ceb03b9d47344dc95cf3344 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 31 Dec 2023 15:00:38 -0500 Subject: [PATCH 5/6] add default value to sounder volume for very old RTU config imports --- rtu/configure.lua | 2 +- rtu/startup.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtu/configure.lua b/rtu/configure.lua index 2b6239e..c1ab9db 100644 --- a/rtu/configure.lua +++ b/rtu/configure.lua @@ -1144,7 +1144,7 @@ local function config_view(display) tool_ctl.importing_any_dc = false - tmp_cfg.SpeakerVolume = config.SOUNDER_VOLUME + tmp_cfg.SpeakerVolume = config.SOUNDER_VOLUME or 1 tmp_cfg.SVR_Channel = config.SVR_CHANNEL tmp_cfg.RTU_Channel = config.RTU_CHANNEL tmp_cfg.ConnTimeout = config.COMMS_TIMEOUT diff --git a/rtu/startup.lua b/rtu/startup.lua index d05ffe8..0a3753d 100644 --- a/rtu/startup.lua +++ b/rtu/startup.lua @@ -31,7 +31,7 @@ local sna_rtu = require("rtu.dev.sna_rtu") local sps_rtu = require("rtu.dev.sps_rtu") local turbinev_rtu = require("rtu.dev.turbinev_rtu") -local RTU_VERSION = "v1.7.10" +local RTU_VERSION = "v1.7.11" local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE From 737e0d72b03b92b3ad861b2395f5f0364835b515 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 31 Dec 2023 15:41:28 -0500 Subject: [PATCH 6/6] changed supervisor facility config color theme as green is for the summary already --- supervisor/configure.lua | 10 +++++----- supervisor/startup.lua | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/supervisor/configure.lua b/supervisor/configure.lua index c249c44..745c082 100644 --- a/supervisor/configure.lua +++ b/supervisor/configure.lua @@ -212,7 +212,7 @@ local function config_view(display) local svr_pane = MultiPane{parent=svr_cfg,x=1,y=4,panes={svr_c_1,svr_c_2,svr_c_3,svr_c_4,svr_c_5,svr_c_6}} - TextBox{parent=svr_cfg,x=1,y=2,height=1,text=" Facility Configuration",fg_bg=cpair(colors.black,colors.green)} + TextBox{parent=svr_cfg,x=1,y=2,height=1,text=" Facility Configuration",fg_bg=cpair(colors.black,colors.yellow)} TextBox{parent=svr_c_1,x=1,y=1,height=3,text="Please enter the number of reactors you have, also referred to as reactor units or 'units' for short. A maximum of 4 is currently supported."} local num_units = NumberField{parent=svr_c_1,x=1,y=5,width=5,max_chars=2,default=ini_cfg.UnitCount,min=1,max=4,fg_bg=bw_fg_bg} @@ -256,7 +256,7 @@ local function config_view(display) TextBox{parent=line,text="Unit "..i,width=6} local turbines = NumberField{parent=line,x=9,y=1,width=5,max_chars=2,default=num_t,min=1,max=3,fg_bg=bw_fg_bg} local boilers = NumberField{parent=line,x=20,y=1,width=5,max_chars=2,default=num_b,min=0,max=2,fg_bg=bw_fg_bg} - local tank = CheckBox{parent=line,x=30,y=1,label="Is Connected",default=has_t,box_fg_bg=cpair(colors.green,colors.black)} + local tank = CheckBox{parent=line,x=30,y=1,label="Is Connected",default=has_t,box_fg_bg=cpair(colors.yellow,colors.black)} tool_ctl.cooling_elems[i] = { line = line, turbines = turbines, boilers = boilers, tank = tank } end @@ -307,7 +307,7 @@ local function config_view(display) TextBox{parent=svr_c_3,x=1,y=1,height=6,text="You have set one or more of your units to use dynamic tanks for emergency coolant. You have two paths for configuration. The first is to assign dynamic tanks to reactor units; one tank per reactor, only connected to that reactor. RTU configurations must also assign it as such."} TextBox{parent=svr_c_3,x=1,y=8,height=3,text="Alternatively, you can configure them as facility tanks to connect to multiple reactor units. These can intermingle with unit-specific tanks."} - local en_fac_tanks = CheckBox{parent=svr_c_3,x=1,y=12,label="Use Facility Dynamic Tanks",default=ini_cfg.FacilityTankMode>0,box_fg_bg=cpair(colors.green,colors.black)} + local en_fac_tanks = CheckBox{parent=svr_c_3,x=1,y=12,label="Use Facility Dynamic Tanks",default=ini_cfg.FacilityTankMode>0,box_fg_bg=cpair(colors.yellow,colors.black)} local function submit_en_fac_tank() if en_fac_tanks.get_value() then @@ -331,7 +331,7 @@ local function config_view(display) TextBox{parent=div,x=1,y=1,width=33,height=1,text="Unit "..i.." will be connected to..."} TextBox{parent=div,x=6,y=2,width=3,height=1,text="..."} - local tank_opt = Radio2D{parent=div,x=10,y=2,rows=1,columns=2,default=val,options={"its own Unit Tank","a Facility Tank"},radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.green,disable_color=colors.gray,disable_fg_bg=g_lg_fg_bg} + local tank_opt = Radio2D{parent=div,x=10,y=2,rows=1,columns=2,default=val,options={"its own Unit Tank","a Facility Tank"},radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.yellow,disable_color=colors.gray,disable_fg_bg=g_lg_fg_bg} local no_tank = TextBox{parent=div,x=9,y=2,width=34,height=1,text="no tank (as you set two steps ago)",fg_bg=cpair(colors.gray,colors.lightGray),hidden=true} tool_ctl.tank_elems[i] = { div = div, tank_opt = tank_opt, no_tank = no_tank } @@ -544,7 +544,7 @@ local function config_view(display) end local tank_modes = { "Mode 1", "Mode 2", "Mode 3", "Mode 4", "Mode 5", "Mode 6", "Mode 7", "Mode 8" } - local tank_mode = RadioButton{parent=svr_c_5,x=1,y=4,callback=tool_ctl.vis_draw,default=math.max(1,ini_cfg.FacilityTankMode),options=tank_modes,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.green} + local tank_mode = RadioButton{parent=svr_c_5,x=1,y=4,callback=tool_ctl.vis_draw,default=math.max(1,ini_cfg.FacilityTankMode),options=tank_modes,radio_colors=cpair(colors.lightGray,colors.black),select_color=colors.yellow} --#endregion diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 71b5b53..e4ab974 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.2.4" +local SUPERVISOR_VERSION = "v1.2.5" local println = util.println local println_ts = util.println_ts