mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
cleanup for pull request
This commit is contained in:
parent
87a91e309d
commit
1c719ad67b
@ -29,7 +29,6 @@ local function textbox(args)
|
||||
|
||||
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
|
||||
---@param frame graphics_frame
|
||||
local function constrain(frame)
|
||||
|
@ -489,7 +489,7 @@ function iocontrol.record_unit_data(data)
|
||||
local anc = unit.annunciator
|
||||
rcs_hazard = rcs_hazard or anc.RCPTrip
|
||||
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
|
||||
if rcs_hazard then
|
||||
@ -706,18 +706,12 @@ function iocontrol.record_unit_data(data)
|
||||
end
|
||||
|
||||
if tripped(unit.alarms[ALARM.ReactorDamage]) then
|
||||
local items = {
|
||||
white("REACTOR DAMAGED"), blue("CHECK RCS"), blue("AWAIT DMG REDUCED")
|
||||
}
|
||||
|
||||
local items = { white("REACTOR DAMAGED"), blue("CHECK RCS"), blue("AWAIT DMG REDUCED") }
|
||||
table.insert(ecam, { color = colors.red, text = "REACTOR DAMAGE", help = "ReactorDamage", items = items })
|
||||
end
|
||||
|
||||
if tripped(unit.alarms[ALARM.ReactorOverTemp]) then
|
||||
local items = {
|
||||
white("DAMAGING TEMP"), blue("CHECK RCS"), blue("AWAIT COOLDOWN")
|
||||
}
|
||||
|
||||
local items = { white("DAMAGING TEMP"), blue("CHECK RCS"), blue("AWAIT COOLDOWN") }
|
||||
table.insert(ecam, { color = colors.red, text = "REACTOR OVER TEMP", help = "ReactorOverTemp", items = items })
|
||||
end
|
||||
|
||||
@ -728,7 +722,6 @@ function iocontrol.record_unit_data(data)
|
||||
|
||||
if tripped(unit.alarms[ALARM.ReactorWasteLeak]) then
|
||||
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})
|
||||
end
|
||||
|
||||
@ -741,9 +734,7 @@ function iocontrol.record_unit_data(data)
|
||||
local items = {}
|
||||
local stat = unit.reactor_data.rps_status
|
||||
|
||||
-- for k, _ in pairs(stat) do
|
||||
-- stat[k] = true
|
||||
-- end
|
||||
-- for k, _ in pairs(stat) do 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
|
||||
|
||||
|
@ -143,8 +143,8 @@ function threads.thread__render(smem)
|
||||
|
||||
-- load in from shared memory
|
||||
local pkt_state = smem.pkt_state
|
||||
local render_queue = smem.q.mq_render
|
||||
local nav = smem.pkt_sys.nav
|
||||
local render_queue = smem.q.mq_render
|
||||
|
||||
local last_update = util.time()
|
||||
|
||||
|
@ -84,7 +84,7 @@ local function new_view(root)
|
||||
local use = 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 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 doc_map = {}
|
||||
@ -118,7 +118,7 @@ local function new_view(root)
|
||||
search_results.remove_all()
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
--
|
||||
|
||||
local util = require("scada-common.util")
|
||||
-- local log = require("scada-common.log")
|
||||
|
||||
local iocontrol = require("pocket.iocontrol")
|
||||
local pocket = require("pocket.pocket")
|
||||
@ -23,12 +22,10 @@ local TextBox = require("graphics.elements.textbox")
|
||||
|
||||
local WaitingAnim = require("graphics.elements.animations.waiting")
|
||||
|
||||
local PushButton = require("graphics.elements.controls.push_button")
|
||||
|
||||
local DataIndicator = require("graphics.elements.indicators.data")
|
||||
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 cpair = core.cpair
|
||||
|
@ -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}
|
||||
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}
|
||||
table.insert(panes, section_view_div)
|
||||
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()
|
||||
_end.focus()
|
||||
gls_term_view_page.nav_to()
|
||||
view_page.nav_to()
|
||||
anchor.focus()
|
||||
end
|
||||
|
||||
|
@ -10,13 +10,13 @@ local core = require("graphics.core")
|
||||
local Div = require("graphics.elements.div")
|
||||
local TextBox = require("graphics.elements.textbox")
|
||||
|
||||
local PushButton = require("graphics.elements.controls.push_button")
|
||||
|
||||
local DataIndicator = require("graphics.elements.indicators.data")
|
||||
local StateIndicator = require("graphics.elements.indicators.state")
|
||||
local IconIndicator = require("graphics.elements.indicators.icon")
|
||||
local VerticalBar = require("graphics.elements.indicators.vbar")
|
||||
|
||||
local PushButton = require("graphics.elements.controls.push_button")
|
||||
|
||||
local ALIGN = core.ALIGN
|
||||
local cpair = core.cpair
|
||||
|
||||
|
@ -10,13 +10,13 @@ local core = require("graphics.core")
|
||||
local Div = require("graphics.elements.div")
|
||||
local TextBox = require("graphics.elements.textbox")
|
||||
|
||||
local PushButton = require("graphics.elements.controls.push_button")
|
||||
|
||||
local DataIndicator = require("graphics.elements.indicators.data")
|
||||
local StateIndicator = require("graphics.elements.indicators.state")
|
||||
local IconIndicator = require("graphics.elements.indicators.icon")
|
||||
local VerticalBar = require("graphics.elements.indicators.vbar")
|
||||
|
||||
local PushButton = require("graphics.elements.controls.push_button")
|
||||
|
||||
local ALIGN = core.ALIGN
|
||||
local cpair = core.cpair
|
||||
|
||||
|
@ -9,14 +9,14 @@ local core = require("graphics.core")
|
||||
local Div = require("graphics.elements.div")
|
||||
local TextBox = require("graphics.elements.textbox")
|
||||
|
||||
local PushButton = require("graphics.elements.controls.push_button")
|
||||
|
||||
local DataIndicator = require("graphics.elements.indicators.data")
|
||||
local IconIndicator = require("graphics.elements.indicators.icon")
|
||||
local PowerIndicator = require("graphics.elements.indicators.power")
|
||||
local StateIndicator = require("graphics.elements.indicators.state")
|
||||
local VerticalBar = require("graphics.elements.indicators.vbar")
|
||||
|
||||
local PushButton = require("graphics.elements.controls.push_button")
|
||||
|
||||
local ALIGN = core.ALIGN
|
||||
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_trp.register(ps, "TurbineTrip", t_trp.update)
|
||||
|
||||
|
||||
local tbn_ext_div = Div{parent=tbn_pane,x=2,width=tbn_pane.get_width()-2}
|
||||
table.insert(panes, tbn_ext_div)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user