mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2025-07-26 03:22:51 +00:00
#479 fixes and emphasis on needing to keep supervisor and coordinator unit counts in sync
This commit is contained in:
@ -231,7 +231,7 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
|
||||
TextBox{parent=fac_c_2,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."}
|
||||
tool_ctl.num_units = NumberField{parent=fac_c_2,x=1,y=5,width=5,max_chars=2,default=ini_cfg.UnitCount,min=1,max=4,fg_bg=bw_fg_bg}
|
||||
TextBox{parent=fac_c_2,x=7,y=5,text="reactors"}
|
||||
TextBox{parent=fac_c_2,x=1,y=7,height=3,text="This will decide how many monitors you need. If this does not match the supervisor's number of reactor units, the coordinator will not connect.",fg_bg=g_lg_fg_bg}
|
||||
TextBox{parent=fac_c_2,x=1,y=7,height=3,text="This will decide how many monitors you need. If this does not match the supervisor's number of reactor units, the coordinator will not connect.",fg_bg=cpair(colors.yellow,colors._INHERIT)}
|
||||
TextBox{parent=fac_c_2,x=1,y=10,height=3,text="Since you skipped supervisor sync, the main monitor minimum height can't be determined precisely. It is marked with * on the next page.",fg_bg=g_lg_fg_bg}
|
||||
|
||||
local nu_error = TextBox{parent=fac_c_2,x=8,y=14,width=35,text="Please set the number of reactors.",fg_bg=cpair(colors.red,colors.lightGray),hidden=true}
|
||||
|
@ -93,7 +93,7 @@ local function init(main)
|
||||
table.insert(emcool_pipes, pipe(2, y, 2, y + 3, color, true))
|
||||
table.insert(emcool_pipes, pipe(2, y, 21, y, color, true))
|
||||
|
||||
local x = util.trinary(tank_types[tank_conns[i]] == COOLANT_TYPE.WATER, 45, 84)
|
||||
local x = util.trinary((tank_types[tank_conns[i]] == COOLANT_TYPE.SODIUM) or (units[i].num_boilers == 0), 45, 84)
|
||||
table.insert(emcool_pipes, pipe(21, y, x, y + 2, color, true, true))
|
||||
end
|
||||
end
|
||||
@ -174,11 +174,11 @@ local function init(main)
|
||||
|
||||
for i = 1, #tank_defs do
|
||||
local y = y_ofs(i)
|
||||
local color = c_clr(i)
|
||||
local color = c_clr(first_fdef)
|
||||
|
||||
if i == 1 then
|
||||
if tank_defs[i] == 2 then
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, color, true))
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, c_clr(i), true))
|
||||
end
|
||||
elseif i == first_fdef then
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, color, true))
|
||||
@ -196,11 +196,11 @@ local function init(main)
|
||||
|
||||
for i = 1, #tank_defs do
|
||||
local y = y_ofs(i)
|
||||
local color = c_clr(i)
|
||||
local color = c_clr(first_fdef)
|
||||
|
||||
if i == 3 or i == 4 then
|
||||
if tank_defs[i] == 2 then
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, color, true))
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, c_clr(i), true))
|
||||
end
|
||||
elseif i == first_fdef then
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, color, true))
|
||||
@ -218,11 +218,11 @@ local function init(main)
|
||||
|
||||
for i = 1, #tank_defs do
|
||||
local y = y_ofs(i)
|
||||
local color = c_clr(i)
|
||||
local color = c_clr(first_fdef)
|
||||
|
||||
if i == 1 or i == 4 then
|
||||
if tank_defs[i] == 2 then
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, color, true))
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, c_clr(i), true))
|
||||
end
|
||||
elseif i == first_fdef then
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, color, true))
|
||||
@ -240,11 +240,11 @@ local function init(main)
|
||||
|
||||
for i = 1, #tank_defs do
|
||||
local y = y_ofs(i)
|
||||
local color = c_clr(i)
|
||||
local color = c_clr(first_fdef)
|
||||
|
||||
if i == 1 or i == 2 then
|
||||
if tank_defs[i] == 2 then
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, color, true))
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, c_clr(i), true))
|
||||
end
|
||||
elseif i == first_fdef then
|
||||
table.insert(emcool_pipes, pipe(0, y, 1, y + 5, color, true))
|
||||
|
@ -56,7 +56,7 @@ return function (app, page, panes, tank_pane, tank_id, ps, update)
|
||||
|
||||
local is_water = fac.tank_fluid_types[tank_id] == COOLANT_TYPE.WATER
|
||||
|
||||
TextBox{parent=tank_div,y=6,text=util.trinary(is_water,"Water","Sodium").." Level",width=11,fg_bg=label}
|
||||
TextBox{parent=tank_div,y=6,text=util.trinary(is_water,"Water","Sodium").." Level",width=12,fg_bg=label}
|
||||
local level = HorizontalBar{parent=tank_div,y=7,bar_fg_bg=cpair(util.trinary(is_water,colors.blue,colors.cyan),colors.gray),height=1,width=21}
|
||||
|
||||
TextBox{parent=tank_div,y=9,text="Tank Fill Mode",width=14,fg_bg=label}
|
||||
|
@ -196,6 +196,7 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
|
||||
TextBox{parent=fac_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."}
|
||||
tool_ctl.num_units = NumberField{parent=fac_c_1,x=1,y=5,width=5,max_chars=2,default=ini_cfg.UnitCount,min=1,max=4,fg_bg=bw_fg_bg}
|
||||
TextBox{parent=fac_c_1,x=7,y=5,text="reactors"}
|
||||
TextBox{parent=fac_c_1,x=1,y=7,height=3,text="If you already configured your coordinator, make sure you update the coordinator's configured unit count.",fg_bg=cpair(colors.yellow,colors._INHERIT)}
|
||||
|
||||
local nu_error = TextBox{parent=fac_c_1,x=8,y=14,width=35,text="Please set the number of reactors.",fg_bg=cpair(colors.red,colors.lightGray),hidden=true}
|
||||
|
||||
@ -587,7 +588,7 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
|
||||
--#endregion
|
||||
--#region Dynamic Tank Fluid Types
|
||||
|
||||
TextBox{parent=fac_c_7,height=3,text="Specify the type of coolant each tank will contain, for display use only. Water is the only option if one or more of the connected units is water cooled."}
|
||||
TextBox{parent=fac_c_7,height=3,text="Specify each tank's coolant type, for display use only. Water is the only option if one or more of the connected units is water cooled."}
|
||||
|
||||
local tank_fluid_list = Div{parent=fac_c_7,x=1,y=5,height=8}
|
||||
|
||||
@ -602,6 +603,8 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
|
||||
for i = 1, #tank_list do
|
||||
local type = tmp_cfg.TankFluidTypes[i]
|
||||
|
||||
if type == 0 then type = 1 end
|
||||
|
||||
self.tank_fluid_opts[i] = nil
|
||||
|
||||
if tank_list[i] == 1 then
|
||||
|
@ -282,6 +282,10 @@ function configurator.configure(ask_config)
|
||||
load_settings(settings_cfg, true)
|
||||
tool_ctl.has_config = load_settings(ini_cfg)
|
||||
|
||||
-- these need to be initialized as they are used before being set
|
||||
tmp_cfg.FacilityTankMode = ini_cfg.FacilityTankMode
|
||||
tmp_cfg.TankFluidTypes = { table.unpack(ini_cfg.TankFluidTypes) }
|
||||
|
||||
reset_term()
|
||||
|
||||
-- set overridden colors
|
||||
|
Reference in New Issue
Block a user