From 291860832670804d32dc8346d4b42c8bdeeb4d1a Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Thu, 28 Jul 2022 11:17:58 -0400 Subject: [PATCH] #73 updated unit layout for graphics library changes --- coordinator/ui/layout/unit_view.lua | 55 +++++++++++++++-------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/coordinator/ui/layout/unit_view.lua b/coordinator/ui/layout/unit_view.lua index 45ce5ed..6016128 100644 --- a/coordinator/ui/layout/unit_view.lua +++ b/coordinator/ui/layout/unit_view.lua @@ -43,51 +43,54 @@ local function init(monitor, id) local burn_control = Div{parent=main,x=13,y=core_height+4,width=19,height=3,fg_bg=cpair(colors.gray,colors.white)} - main(scram, burn_control) - local burn_rate = SpinboxNumeric{parent=burn_control,x=2,y=1,whole_num_precision=4,fractional_precision=1,arrow_fg_bg=cpair(colors.gray,colors.white),fg_bg=cpair(colors.black,colors.white)} local set_burn = function () print("set burn to " .. burn_rate.get_value()) end - burn_control(burn_rate) - TextBox{parent=burn_control,x=9,y=2,text="mB/t"} - burn_control(PushButton{parent=burn_control,x=14,y=2,text="SET",min_width=5,fg_bg=cpair(colors.black,colors.yellow),callback=set_burn}) + PushButton{parent=burn_control,x=14,y=2,text="SET",min_width=5,fg_bg=cpair(colors.black,colors.yellow),callback=set_burn} local annunciator = Div{parent=main,x=34,y=core_height+4} -- annunciator colors per IAEA-TECDOC-812 recommendations -- connectivity/basic state - local plc_online = IndicatorLight{parent=annunciator,x=1,y=1,label="PLC Online",colors=cpair(colors.green,colors.red)} - local r_active = IndicatorLight{parent=annunciator,x=1,y=2,label="Active",colors=cpair(colors.green,colors.gray)} - local r_auto = IndicatorLight{parent=annunciator,x=1,y=3,label="Auto Control",colors=cpair(colors.blue,colors.gray)} + local plc_online = IndicatorLight{parent=annunciator,label="PLC Online",colors=cpair(colors.green,colors.red)} + local plc_hbeat = IndicatorLight{parent=annunciator,label="PLC Heartbeat",colors=cpair(colors.white,colors.red)} + local r_active = IndicatorLight{parent=annunciator,label="Active",colors=cpair(colors.green,colors.gray)} + local r_auto = IndicatorLight{parent=annunciator,label="Auto Control",colors=cpair(colors.blue,colors.gray)} + + annunciator.line_break() -- annunciator fields - local r_trip = IndicatorLight{parent=annunciator,x=1,y=5,label="Reactor Trip",colors=cpair(colors.red,colors.gray)} - local r_mtrp = IndicatorLight{parent=annunciator,x=1,y=6,label="Manual Reactor Trip",colors=cpair(colors.red,colors.gray)} - local r_rtrp = IndicatorLight{parent=annunciator,x=1,y=7,label="RCP Trip",colors=cpair(colors.red,colors.gray)} - local r_cflo = IndicatorLight{parent=annunciator,x=1,y=8,label="RCS Flow Low",colors=cpair(colors.yellow,colors.gray)} - local r_temp = IndicatorLight{parent=annunciator,x=1,y=9,label="Reactor Temp. High",colors=cpair(colors.red,colors.gray)} - local r_rhdt = IndicatorLight{parent=annunciator,x=1,y=10,label="Reactor High Delta T",colors=cpair(colors.yellow,colors.gray)} - local r_firl = IndicatorLight{parent=annunciator,x=1,y=11,label="Fuel Input Rate Low",colors=cpair(colors.yellow,colors.gray)} - local r_wloc = IndicatorLight{parent=annunciator,x=1,y=12,label="Waste Line Occlusion",colors=cpair(colors.yellow,colors.gray)} - local r_hsrt = IndicatorLight{parent=annunciator,x=1,y=13,label="High Startup Rate",colors=cpair(colors.yellow,colors.gray)} + local r_trip = IndicatorLight{parent=annunciator,label="Reactor Trip",colors=cpair(colors.red,colors.gray)} + local r_mtrp = IndicatorLight{parent=annunciator,label="Manual Reactor Trip",colors=cpair(colors.red,colors.gray)} + local r_rtrp = IndicatorLight{parent=annunciator,label="RCP Trip",colors=cpair(colors.red,colors.gray)} + local r_cflo = IndicatorLight{parent=annunciator,label="RCS Flow Low",colors=cpair(colors.yellow,colors.gray)} + local r_temp = IndicatorLight{parent=annunciator,label="Reactor Temp. High",colors=cpair(colors.red,colors.gray)} + local r_rhdt = IndicatorLight{parent=annunciator,label="Reactor High Delta T",colors=cpair(colors.yellow,colors.gray)} + local r_firl = IndicatorLight{parent=annunciator,label="Fuel Input Rate Low",colors=cpair(colors.yellow,colors.gray)} + local r_wloc = IndicatorLight{parent=annunciator,label="Waste Line Occlusion",colors=cpair(colors.yellow,colors.gray)} + local r_hsrt = IndicatorLight{parent=annunciator,label="High Startup Rate",colors=cpair(colors.yellow,colors.gray)} + + annunciator.line_break() -- RPS - local rps_trp = IndicatorLight{parent=annunciator,x=1,y=15,label="RPS Trip",colors=cpair(colors.red,colors.gray)} - local rps_dmg = IndicatorLight{parent=annunciator,x=1,y=16,label="Damage Critical",colors=cpair(colors.yellow,colors.gray)} - local rps_exh = IndicatorLight{parent=annunciator,x=1,y=17,label="Excess Heated Coolant",colors=cpair(colors.yellow,colors.gray)} - local rps_exc = IndicatorLight{parent=annunciator,x=1,y=18,label="Excess Waste",colors=cpair(colors.yellow,colors.gray)} - local rps_tmp = IndicatorLight{parent=annunciator,x=1,y=19,label="High Core Temp",colors=cpair(colors.yellow,colors.gray)} - local rps_nof = IndicatorLight{parent=annunciator,x=1,y=20,label="No Fuel",colors=cpair(colors.yellow,colors.gray)} - local rps_noc = IndicatorLight{parent=annunciator,x=1,y=21,label="No Coolant",colors=cpair(colors.yellow,colors.gray)} - local rps_flt = IndicatorLight{parent=annunciator,x=1,y=22,label="PPM Fault",colors=cpair(colors.yellow,colors.gray)} - local rps_tmo = IndicatorLight{parent=annunciator,x=1,y=23,label="Timeout",colors=cpair(colors.yellow,colors.gray)} + local rps_trp = IndicatorLight{parent=annunciator,label="RPS Trip",colors=cpair(colors.red,colors.gray)} + local rps_dmg = IndicatorLight{parent=annunciator,label="Damage Critical",colors=cpair(colors.yellow,colors.gray)} + local rps_exh = IndicatorLight{parent=annunciator,label="Excess Heated Coolant",colors=cpair(colors.yellow,colors.gray)} + local rps_exc = IndicatorLight{parent=annunciator,label="Excess Waste",colors=cpair(colors.yellow,colors.gray)} + local rps_tmp = IndicatorLight{parent=annunciator,label="High Core Temp",colors=cpair(colors.yellow,colors.gray)} + local rps_nof = IndicatorLight{parent=annunciator,label="No Fuel",colors=cpair(colors.yellow,colors.gray)} + local rps_noc = IndicatorLight{parent=annunciator,label="No Coolant",colors=cpair(colors.yellow,colors.gray)} + local rps_flt = IndicatorLight{parent=annunciator,label="PPM Fault",colors=cpair(colors.yellow,colors.gray)} + local rps_tmo = IndicatorLight{parent=annunciator,label="Timeout",colors=cpair(colors.yellow,colors.gray)} + plc_hbeat.update(true) r_auto.update(true) r_trip.update(true) r_mtrp.update(true) rps_trp.update(true) + rps_nof.update(true) return main end