include tank fluid types and aux coolant correctly in load_legacy and save_and_continue
This commit is contained in:
parent
1890f0a983
commit
c62ec1e786
@ -18,8 +18,6 @@ local tri = util.trinary
|
||||
local cpair = core.cpair
|
||||
|
||||
local self = {
|
||||
tank_fluid_opts = {}, ---@type Radio2D[]
|
||||
|
||||
vis_draw = nil, ---@type function
|
||||
draw_fluid_ops = nil, ---@type function
|
||||
|
||||
@ -621,7 +619,7 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
|
||||
|
||||
if type == 0 then type = 1 end
|
||||
|
||||
self.tank_fluid_opts[i] = nil
|
||||
tool_ctl.tank_fluid_opts[i] = nil
|
||||
|
||||
if tank_list[i] == 1 then
|
||||
local row = Div{parent=tank_fluid_list,height=2}
|
||||
@ -636,7 +634,7 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
|
||||
tank_fluid.disable()
|
||||
end
|
||||
|
||||
self.tank_fluid_opts[i] = tank_fluid
|
||||
tool_ctl.tank_fluid_opts[i] = tank_fluid
|
||||
elseif tank_list[i] == 2 then
|
||||
local row = Div{parent=tank_fluid_list,height=2}
|
||||
|
||||
@ -661,7 +659,7 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
|
||||
tank_fluid.disable()
|
||||
end
|
||||
|
||||
self.tank_fluid_opts[i] = tank_fluid
|
||||
tool_ctl.tank_fluid_opts[i] = tank_fluid
|
||||
|
||||
next_f = next_f + 1
|
||||
end
|
||||
@ -676,11 +674,9 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
|
||||
tmp_cfg.TankFluidTypes = {}
|
||||
|
||||
for i = 1, #tmp_cfg.FacilityTankList do
|
||||
if self.tank_fluid_opts[i] ~= nil then
|
||||
tmp_cfg.TankFluidTypes[i] = self.tank_fluid_opts[i].get_value()
|
||||
else
|
||||
tmp_cfg.TankFluidTypes[i] = 0
|
||||
end
|
||||
if tool_ctl.tank_fluid_opts[i] ~= nil then
|
||||
tmp_cfg.TankFluidTypes[i] = tool_ctl.tank_fluid_opts[i].get_value()
|
||||
else tmp_cfg.TankFluidTypes[i] = 0 end
|
||||
end
|
||||
|
||||
fac_pane.set_value(8)
|
||||
|
||||
@ -463,6 +463,17 @@ function system.create(tool_ctl, main_pane, cfg_sys, divs, fac_pane, style, exit
|
||||
try_set(tool_ctl.aux_cool_elems[i].enable, ini_cfg.AuxiliaryCoolant[i])
|
||||
end
|
||||
|
||||
for i = 1, #ini_cfg.TankFluidTypes do
|
||||
if tool_ctl.tank_fluid_opts[i] then
|
||||
if (ini_cfg.TankFluidTypes[i] > 0) then
|
||||
tool_ctl.tank_fluid_opts[i].enable()
|
||||
tool_ctl.tank_fluid_opts[i].set_value(ini_cfg.TankFluidTypes[i])
|
||||
else
|
||||
tool_ctl.tank_fluid_opts[i].disable()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
tool_ctl.en_fac_tanks.set_value(ini_cfg.FacilityTankMode > 0)
|
||||
|
||||
tool_ctl.view_cfg.enable()
|
||||
@ -581,6 +592,9 @@ function system.create(tool_ctl, main_pane, cfg_sys, divs, fac_pane, style, exit
|
||||
|
||||
tmp_cfg.FacilityTankList, tmp_cfg.FacilityTankConns = facility.generate_tank_list_and_conns(tmp_cfg.FacilityTankMode, tmp_cfg.FacilityTankDefs)
|
||||
|
||||
for i = 1, tmp_cfg.UnitCount do tmp_cfg.AuxiliaryCoolant[i] = false end
|
||||
for i = 1, tmp_cfg.FacilityTankList do tmp_cfg.TankFluidTypes[i] = types.COOLANT_TYPE.WATER end
|
||||
|
||||
tmp_cfg.SVR_Channel = config.SVR_CHANNEL
|
||||
tmp_cfg.PLC_Channel = config.PLC_CHANNEL
|
||||
tmp_cfg.RTU_Channel = config.RTU_CHANNEL
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user