|
|
|
|
@@ -60,7 +60,7 @@ local waste_opts = {
|
|
|
|
|
---@param id integer
|
|
|
|
|
local function init(parent, id)
|
|
|
|
|
local unit = iocontrol.get_db().units[id] ---@type ioctl_unit
|
|
|
|
|
local r_ps = unit.reactor_ps
|
|
|
|
|
local u_ps = unit.unit_ps
|
|
|
|
|
local b_ps = unit.boiler_ps_tbl
|
|
|
|
|
local t_ps = unit.turbine_ps_tbl
|
|
|
|
|
|
|
|
|
|
@@ -77,16 +77,16 @@ local function init(parent, id)
|
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
|
|
local core_map = CoreMap{parent=main,x=2,y=3,reactor_l=18,reactor_w=18}
|
|
|
|
|
r_ps.subscribe("temp", core_map.update)
|
|
|
|
|
r_ps.subscribe("size", function (s) core_map.resize(s[1], s[2]) end)
|
|
|
|
|
u_ps.subscribe("temp", core_map.update)
|
|
|
|
|
u_ps.subscribe("size", function (s) core_map.resize(s[1], s[2]) end)
|
|
|
|
|
|
|
|
|
|
TextBox{parent=main,x=12,y=22,text="Heating Rate",height=1,width=12,fg_bg=style.label}
|
|
|
|
|
local heating_r = DataIndicator{parent=main,x=12,label="",format="%14.0f",value=0,unit="mB/t",commas=true,lu_colors=lu_cpair,width=19,fg_bg=bw_fg_bg}
|
|
|
|
|
r_ps.subscribe("heating_rate", heating_r.update)
|
|
|
|
|
u_ps.subscribe("heating_rate", heating_r.update)
|
|
|
|
|
|
|
|
|
|
TextBox{parent=main,x=12,y=25,text="Commanded Burn Rate",height=1,width=19,fg_bg=style.label}
|
|
|
|
|
local burn_r = DataIndicator{parent=main,x=12,label="",format="%14.1f",value=0,unit="mB/t",lu_colors=lu_cpair,width=19,fg_bg=bw_fg_bg}
|
|
|
|
|
r_ps.subscribe("burn_rate", burn_r.update)
|
|
|
|
|
u_ps.subscribe("burn_rate", burn_r.update)
|
|
|
|
|
|
|
|
|
|
TextBox{parent=main,text="F",x=2,y=22,width=1,height=1,fg_bg=style.label}
|
|
|
|
|
TextBox{parent=main,text="C",x=4,y=22,width=1,height=1,fg_bg=style.label}
|
|
|
|
|
@@ -100,12 +100,12 @@ local function init(parent, id)
|
|
|
|
|
local hcool = VerticalBar{parent=main,x=8,y=23,fg_bg=cpair(colors.white,colors.gray),height=4,width=1}
|
|
|
|
|
local waste = VerticalBar{parent=main,x=10,y=23,fg_bg=cpair(colors.brown,colors.gray),height=4,width=1}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("fuel_fill", fuel.update)
|
|
|
|
|
r_ps.subscribe("ccool_fill", ccool.update)
|
|
|
|
|
r_ps.subscribe("hcool_fill", hcool.update)
|
|
|
|
|
r_ps.subscribe("waste_fill", waste.update)
|
|
|
|
|
u_ps.subscribe("fuel_fill", fuel.update)
|
|
|
|
|
u_ps.subscribe("ccool_fill", ccool.update)
|
|
|
|
|
u_ps.subscribe("hcool_fill", hcool.update)
|
|
|
|
|
u_ps.subscribe("waste_fill", waste.update)
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("ccool_type", function (type)
|
|
|
|
|
u_ps.subscribe("ccool_type", function (type)
|
|
|
|
|
if type == "mekanism:sodium" then
|
|
|
|
|
ccool.recolor(cpair(colors.lightBlue, colors.gray))
|
|
|
|
|
else
|
|
|
|
|
@@ -113,7 +113,7 @@ local function init(parent, id)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("hcool_type", function (type)
|
|
|
|
|
u_ps.subscribe("hcool_type", function (type)
|
|
|
|
|
if type == "mekanism:superheated_sodium" then
|
|
|
|
|
hcool.recolor(cpair(colors.orange, colors.gray))
|
|
|
|
|
else
|
|
|
|
|
@@ -123,15 +123,15 @@ local function init(parent, id)
|
|
|
|
|
|
|
|
|
|
TextBox{parent=main,x=32,y=22,text="Core Temp",height=1,width=9,fg_bg=style.label}
|
|
|
|
|
local core_temp = DataIndicator{parent=main,x=32,label="",format="%11.2f",value=0,unit="K",lu_colors=lu_cpair,width=13,fg_bg=bw_fg_bg}
|
|
|
|
|
r_ps.subscribe("temp", core_temp.update)
|
|
|
|
|
u_ps.subscribe("temp", core_temp.update)
|
|
|
|
|
|
|
|
|
|
TextBox{parent=main,x=32,y=25,text="Burn Rate",height=1,width=9,fg_bg=style.label}
|
|
|
|
|
local act_burn_r = DataIndicator{parent=main,x=32,label="",format="%8.1f",value=0,unit="mB/t",lu_colors=lu_cpair,width=13,fg_bg=bw_fg_bg}
|
|
|
|
|
r_ps.subscribe("act_burn_rate", act_burn_r.update)
|
|
|
|
|
u_ps.subscribe("act_burn_rate", act_burn_r.update)
|
|
|
|
|
|
|
|
|
|
TextBox{parent=main,x=32,y=28,text="Damage",height=1,width=6,fg_bg=style.label}
|
|
|
|
|
local damage_p = DataIndicator{parent=main,x=32,label="",format="%11.0f",value=0,unit="%",lu_colors=lu_cpair,width=13,fg_bg=bw_fg_bg}
|
|
|
|
|
r_ps.subscribe("damage", damage_p.update)
|
|
|
|
|
u_ps.subscribe("damage", damage_p.update)
|
|
|
|
|
|
|
|
|
|
---@todo radiation monitor
|
|
|
|
|
TextBox{parent=main,x=32,y=31,text="Radiation",height=1,width=21,fg_bg=style.label}
|
|
|
|
|
@@ -145,8 +145,8 @@ local function init(parent, id)
|
|
|
|
|
local stat_line_1 = TextBox{parent=u_stat,x=1,y=1,text="UNKNOWN",width=33,height=1,alignment=TEXT_ALIGN.CENTER,fg_bg=bw_fg_bg}
|
|
|
|
|
local stat_line_2 = TextBox{parent=u_stat,x=1,y=2,text="awaiting data",width=33,height=1,alignment=TEXT_ALIGN.CENTER,fg_bg=cpair(colors.gray, colors.white)}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("U_StatusLine1", stat_line_1.set_value)
|
|
|
|
|
r_ps.subscribe("U_StatusLine2", stat_line_2.set_value)
|
|
|
|
|
u_ps.subscribe("U_StatusLine1", stat_line_1.set_value)
|
|
|
|
|
u_ps.subscribe("U_StatusLine2", stat_line_2.set_value)
|
|
|
|
|
|
|
|
|
|
-----------------
|
|
|
|
|
-- annunciator --
|
|
|
|
|
@@ -167,10 +167,10 @@ local function init(parent, id)
|
|
|
|
|
---@todo radiation monitor
|
|
|
|
|
local rad_mon = IndicatorLight{parent=annunciator,label="Radiation Monitor",colors=cpair(colors.green,colors.gray)}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("PLCOnline", plc_online.update)
|
|
|
|
|
r_ps.subscribe("PLCHeartbeat", plc_hbeat.update)
|
|
|
|
|
r_ps.subscribe("status", r_active.update)
|
|
|
|
|
r_ps.subscribe("AutoControl", r_auto.update)
|
|
|
|
|
u_ps.subscribe("PLCOnline", plc_online.update)
|
|
|
|
|
u_ps.subscribe("PLCHeartbeat", plc_hbeat.update)
|
|
|
|
|
u_ps.subscribe("status", r_active.update)
|
|
|
|
|
u_ps.subscribe("AutoControl", r_auto.update)
|
|
|
|
|
|
|
|
|
|
annunciator.line_break()
|
|
|
|
|
|
|
|
|
|
@@ -187,17 +187,17 @@ local function init(parent, id)
|
|
|
|
|
local r_wloc = IndicatorLight{parent=annunciator,label="Waste Line Occlusion",colors=cpair(colors.yellow,colors.gray)}
|
|
|
|
|
local r_hsrt = IndicatorLight{parent=annunciator,label="Startup Rate High",colors=cpair(colors.yellow,colors.gray)}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("ReactorSCRAM", r_scram.update)
|
|
|
|
|
r_ps.subscribe("ManualReactorSCRAM", r_mscrm.update)
|
|
|
|
|
r_ps.subscribe("AutoReactorSCRAM", r_ascrm.update)
|
|
|
|
|
r_ps.subscribe("RCPTrip", r_rtrip.update)
|
|
|
|
|
r_ps.subscribe("RCSFlowLow", r_cflow.update)
|
|
|
|
|
r_ps.subscribe("CoolantLevelLow", r_clow.update)
|
|
|
|
|
r_ps.subscribe("ReactorTempHigh", r_temp.update)
|
|
|
|
|
r_ps.subscribe("ReactorHighDeltaT", r_rhdt.update)
|
|
|
|
|
r_ps.subscribe("FuelInputRateLow", r_firl.update)
|
|
|
|
|
r_ps.subscribe("WasteLineOcclusion", r_wloc.update)
|
|
|
|
|
r_ps.subscribe("HighStartupRate", r_hsrt.update)
|
|
|
|
|
u_ps.subscribe("ReactorSCRAM", r_scram.update)
|
|
|
|
|
u_ps.subscribe("ManualReactorSCRAM", r_mscrm.update)
|
|
|
|
|
u_ps.subscribe("AutoReactorSCRAM", r_ascrm.update)
|
|
|
|
|
u_ps.subscribe("RCPTrip", r_rtrip.update)
|
|
|
|
|
u_ps.subscribe("RCSFlowLow", r_cflow.update)
|
|
|
|
|
u_ps.subscribe("CoolantLevelLow", r_clow.update)
|
|
|
|
|
u_ps.subscribe("ReactorTempHigh", r_temp.update)
|
|
|
|
|
u_ps.subscribe("ReactorHighDeltaT", r_rhdt.update)
|
|
|
|
|
u_ps.subscribe("FuelInputRateLow", r_firl.update)
|
|
|
|
|
u_ps.subscribe("WasteLineOcclusion", r_wloc.update)
|
|
|
|
|
u_ps.subscribe("HighStartupRate", r_hsrt.update)
|
|
|
|
|
|
|
|
|
|
-- RPS annunciator panel
|
|
|
|
|
|
|
|
|
|
@@ -216,16 +216,16 @@ local function init(parent, id)
|
|
|
|
|
local rps_tmo = IndicatorLight{parent=rps_annunc,label="Timeout",colors=cpair(colors.yellow,colors.gray),flash=true,period=period.BLINK_500_MS}
|
|
|
|
|
local rps_sfl = IndicatorLight{parent=rps_annunc,label="System Failure",colors=cpair(colors.orange,colors.gray),flash=true,period=period.BLINK_500_MS}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("rps_tripped", rps_trp.update)
|
|
|
|
|
r_ps.subscribe("dmg_crit", rps_dmg.update)
|
|
|
|
|
r_ps.subscribe("ex_hcool", rps_exh.update)
|
|
|
|
|
r_ps.subscribe("ex_waste", rps_exw.update)
|
|
|
|
|
r_ps.subscribe("high_temp", rps_tmp.update)
|
|
|
|
|
r_ps.subscribe("no_fuel", rps_nof.update)
|
|
|
|
|
r_ps.subscribe("no_cool", rps_noc.update)
|
|
|
|
|
r_ps.subscribe("fault", rps_flt.update)
|
|
|
|
|
r_ps.subscribe("timeout", rps_tmo.update)
|
|
|
|
|
r_ps.subscribe("sys_fail", rps_sfl.update)
|
|
|
|
|
u_ps.subscribe("rps_tripped", rps_trp.update)
|
|
|
|
|
u_ps.subscribe("dmg_crit", rps_dmg.update)
|
|
|
|
|
u_ps.subscribe("ex_hcool", rps_exh.update)
|
|
|
|
|
u_ps.subscribe("ex_waste", rps_exw.update)
|
|
|
|
|
u_ps.subscribe("high_temp", rps_tmp.update)
|
|
|
|
|
u_ps.subscribe("no_fuel", rps_nof.update)
|
|
|
|
|
u_ps.subscribe("no_cool", rps_noc.update)
|
|
|
|
|
u_ps.subscribe("fault", rps_flt.update)
|
|
|
|
|
u_ps.subscribe("timeout", rps_tmo.update)
|
|
|
|
|
u_ps.subscribe("sys_fail", rps_sfl.update)
|
|
|
|
|
|
|
|
|
|
-- cooling annunciator panel
|
|
|
|
|
|
|
|
|
|
@@ -240,11 +240,11 @@ local function init(parent, id)
|
|
|
|
|
local c_mwrf = IndicatorLight{parent=rcs_annunc,label="Max Water Return Feed",colors=cpair(colors.yellow,colors.gray)}
|
|
|
|
|
local c_tbnt = IndicatorLight{parent=rcs_annunc,label="Turbine Trip",colors=cpair(colors.red,colors.gray),flash=true,period=period.BLINK_250_MS}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("CoolantFeedMismatch", c_cfm.update)
|
|
|
|
|
r_ps.subscribe("BoilRateMismatch", c_brm.update)
|
|
|
|
|
r_ps.subscribe("SteamFeedMismatch", c_sfm.update)
|
|
|
|
|
r_ps.subscribe("MaxWaterReturnFeed", c_mwrf.update)
|
|
|
|
|
r_ps.subscribe("TurbineTrip", c_tbnt.update)
|
|
|
|
|
u_ps.subscribe("CoolantFeedMismatch", c_cfm.update)
|
|
|
|
|
u_ps.subscribe("BoilRateMismatch", c_brm.update)
|
|
|
|
|
u_ps.subscribe("SteamFeedMismatch", c_sfm.update)
|
|
|
|
|
u_ps.subscribe("MaxWaterReturnFeed", c_mwrf.update)
|
|
|
|
|
u_ps.subscribe("TurbineTrip", c_tbnt.update)
|
|
|
|
|
|
|
|
|
|
rcs_annunc.line_break()
|
|
|
|
|
|
|
|
|
|
@@ -337,8 +337,8 @@ local function init(parent, id)
|
|
|
|
|
local set_burn = function () unit.set_burn(burn_rate.get_value()) end
|
|
|
|
|
local set_burn_btn = PushButton{parent=burn_control,x=14,y=2,text="SET",min_width=5,fg_bg=cpair(colors.black,colors.yellow),active_fg_bg=cpair(colors.white,colors.gray),dis_fg_bg=dis_colors,callback=set_burn}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("burn_rate", burn_rate.set_value)
|
|
|
|
|
r_ps.subscribe("max_burn", burn_rate.set_max)
|
|
|
|
|
u_ps.subscribe("burn_rate", burn_rate.set_value)
|
|
|
|
|
u_ps.subscribe("max_burn", burn_rate.set_max)
|
|
|
|
|
|
|
|
|
|
local start = HazardButton{parent=main,x=2,y=28,text="START",accent=colors.lightBlue,dis_colors=dis_colors,callback=unit.start,fg_bg=hzd_fg_bg}
|
|
|
|
|
local ack_a = HazardButton{parent=main,x=12,y=32,text="ACK \x13",accent=colors.orange,dis_colors=dis_colors,callback=unit.ack_alarms,fg_bg=hzd_fg_bg}
|
|
|
|
|
@@ -359,9 +359,9 @@ local function init(parent, id)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("status", start_button_en_check)
|
|
|
|
|
r_ps.subscribe("rps_tripped", start_button_en_check)
|
|
|
|
|
r_ps.subscribe("rps_tripped", function (active) if active then reset.enable() else reset.disable() end end)
|
|
|
|
|
u_ps.subscribe("status", start_button_en_check)
|
|
|
|
|
u_ps.subscribe("rps_tripped", start_button_en_check)
|
|
|
|
|
u_ps.subscribe("rps_tripped", function (active) if active then reset.enable() else reset.disable() end end)
|
|
|
|
|
|
|
|
|
|
TextBox{parent=main,text="WASTE PROCESSING",fg_bg=cpair(colors.black,colors.brown),alignment=TEXT_ALIGN.CENTER,width=33,height=1,x=46,y=48}
|
|
|
|
|
local waste_proc = Rectangle{parent=main,border=border(1,colors.brown,true),thin=true,width=33,height=3,x=46,y=49}
|
|
|
|
|
@@ -369,7 +369,7 @@ local function init(parent, id)
|
|
|
|
|
|
|
|
|
|
local waste_mode = MultiButton{parent=waste_div,x=1,y=1,options=waste_opts,callback=unit.set_waste,min_width=6}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("U_WasteMode", waste_mode.set_value)
|
|
|
|
|
u_ps.subscribe("U_WasteMode", waste_mode.set_value)
|
|
|
|
|
|
|
|
|
|
----------------------
|
|
|
|
|
-- alarm management --
|
|
|
|
|
@@ -392,20 +392,20 @@ local function init(parent, id)
|
|
|
|
|
local a_clt = AlarmLight{parent=alarm_panel,x=6,label="RCS Transient",c1=colors.gray,c2=colors.yellow,c3=colors.green,flash=true,period=period.BLINK_500_MS}
|
|
|
|
|
local a_tbt = AlarmLight{parent=alarm_panel,x=6,label="Turbine Trip",c1=colors.gray,c2=colors.red,c3=colors.green,flash=true,period=period.BLINK_250_MS}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("Alarm_1", a_brc.update)
|
|
|
|
|
r_ps.subscribe("Alarm_2", a_rad.update)
|
|
|
|
|
r_ps.subscribe("Alarm_4", a_dmg.update)
|
|
|
|
|
u_ps.subscribe("Alarm_1", a_brc.update)
|
|
|
|
|
u_ps.subscribe("Alarm_2", a_rad.update)
|
|
|
|
|
u_ps.subscribe("Alarm_4", a_dmg.update)
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("Alarm_3", a_rcl.update)
|
|
|
|
|
r_ps.subscribe("Alarm_5", a_rcd.update)
|
|
|
|
|
r_ps.subscribe("Alarm_6", a_rot.update)
|
|
|
|
|
r_ps.subscribe("Alarm_7", a_rht.update)
|
|
|
|
|
r_ps.subscribe("Alarm_8", a_rwl.update)
|
|
|
|
|
r_ps.subscribe("Alarm_9", a_rwh.update)
|
|
|
|
|
u_ps.subscribe("Alarm_3", a_rcl.update)
|
|
|
|
|
u_ps.subscribe("Alarm_5", a_rcd.update)
|
|
|
|
|
u_ps.subscribe("Alarm_6", a_rot.update)
|
|
|
|
|
u_ps.subscribe("Alarm_7", a_rht.update)
|
|
|
|
|
u_ps.subscribe("Alarm_8", a_rwl.update)
|
|
|
|
|
u_ps.subscribe("Alarm_9", a_rwh.update)
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("Alarm_10", a_rps.update)
|
|
|
|
|
r_ps.subscribe("Alarm_11", a_clt.update)
|
|
|
|
|
r_ps.subscribe("Alarm_12", a_tbt.update)
|
|
|
|
|
u_ps.subscribe("Alarm_10", a_rps.update)
|
|
|
|
|
u_ps.subscribe("Alarm_11", a_clt.update)
|
|
|
|
|
u_ps.subscribe("Alarm_12", a_tbt.update)
|
|
|
|
|
|
|
|
|
|
-- ack's and resets
|
|
|
|
|
|
|
|
|
|
@@ -470,22 +470,22 @@ local function init(parent, id)
|
|
|
|
|
TextBox{parent=auto_div,text="Prio. Group",height=1,width=11,fg_bg=style.label}
|
|
|
|
|
local auto_grp = TextBox{parent=auto_div,text="Manual",height=1,width=11,fg_bg=bw_fg_bg}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("auto_group", auto_grp.set_value)
|
|
|
|
|
u_ps.subscribe("auto_group", auto_grp.set_value)
|
|
|
|
|
|
|
|
|
|
auto_div.line_break()
|
|
|
|
|
|
|
|
|
|
local a_rdy = IndicatorLight{parent=auto_div,label="Ready",x=2,colors=cpair(colors.green,colors.gray)}
|
|
|
|
|
local a_stb = IndicatorLight{parent=auto_div,label="Standby",x=2,colors=cpair(colors.white,colors.gray),flash=true,period=period.BLINK_1000_MS}
|
|
|
|
|
|
|
|
|
|
r_ps.subscribe("U_AutoReady", a_rdy.update)
|
|
|
|
|
u_ps.subscribe("U_AutoReady", a_rdy.update)
|
|
|
|
|
|
|
|
|
|
-- update standby indicator
|
|
|
|
|
r_ps.subscribe("status", function (active)
|
|
|
|
|
u_ps.subscribe("status", function (active)
|
|
|
|
|
a_stb.update(unit.annunciator.AutoControl and (not active))
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
-- enable and disable controls based on auto control state (start button is handled separately)
|
|
|
|
|
r_ps.subscribe("AutoControl", function (auto_active)
|
|
|
|
|
u_ps.subscribe("AutoControl", function (auto_active)
|
|
|
|
|
start_button_en_check()
|
|
|
|
|
|
|
|
|
|
if auto_active then
|
|
|
|
|
|