From c77993d3a01b4ca7cc247b68377e6002881185d2 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 5 Feb 2023 12:15:41 -0500 Subject: [PATCH] bottom align process control panel and induction matrix view --- .vscode/settings.json | 3 +++ coordinator/startup.lua | 2 +- coordinator/ui/components/imatrix.lua | 2 +- coordinator/ui/layout/main_view.lua | 19 +++++++++++++------ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0cc34d6..6f2ebaa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,5 +15,8 @@ "periphemu", "mekanismEnergyHelper", "_HOST" + ], + "Lua.diagnostics.disable": [ + "duplicate-set-field" ] } diff --git a/coordinator/startup.lua b/coordinator/startup.lua index 859d1d0..d9404f0 100644 --- a/coordinator/startup.lua +++ b/coordinator/startup.lua @@ -19,7 +19,7 @@ local iocontrol = require("coordinator.iocontrol") local renderer = require("coordinator.renderer") local sounder = require("coordinator.sounder") -local COORDINATOR_VERSION = "beta-v0.8.18" +local COORDINATOR_VERSION = "beta-v0.9.0" local print = util.print local println = util.println diff --git a/coordinator/ui/components/imatrix.lua b/coordinator/ui/components/imatrix.lua index c14e910..2910fbb 100644 --- a/coordinator/ui/components/imatrix.lua +++ b/coordinator/ui/components/imatrix.lua @@ -29,7 +29,7 @@ local function new_view(root, x, y, data, ps, id) local title = "INDUCTION MATRIX" if type(id) == "number" then title = title .. id end - local matrix = Div{parent=root,fg_bg=style.root,width=33,height=25,x=x,y=y} + local matrix = Div{parent=root,fg_bg=style.root,width=33,height=24,x=x,y=y} TextBox{parent=matrix,text=" ",width=33,height=1,x=1,y=1,fg_bg=cpair(colors.lightGray,colors.gray)} TextBox{parent=matrix,text=title,alignment=TEXT_ALIGN.CENTER,width=33,height=1,x=1,y=2,fg_bg=cpair(colors.lightGray,colors.gray)} diff --git a/coordinator/ui/layout/main_view.lua b/coordinator/ui/layout/main_view.lua index 127761c..b200f44 100644 --- a/coordinator/ui/layout/main_view.lua +++ b/coordinator/ui/layout/main_view.lua @@ -77,20 +77,27 @@ local function init(monitor) end end - -- command & control + -- command & control - TextBox{parent=main,y=cnc_y_start,text=util.strrep("\x8c", header.width()),alignment=TEXT_ALIGN.CENTER,height=1,fg_bg=cpair(colors.lightGray,colors.gray)} + cnc_y_start = cnc_y_start - cnc_y_start = cnc_y_start + 2 + -- induction matrix and process control interfaces are 24 tall + space needed for divider + local cnc_bottom_align_start = main.height() - 26 - local process = process_ctl(main, 2, cnc_y_start) + assert(cnc_bottom_align_start >= cnc_y_start, "main display not of sufficient vertical resolution (add an additional row of monitors)") + + TextBox{parent=main,y=cnc_bottom_align_start,text=util.strrep("\x8c", header.width()),alignment=TEXT_ALIGN.CENTER,height=1,fg_bg=cpair(colors.lightGray,colors.gray)} + + cnc_bottom_align_start = cnc_bottom_align_start + 2 + + local process = process_ctl(main, 2, cnc_bottom_align_start) -- testing ---@fixme remove test code -- ColorMap{parent=main,x=98,y=(main.height()-1)} - local audio = Div{parent=main,width=23,height=23,x=107,y=cnc_y_start} + local audio = Div{parent=main,width=23,height=23,x=107,y=cnc_bottom_align_start} PushButton{parent=audio,x=16,y=1,text="TEST 1",min_width=8,fg_bg=cpair(colors.black,colors.yellow),active_fg_bg=cpair(colors.white,colors.gray),callback=sounder.test_1} PushButton{parent=audio,x=16,text="TEST 2",min_width=8,fg_bg=cpair(colors.black,colors.yellow),active_fg_bg=cpair(colors.white,colors.gray),callback=sounder.test_2} @@ -116,7 +123,7 @@ local function init(monitor) SwitchButton{parent=audio,x=1,text="RCS TRANSIENT",min_width=23,fg_bg=cpair(colors.black,colors.yellow),active_fg_bg=cpair(colors.white,colors.gray),callback=sounder.test_rcs} SwitchButton{parent=audio,x=1,text="TURBINE TRIP",min_width=23,fg_bg=cpair(colors.black,colors.yellow),active_fg_bg=cpair(colors.white,colors.gray),callback=sounder.test_turbinet} - local imatrix_1 = imatrix(main, 131, cnc_y_start, facility.induction_data_tbl[1], facility.induction_ps_tbl[1]) + local imatrix_1 = imatrix(main, 131, cnc_bottom_align_start, facility.induction_data_tbl[1], facility.induction_ps_tbl[1]) return main end