cleanup for pull request

This commit is contained in:
Mikayla 2024-06-14 21:10:42 +00:00
parent 87a91e309d
commit 1c719ad67b
9 changed files with 33 additions and 47 deletions

View File

@ -29,7 +29,6 @@ local function textbox(args)
if args.anchor == true then args.can_focus = true end if args.anchor == true then args.can_focus = true end
-- regex to identify entries without a height currently: ^.*TextBox\{((?!height=).)*$
-- provide a constraint condition to element creation to prevent an pointlessly tall text box -- provide a constraint condition to element creation to prevent an pointlessly tall text box
---@param frame graphics_frame ---@param frame graphics_frame
local function constrain(frame) local function constrain(frame)

View File

@ -489,7 +489,7 @@ function iocontrol.record_unit_data(data)
local anc = unit.annunciator local anc = unit.annunciator
rcs_hazard = rcs_hazard or anc.RCPTrip rcs_hazard = rcs_hazard or anc.RCPTrip
rcs_warn = rcs_warn or anc.RCSFlowLow or anc.CoolantLevelLow or anc.RCSFault or anc.MaxWaterReturnFeed or rcs_warn = rcs_warn or anc.RCSFlowLow or anc.CoolantLevelLow or anc.RCSFault or anc.MaxWaterReturnFeed or
anc.CoolantFeedMismatch or anc.BoilRateMismatch or anc.SteamFeedMismatch or anc.MaxWaterReturnFeed anc.CoolantFeedMismatch or anc.BoilRateMismatch or anc.SteamFeedMismatch
local rcs_status = 4 local rcs_status = 4
if rcs_hazard then if rcs_hazard then
@ -706,18 +706,12 @@ function iocontrol.record_unit_data(data)
end end
if tripped(unit.alarms[ALARM.ReactorDamage]) then if tripped(unit.alarms[ALARM.ReactorDamage]) then
local items = { local items = { white("REACTOR DAMAGED"), blue("CHECK RCS"), blue("AWAIT DMG REDUCED") }
white("REACTOR DAMAGED"), blue("CHECK RCS"), blue("AWAIT DMG REDUCED")
}
table.insert(ecam, { color = colors.red, text = "REACTOR DAMAGE", help = "ReactorDamage", items = items }) table.insert(ecam, { color = colors.red, text = "REACTOR DAMAGE", help = "ReactorDamage", items = items })
end end
if tripped(unit.alarms[ALARM.ReactorOverTemp]) then if tripped(unit.alarms[ALARM.ReactorOverTemp]) then
local items = { local items = { white("DAMAGING TEMP"), blue("CHECK RCS"), blue("AWAIT COOLDOWN") }
white("DAMAGING TEMP"), blue("CHECK RCS"), blue("AWAIT COOLDOWN")
}
table.insert(ecam, { color = colors.red, text = "REACTOR OVER TEMP", help = "ReactorOverTemp", items = items }) table.insert(ecam, { color = colors.red, text = "REACTOR OVER TEMP", help = "ReactorOverTemp", items = items })
end end
@ -728,7 +722,6 @@ function iocontrol.record_unit_data(data)
if tripped(unit.alarms[ALARM.ReactorWasteLeak]) then if tripped(unit.alarms[ALARM.ReactorWasteLeak]) then
local items = { white("AT WASTE CAPACITY"), blue("CHECK WASTE OUTPUT"), blue("KEEP RCT DISABLED") } local items = { white("AT WASTE CAPACITY"), blue("CHECK WASTE OUTPUT"), blue("KEEP RCT DISABLED") }
table.insert(ecam, { color = colors.red, text = "REACTOR WASTE LEAK", help = "ReactorWasteLeak", items = items}) table.insert(ecam, { color = colors.red, text = "REACTOR WASTE LEAK", help = "ReactorWasteLeak", items = items})
end end
@ -741,9 +734,7 @@ function iocontrol.record_unit_data(data)
local items = {} local items = {}
local stat = unit.reactor_data.rps_status local stat = unit.reactor_data.rps_status
-- for k, _ in pairs(stat) do -- for k, _ in pairs(stat) do stat[k] = true end
-- stat[k] = true
-- end
local function insert(cond, key, text, color) if cond[key] then table.insert(items, { text = text, help = key, color = color }) end end local function insert(cond, key, text, color) if cond[key] then table.insert(items, { text = text, help = key, color = color }) end end

View File

@ -143,8 +143,8 @@ function threads.thread__render(smem)
-- load in from shared memory -- load in from shared memory
local pkt_state = smem.pkt_state local pkt_state = smem.pkt_state
local render_queue = smem.q.mq_render
local nav = smem.pkt_sys.nav local nav = smem.pkt_sys.nav
local render_queue = smem.q.mq_render
local last_update = util.time() local last_update = util.time()

View File

@ -84,7 +84,7 @@ local function new_view(root)
local use = Div{parent=page_div,x=2,width=p_width} local use = Div{parent=page_div,x=2,width=p_width}
local uis = Div{parent=page_div,x=2,width=p_width} local uis = Div{parent=page_div,x=2,width=p_width}
local fps = Div{parent=page_div,x=2,width=p_width} local fps = Div{parent=page_div,x=2,width=p_width}
local gls = Div{parent=page_div,x=2} local gls = Div{parent=page_div,x=2,width=p_width}
local panes = { home, search, use, uis, fps, gls } local panes = { home, search, use, uis, fps, gls }
local doc_map = {} local doc_map = {}
@ -118,7 +118,7 @@ local function new_view(root)
search_results.remove_all() search_results.remove_all()
if string.len(query) < 3 then if string.len(query) < 3 then
TextBox{parent=search_results,text=util.trinary(string.len(query)==0,"Click 'GO' to search...","Search requires at least 3 characters.")} TextBox{parent=search_results,text="Search requires at least 3 characters."}
return return
end end

View File

@ -3,7 +3,6 @@
-- --
local util = require("scada-common.util") local util = require("scada-common.util")
-- local log = require("scada-common.log")
local iocontrol = require("pocket.iocontrol") local iocontrol = require("pocket.iocontrol")
local pocket = require("pocket.pocket") local pocket = require("pocket.pocket")
@ -23,12 +22,10 @@ local TextBox = require("graphics.elements.textbox")
local WaitingAnim = require("graphics.elements.animations.waiting") local WaitingAnim = require("graphics.elements.animations.waiting")
local PushButton = require("graphics.elements.controls.push_button")
local DataIndicator = require("graphics.elements.indicators.data") local DataIndicator = require("graphics.elements.indicators.data")
local IconIndicator = require("graphics.elements.indicators.icon") local IconIndicator = require("graphics.elements.indicators.icon")
-- local RadIndicator = require("graphics.elements.indicators.rad")
-- local VerticalBar = require("graphics.elements.indicators.vbar")
local PushButton = require("graphics.elements.controls.push_button")
local ALIGN = core.ALIGN local ALIGN = core.ALIGN
local cpair = core.cpair local cpair = core.cpair

View File

@ -27,7 +27,7 @@ return function (data, base_page, title, items, scroll_height)
TextBox{parent=section_div,y=1,text=title,height=1,alignment=ALIGN.CENTER} TextBox{parent=section_div,y=1,text=title,height=1,alignment=ALIGN.CENTER}
PushButton{parent=section_div,x=3,y=1,text="<",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=base_page.nav_to} PushButton{parent=section_div,x=3,y=1,text="<",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=base_page.nav_to}
local gls_term_view_page = app.new_page(section_page, #panes + 1) local view_page = app.new_page(section_page, #panes + 1)
local section_view_div = Div{parent=page_div,x=2} local section_view_div = Div{parent=page_div,x=2}
table.insert(panes, section_view_div) table.insert(panes, section_view_div)
TextBox{parent=section_view_div,y=1,text=title,height=1,alignment=ALIGN.CENTER} TextBox{parent=section_view_div,y=1,text=title,height=1,alignment=ALIGN.CENTER}
@ -47,7 +47,7 @@ return function (data, base_page, title, items, scroll_height)
local function view() local function view()
_end.focus() _end.focus()
gls_term_view_page.nav_to() view_page.nav_to()
anchor.focus() anchor.focus()
end end

View File

@ -10,13 +10,13 @@ local core = require("graphics.core")
local Div = require("graphics.elements.div") local Div = require("graphics.elements.div")
local TextBox = require("graphics.elements.textbox") local TextBox = require("graphics.elements.textbox")
local PushButton = require("graphics.elements.controls.push_button")
local DataIndicator = require("graphics.elements.indicators.data") local DataIndicator = require("graphics.elements.indicators.data")
local StateIndicator = require("graphics.elements.indicators.state") local StateIndicator = require("graphics.elements.indicators.state")
local IconIndicator = require("graphics.elements.indicators.icon") local IconIndicator = require("graphics.elements.indicators.icon")
local VerticalBar = require("graphics.elements.indicators.vbar") local VerticalBar = require("graphics.elements.indicators.vbar")
local PushButton = require("graphics.elements.controls.push_button")
local ALIGN = core.ALIGN local ALIGN = core.ALIGN
local cpair = core.cpair local cpair = core.cpair

View File

@ -10,13 +10,13 @@ local core = require("graphics.core")
local Div = require("graphics.elements.div") local Div = require("graphics.elements.div")
local TextBox = require("graphics.elements.textbox") local TextBox = require("graphics.elements.textbox")
local PushButton = require("graphics.elements.controls.push_button")
local DataIndicator = require("graphics.elements.indicators.data") local DataIndicator = require("graphics.elements.indicators.data")
local StateIndicator = require("graphics.elements.indicators.state") local StateIndicator = require("graphics.elements.indicators.state")
local IconIndicator = require("graphics.elements.indicators.icon") local IconIndicator = require("graphics.elements.indicators.icon")
local VerticalBar = require("graphics.elements.indicators.vbar") local VerticalBar = require("graphics.elements.indicators.vbar")
local PushButton = require("graphics.elements.controls.push_button")
local ALIGN = core.ALIGN local ALIGN = core.ALIGN
local cpair = core.cpair local cpair = core.cpair

View File

@ -9,14 +9,14 @@ local core = require("graphics.core")
local Div = require("graphics.elements.div") local Div = require("graphics.elements.div")
local TextBox = require("graphics.elements.textbox") local TextBox = require("graphics.elements.textbox")
local PushButton = require("graphics.elements.controls.push_button")
local DataIndicator = require("graphics.elements.indicators.data") local DataIndicator = require("graphics.elements.indicators.data")
local IconIndicator = require("graphics.elements.indicators.icon") local IconIndicator = require("graphics.elements.indicators.icon")
local PowerIndicator = require("graphics.elements.indicators.power") local PowerIndicator = require("graphics.elements.indicators.power")
local StateIndicator = require("graphics.elements.indicators.state") local StateIndicator = require("graphics.elements.indicators.state")
local VerticalBar = require("graphics.elements.indicators.vbar") local VerticalBar = require("graphics.elements.indicators.vbar")
local PushButton = require("graphics.elements.controls.push_button")
local ALIGN = core.ALIGN local ALIGN = core.ALIGN
local cpair = core.cpair local cpair = core.cpair
@ -79,7 +79,6 @@ return function (app, u_page, panes, tbn_pane, u_id, t_id, ps, update)
t_gtrp.register(ps, "GeneratorTrip", t_gtrp.update) t_gtrp.register(ps, "GeneratorTrip", t_gtrp.update)
t_trp.register(ps, "TurbineTrip", t_trp.update) t_trp.register(ps, "TurbineTrip", t_trp.update)
local tbn_ext_div = Div{parent=tbn_pane,x=2,width=tbn_pane.get_width()-2} local tbn_ext_div = Div{parent=tbn_pane,x=2,width=tbn_pane.get_width()-2}
table.insert(panes, tbn_ext_div) table.insert(panes, tbn_ext_div)