#480 auxiliary water coolant
This commit is contained in:
@@ -164,6 +164,7 @@ function iocontrol.init(conf, comms, temp_scale, energy_scale)
|
||||
num_turbines = 0,
|
||||
num_snas = 0,
|
||||
has_tank = conf.cooling.r_cool[i].TankConnection,
|
||||
aux_cool = conf.cooling.aux_coolant[i],
|
||||
|
||||
status_lines = { "", "" },
|
||||
|
||||
@@ -1214,7 +1215,7 @@ function iocontrol.update_unit_statuses(statuses)
|
||||
local valve_states = status[6]
|
||||
|
||||
if type(valve_states) == "table" then
|
||||
if #valve_states == 5 then
|
||||
if #valve_states == 6 then
|
||||
unit.unit_ps.publish("V_pu_conn", valve_states[1] > 0)
|
||||
unit.unit_ps.publish("V_pu_state", valve_states[1] == 2)
|
||||
unit.unit_ps.publish("V_po_conn", valve_states[2] > 0)
|
||||
@@ -1225,6 +1226,8 @@ function iocontrol.update_unit_statuses(statuses)
|
||||
unit.unit_ps.publish("V_am_state", valve_states[4] == 2)
|
||||
unit.unit_ps.publish("V_emc_conn", valve_states[5] > 0)
|
||||
unit.unit_ps.publish("V_emc_state", valve_states[5] == 2)
|
||||
unit.unit_ps.publish("V_aux_conn", valve_states[6] > 0)
|
||||
unit.unit_ps.publish("V_aux_state", valve_states[6] == 2)
|
||||
else
|
||||
log.debug(log_header .. "valve states length mismatch")
|
||||
valid = false
|
||||
|
||||
@@ -19,7 +19,7 @@ local renderer = require("coordinator.renderer")
|
||||
local sounder = require("coordinator.sounder")
|
||||
local threads = require("coordinator.threads")
|
||||
|
||||
local COORDINATOR_VERSION = "v1.6.6"
|
||||
local COORDINATOR_VERSION = "v1.6.7"
|
||||
|
||||
local CHUNK_LOAD_DELAY_S = 30.0
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ local function make(parent, x, y, wide, unit_id)
|
||||
local tank_conns = facility.tank_conns
|
||||
local tank_types = facility.tank_fluid_types
|
||||
|
||||
local v_start = 1 + ((unit.unit_id - 1) * 5)
|
||||
local v_start = 1 + ((unit.unit_id - 1) * 6)
|
||||
local prv_start = 1 + ((unit.unit_id - 1) * 3)
|
||||
local v_fields = { "pu", "po", "pl", "am" }
|
||||
local v_names = {
|
||||
@@ -94,11 +94,19 @@ local function make(parent, x, y, wide, unit_id)
|
||||
if unit.num_boilers > 0 then
|
||||
table.insert(rc_pipes, pipe(0, 1, _wide(28, 19), 1, colors.lightBlue, true))
|
||||
table.insert(rc_pipes, pipe(0, 3, _wide(28, 19), 3, colors.orange, true))
|
||||
table.insert(rc_pipes, pipe(_wide(46 ,39), 1, _wide(72,58), 1, colors.blue, true))
|
||||
table.insert(rc_pipes, pipe(_wide(46,39), 3, _wide(72,58), 3, colors.white, true))
|
||||
table.insert(rc_pipes, pipe(_wide(46, 39), 1, _wide(72, 58), 1, colors.blue, true))
|
||||
table.insert(rc_pipes, pipe(_wide(46, 39), 3, _wide(72, 58), 3, colors.white, true))
|
||||
|
||||
if unit.aux_cool then
|
||||
table.insert(rc_pipes, pipe(_wide(51, 41), 0, _wide(51, 41), 1, colors.blue, true))
|
||||
end
|
||||
else
|
||||
table.insert(rc_pipes, pipe(0, 1, _wide(72,58), 1, colors.blue, true))
|
||||
table.insert(rc_pipes, pipe(0, 3, _wide(72,58), 3, colors.white, true))
|
||||
table.insert(rc_pipes, pipe(0, 1, _wide(72, 58), 1, colors.blue, true))
|
||||
table.insert(rc_pipes, pipe(0, 3, _wide(72, 58), 3, colors.white, true))
|
||||
|
||||
if unit.aux_cool then
|
||||
table.insert(rc_pipes, pipe(8, 0, 8, 1, colors.blue, true))
|
||||
end
|
||||
end
|
||||
|
||||
if unit.has_tank then
|
||||
|
||||
@@ -286,7 +286,7 @@ local function init(main)
|
||||
|
||||
TextBox{parent=main,x=12,y=vy,text="\x10\x11",fg_bg=text_col,width=2}
|
||||
|
||||
local conn = IndicatorLight{parent=main,x=9,y=vy+1,label=util.sprintf("PV%02d-EMC", i * 5),colors=style.ind_grn}
|
||||
local conn = IndicatorLight{parent=main,x=9,y=vy+1,label=util.sprintf("PV%02d-EMC", (i * 6) - 1),colors=style.ind_grn}
|
||||
local open = IndicatorLight{parent=main,x=9,y=vy+2,label="OPEN",colors=style.ind_wht}
|
||||
|
||||
conn.register(units[i].unit_ps, "V_emc_conn", conn.update)
|
||||
@@ -294,6 +294,33 @@ local function init(main)
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------
|
||||
-- auxiliary coolant valves --
|
||||
------------------------------
|
||||
|
||||
for i = 1, facility.num_units do
|
||||
if units[i].aux_cool then
|
||||
local vx
|
||||
local vy = 3 + y_ofs(i)
|
||||
|
||||
if #emcool_pipes == 0 then
|
||||
vx = util.trinary(units[i].num_boilers == 0, 36, 79)
|
||||
else
|
||||
vx = util.trinary(units[i].num_boilers == 0, 58, 91)
|
||||
end
|
||||
|
||||
PipeNetwork{parent=main,x=vx-6,y=vy,pipes={pipe(0,1,9,0,colors.blue,true)},bg=style.theme.bg}
|
||||
|
||||
TextBox{parent=main,x=vx,y=vy,text="\x10\x11",fg_bg=text_col,width=2}
|
||||
|
||||
local conn = IndicatorLight{parent=main,x=vx-3,y=vy+1,label=util.sprintf("PV%02d-AUX", i * 6),colors=style.ind_grn}
|
||||
local open = IndicatorLight{parent=main,x=vx-3,y=vy+2,label="OPEN",colors=style.ind_wht}
|
||||
|
||||
conn.register(units[i].unit_ps, "V_aux_conn", conn.update)
|
||||
open.register(units[i].unit_ps, "V_aux_state", open.update)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------
|
||||
-- dynamic tanks --
|
||||
-------------------
|
||||
|
||||
Reference in New Issue
Block a user