#528 configurator fixes, restoring textbox whitespace handling and adding specific trim whitespace option

This commit is contained in:
Mikayla Fischler 2024-10-12 00:30:58 -04:00
parent 0497ec44e9
commit 89ab742f8e
8 changed files with 15 additions and 14 deletions

View File

@ -206,10 +206,10 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
TextBox{parent=fac_c_1,x=1,y=1,height=4,text="This tool can attempt to connect to your supervisor computer. This would load facility information in order to get the unit count and aid monitor setup."} TextBox{parent=fac_c_1,x=1,y=1,height=4,text="This tool can attempt to connect to your supervisor computer. This would load facility information in order to get the unit count and aid monitor setup."}
TextBox{parent=fac_c_1,x=1,y=6,height=2,text="The supervisor startup app must be running and fully configured on your supervisor computer."} TextBox{parent=fac_c_1,x=1,y=6,height=2,text="The supervisor startup app must be running and fully configured on your supervisor computer."}
tool_ctl.sv_conn_status = TextBox{parent=fac_c_1,x=11,y=9,text=""} self.sv_conn_status = TextBox{parent=fac_c_1,x=11,y=9,text=""}
tool_ctl.sv_conn_detail = TextBox{parent=fac_c_1,x=1,y=11,height=2,text=""} self.sv_conn_detail = TextBox{parent=fac_c_1,x=1,y=11,height=2,text=""}
tool_ctl.sv_conn_button = PushButton{parent=fac_c_1,x=1,y=9,text="Connect",min_width=9,callback=function()sv_connect()end,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} self.sv_conn_button = PushButton{parent=fac_c_1,x=1,y=9,text="Connect",min_width=9,callback=function()sv_connect()end,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
local function sv_skip() local function sv_skip()
tcd.abort(handle_timeout) tcd.abort(handle_timeout)
@ -225,8 +225,8 @@ function facility.create(tool_ctl, main_pane, cfg_sys, fac_cfg, style)
end end
PushButton{parent=fac_c_1,x=1,y=14,text="\x1b Back",callback=function()main_pane.set_value(2)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} PushButton{parent=fac_c_1,x=1,y=14,text="\x1b Back",callback=function()main_pane.set_value(2)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}
tool_ctl.sv_skip = PushButton{parent=fac_c_1,x=44,y=14,text="Skip \x1a",callback=sv_skip,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} self.sv_skip = PushButton{parent=fac_c_1,x=44,y=14,text="Skip \x1a",callback=sv_skip,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg}
tool_ctl.sv_next = PushButton{parent=fac_c_1,x=44,y=14,text="Next \x1a",callback=sv_next,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,hidden=true} self.sv_next = PushButton{parent=fac_c_1,x=44,y=14,text="Next \x1a",callback=sv_next,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,hidden=true}
TextBox{parent=fac_c_2,x=1,y=1,height=3,text="Please enter the number of reactors you have, also referred to as reactor units or 'units' for short. A maximum of 4 is currently supported."} TextBox{parent=fac_c_2,x=1,y=1,height=3,text="Please enter the number of reactors you have, also referred to as reactor units or 'units' for short. A maximum of 4 is currently supported."}
tool_ctl.num_units = NumberField{parent=fac_c_2,x=1,y=5,width=5,max_chars=2,default=ini_cfg.UnitCount,min=1,max=4,fg_bg=bw_fg_bg} tool_ctl.num_units = NumberField{parent=fac_c_2,x=1,y=5,width=5,max_chars=2,default=ini_cfg.UnitCount,min=1,max=4,fg_bg=bw_fg_bg}

View File

@ -19,7 +19,7 @@ local renderer = require("coordinator.renderer")
local sounder = require("coordinator.sounder") local sounder = require("coordinator.sounder")
local threads = require("coordinator.threads") local threads = require("coordinator.threads")
local COORDINATOR_VERSION = "v1.5.11" local COORDINATOR_VERSION = "v1.5.12"
local CHUNK_LOAD_DELAY_S = 30.0 local CHUNK_LOAD_DELAY_S = 30.0

View File

@ -7,7 +7,7 @@ local flasher = require("graphics.flasher")
local core = {} local core = {}
core.version = "2.4.2" core.version = "2.4.3"
core.flasher = flasher core.flasher = flasher
core.events = events core.events = events

View File

@ -10,6 +10,7 @@ local ALIGN = core.ALIGN
---@class textbox_args ---@class textbox_args
---@field text string text to show ---@field text string text to show
---@field alignment? ALIGN text alignment, left by default ---@field alignment? ALIGN text alignment, left by default
---@field trim_whitespace? boolean true to trim whitespace before/after lines of text
---@field anchor? boolean true to use this as an anchor, making it focusable ---@field anchor? boolean true to use this as an anchor, making it focusable
---@field parent graphics_element ---@field parent graphics_element
---@field id? string element id ---@field id? string element id
@ -59,7 +60,7 @@ return function (args)
-- trim leading/trailing whitespace, except on the first line -- trim leading/trailing whitespace, except on the first line
-- leading whitespace on the first line is usually intentional -- leading whitespace on the first line is usually intentional
if i > 1 then if args.trim_whitespace == true then
lines[i] = util.trim(lines[i]) lines[i] = util.trim(lines[i])
end end

View File

@ -20,7 +20,7 @@ local pocket = require("pocket.pocket")
local renderer = require("pocket.renderer") local renderer = require("pocket.renderer")
local threads = require("pocket.threads") local threads = require("pocket.threads")
local POCKET_VERSION = "v0.12.4-alpha" local POCKET_VERSION = "v0.12.5-alpha"
local println = util.println local println = util.println
local println_ts = util.println_ts local println_ts = util.println_ts

View File

@ -29,15 +29,15 @@ local function init(parent, y, is_api)
local waiting_x = math.floor(parent.get_width() / 2) - 1 local waiting_x = math.floor(parent.get_width() / 2) - 1
local msg = TextBox{parent=box,x=3,y=11,width=box.get_width()-4,height=2,text="",alignment=ALIGN.CENTER,fg_bg=cpair(colors.red,style.root.bkg)} local msg = TextBox{parent=box,x=3,y=11,width=box.get_width()-4,height=2,text="",alignment=ALIGN.CENTER,fg_bg=cpair(colors.red,style.root.bkg),trim_whitespace=true}
if is_api then if is_api then
WaitingAnim{parent=box,x=waiting_x,y=1,fg_bg=cpair(colors.blue,style.root.bkg)} WaitingAnim{parent=box,x=waiting_x,y=1,fg_bg=cpair(colors.blue,style.root.bkg)}
TextBox{parent=box,y=5,text="Connecting to API",alignment=ALIGN.CENTER,fg_bg=cpair(colors.white,style.root.bkg)} TextBox{parent=box,y=5,text="Connecting to API",alignment=ALIGN.CENTER,fg_bg=cpair(colors.white,style.root.bkg),trim_whitespace=true}
msg.register(iocontrol.get_db().ps, "api_link_msg", msg.set_value) msg.register(iocontrol.get_db().ps, "api_link_msg", msg.set_value)
else else
WaitingAnim{parent=box,x=waiting_x,y=1,fg_bg=cpair(colors.green,style.root.bkg)} WaitingAnim{parent=box,x=waiting_x,y=1,fg_bg=cpair(colors.green,style.root.bkg)}
TextBox{parent=box,y=5,text="Connecting to Supervisor",alignment=ALIGN.CENTER,fg_bg=cpair(colors.white,style.root.bkg)} TextBox{parent=box,y=5,text="Connecting to Supervisor",alignment=ALIGN.CENTER,fg_bg=cpair(colors.white,style.root.bkg),trim_whitespace=true}
msg.register(iocontrol.get_db().ps, "svr_link_msg", msg.set_value) msg.register(iocontrol.get_db().ps, "svr_link_msg", msg.set_value)
end end

View File

@ -222,7 +222,7 @@ local function config_view(display)
--#region System Configuration --#region System Configuration
local divs = { fac_cfg, net_cfg, log_cfg, clr_cfg, summary, import_err } local divs = { net_cfg, log_cfg, clr_cfg, summary, import_err }
system.create(tool_ctl, main_pane, settings, divs, fac_pane, style, exit) system.create(tool_ctl, main_pane, settings, divs, fac_pane, style, exit)

View File

@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions") local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v1.5.7" local SUPERVISOR_VERSION = "v1.5.8"
local println = util.println local println = util.println
local println_ts = util.println_ts local println_ts = util.println_ts