#629 code cleanup
This commit is contained in:
parent
55685fb6a6
commit
afc89ac727
@ -17,7 +17,6 @@ local ENERGY_UNITS = types.ENERGY_SCALE_UNITS
|
|||||||
local TEMP_SCALE = types.TEMP_SCALE
|
local TEMP_SCALE = types.TEMP_SCALE
|
||||||
local TEMP_UNITS = types.TEMP_SCALE_UNITS
|
local TEMP_UNITS = types.TEMP_SCALE_UNITS
|
||||||
|
|
||||||
---@todo nominal trip time is ping (0ms to 10ms usually)
|
|
||||||
local WARN_TT = 40
|
local WARN_TT = 40
|
||||||
local HIGH_TT = 80
|
local HIGH_TT = 80
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,6 @@ local function _record_multiblock_status(faulted, data, ps)
|
|||||||
ps.publish("formed", data.formed)
|
ps.publish("formed", data.formed)
|
||||||
ps.publish("faulted", faulted)
|
ps.publish("faulted", faulted)
|
||||||
|
|
||||||
---@todo revisit this
|
|
||||||
if data.build then
|
if data.build then
|
||||||
for key, val in pairs(data.build) do ps.publish(key, val) end
|
for key, val in pairs(data.build) do ps.publish(key, val) end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -88,7 +88,7 @@ local APP_ID = {
|
|||||||
-- core UI
|
-- core UI
|
||||||
ROOT = 1,
|
ROOT = 1,
|
||||||
LOADER = 2,
|
LOADER = 2,
|
||||||
-- main app pages
|
-- main apps
|
||||||
UNITS = 3,
|
UNITS = 3,
|
||||||
FACILITY = 4,
|
FACILITY = 4,
|
||||||
CONTROL = 5,
|
CONTROL = 5,
|
||||||
@ -97,12 +97,11 @@ local APP_ID = {
|
|||||||
GUIDE = 8,
|
GUIDE = 8,
|
||||||
ABOUT = 9,
|
ABOUT = 9,
|
||||||
RADMON = 10,
|
RADMON = 10,
|
||||||
-- diagnostic app pages
|
-- diagnostic apps
|
||||||
ALARMS = 11,
|
ALARMS = 11,
|
||||||
COMPS = 12,
|
COMPS = 12,
|
||||||
-- other
|
-- count
|
||||||
DUMMY = 13,
|
NUM_APPS = 12
|
||||||
NUM_APPS = 13
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pocket.APP_ID = APP_ID
|
pocket.APP_ID = APP_ID
|
||||||
|
|||||||
@ -32,7 +32,6 @@ local border = core.border
|
|||||||
local APP_ID = pocket.APP_ID
|
local APP_ID = pocket.APP_ID
|
||||||
|
|
||||||
local lu_col = style.label_unit_pair
|
local lu_col = style.label_unit_pair
|
||||||
|
|
||||||
local box_label = cpair(colors.lightGray, colors.gray)
|
local box_label = cpair(colors.lightGray, colors.gray)
|
||||||
|
|
||||||
-- new computer list page view
|
-- new computer list page view
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
--
|
|
||||||
-- Placeholder App
|
|
||||||
--
|
|
||||||
|
|
||||||
local iocontrol = require("pocket.iocontrol")
|
|
||||||
local pocket = require("pocket.pocket")
|
|
||||||
|
|
||||||
local core = require("graphics.core")
|
|
||||||
|
|
||||||
local Div = require("graphics.elements.Div")
|
|
||||||
local TextBox = require("graphics.elements.TextBox")
|
|
||||||
|
|
||||||
local APP_ID = pocket.APP_ID
|
|
||||||
|
|
||||||
-- create placeholder app page
|
|
||||||
---@param root Container parent
|
|
||||||
local function create_pages(root)
|
|
||||||
local db = iocontrol.get_db()
|
|
||||||
|
|
||||||
local main = Div{parent=root,x=1,y=1}
|
|
||||||
|
|
||||||
db.nav.register_app(APP_ID.DUMMY, main).new_page(nil, function () end)
|
|
||||||
|
|
||||||
TextBox{parent=main,text="This app is not implemented yet.",x=1,y=2,alignment=core.ALIGN.CENTER}
|
|
||||||
|
|
||||||
TextBox{parent=main,text=" pretend something cool is here \x03",x=1,y=10,alignment=core.ALIGN.CENTER,fg_bg=core.cpair(colors.gray,colors.black)}
|
|
||||||
end
|
|
||||||
|
|
||||||
return create_pages
|
|
||||||
@ -9,7 +9,6 @@ local iocontrol = require("pocket.iocontrol")
|
|||||||
local pocket = require("pocket.pocket")
|
local pocket = require("pocket.pocket")
|
||||||
|
|
||||||
local docs = require("pocket.ui.docs")
|
local docs = require("pocket.ui.docs")
|
||||||
-- local style = require("pocket.ui.style")
|
|
||||||
|
|
||||||
local guide_section = require("pocket.ui.pages.guide_section")
|
local guide_section = require("pocket.ui.pages.guide_section")
|
||||||
|
|
||||||
@ -31,10 +30,6 @@ local cpair = core.cpair
|
|||||||
|
|
||||||
local APP_ID = pocket.APP_ID
|
local APP_ID = pocket.APP_ID
|
||||||
|
|
||||||
-- local label = style.label
|
|
||||||
-- local lu_col = style.label_unit_pair
|
|
||||||
-- local text_fg = style.text_fg
|
|
||||||
|
|
||||||
-- new system guide view
|
-- new system guide view
|
||||||
---@param root Container parent
|
---@param root Container parent
|
||||||
local function new_view(root)
|
local function new_view(root)
|
||||||
|
|||||||
@ -312,8 +312,6 @@ local function new_view(root)
|
|||||||
c_emg.register(u_ps, "EmergencyCoolant", c_emg.update)
|
c_emg.register(u_ps, "EmergencyCoolant", c_emg.update)
|
||||||
c_mwrf.register(u_ps, "MaxWaterReturnFeed", c_mwrf.update)
|
c_mwrf.register(u_ps, "MaxWaterReturnFeed", c_mwrf.update)
|
||||||
|
|
||||||
-- rcs_div.line_break()
|
|
||||||
-- TextBox{parent=rcs_div,text="Mismatches",alignment=ALIGN.CENTER,fg_bg=label}
|
|
||||||
local c_cfm = IconIndicator{parent=rcs_div,label="Coolant Feed",states=yel_ind_s}
|
local c_cfm = IconIndicator{parent=rcs_div,label="Coolant Feed",states=yel_ind_s}
|
||||||
local c_brm = IconIndicator{parent=rcs_div,label="Boil Rate",states=yel_ind_s}
|
local c_brm = IconIndicator{parent=rcs_div,label="Boil Rate",states=yel_ind_s}
|
||||||
local c_sfm = IconIndicator{parent=rcs_div,label="Steam Feed",states=yel_ind_s}
|
local c_sfm = IconIndicator{parent=rcs_div,label="Steam Feed",states=yel_ind_s}
|
||||||
@ -323,7 +321,6 @@ local function new_view(root)
|
|||||||
c_sfm.register(u_ps, "SteamFeedMismatch", c_sfm.update)
|
c_sfm.register(u_ps, "SteamFeedMismatch", c_sfm.update)
|
||||||
|
|
||||||
rcs_div.line_break()
|
rcs_div.line_break()
|
||||||
-- TextBox{parent=rcs_div,text="Aggregate Checks",alignment=ALIGN.CENTER,fg_bg=label}
|
|
||||||
|
|
||||||
if unit.num_boilers > 0 then
|
if unit.num_boilers > 0 then
|
||||||
local wll = IconIndicator{parent=rcs_div,label="Boiler Water Lo",states=red_ind_s}
|
local wll = IconIndicator{parent=rcs_div,label="Boiler Water Lo",states=red_ind_s}
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- All the text documentation used in the Guide app is defined in this file.
|
||||||
|
--
|
||||||
|
|
||||||
local const = require("scada-common.constants")
|
local const = require("scada-common.constants")
|
||||||
|
|
||||||
local docs = {}
|
local docs = {}
|
||||||
|
|||||||
@ -10,7 +10,6 @@ local pocket = require("pocket.pocket")
|
|||||||
local comps_app = require("pocket.ui.apps.comps")
|
local comps_app = require("pocket.ui.apps.comps")
|
||||||
local control_app = require("pocket.ui.apps.control")
|
local control_app = require("pocket.ui.apps.control")
|
||||||
local diag_apps = require("pocket.ui.apps.diag_apps")
|
local diag_apps = require("pocket.ui.apps.diag_apps")
|
||||||
local dummy_app = require("pocket.ui.apps.dummy_app")
|
|
||||||
local facil_app = require("pocket.ui.apps.facility")
|
local facil_app = require("pocket.ui.apps.facility")
|
||||||
local guide_app = require("pocket.ui.apps.guide")
|
local guide_app = require("pocket.ui.apps.guide")
|
||||||
local loader_app = require("pocket.ui.apps.loader")
|
local loader_app = require("pocket.ui.apps.loader")
|
||||||
@ -78,7 +77,6 @@ local function init(main)
|
|||||||
sys_apps(page_div)
|
sys_apps(page_div)
|
||||||
diag_apps(page_div)
|
diag_apps(page_div)
|
||||||
comps_app(page_div)
|
comps_app(page_div)
|
||||||
dummy_app(page_div)
|
|
||||||
|
|
||||||
-- verify all apps were created
|
-- verify all apps were created
|
||||||
assert(util.table_len(db.nav.get_containers()) == APP_ID.NUM_APPS, "app IDs were not sequential or some apps weren't registered")
|
assert(util.table_len(db.nav.get_containers()) == APP_ID.NUM_APPS, "app IDs were not sequential or some apps weren't registered")
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- Dynamic Tank View
|
||||||
|
--
|
||||||
|
|
||||||
local types = require("scada-common.types")
|
local types = require("scada-common.types")
|
||||||
local util = require("scada-common.util")
|
local util = require("scada-common.util")
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- Induction Matrix View
|
||||||
|
--
|
||||||
|
|
||||||
local iocontrol = require("pocket.iocontrol")
|
local iocontrol = require("pocket.iocontrol")
|
||||||
|
|
||||||
local style = require("pocket.ui.style")
|
local style = require("pocket.ui.style")
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- SPS View
|
||||||
|
--
|
||||||
|
|
||||||
local iocontrol = require("pocket.iocontrol")
|
local iocontrol = require("pocket.iocontrol")
|
||||||
|
|
||||||
local style = require("pocket.ui.style")
|
local style = require("pocket.ui.style")
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- A Guide App Subsection
|
||||||
|
--
|
||||||
|
|
||||||
local log = require("scada-common.log")
|
local log = require("scada-common.log")
|
||||||
local util = require("scada-common.util")
|
local util = require("scada-common.util")
|
||||||
|
|
||||||
|
|||||||
@ -9,11 +9,9 @@ local core = require("graphics.core")
|
|||||||
|
|
||||||
local AppMultiPane = require("graphics.elements.AppMultiPane")
|
local AppMultiPane = require("graphics.elements.AppMultiPane")
|
||||||
local Div = require("graphics.elements.Div")
|
local Div = require("graphics.elements.Div")
|
||||||
local TextBox = require("graphics.elements.TextBox")
|
|
||||||
|
|
||||||
local App = require("graphics.elements.controls.App")
|
local App = require("graphics.elements.controls.App")
|
||||||
|
|
||||||
local ALIGN = core.ALIGN
|
|
||||||
local cpair = core.cpair
|
local cpair = core.cpair
|
||||||
|
|
||||||
local APP_ID = pocket.APP_ID
|
local APP_ID = pocket.APP_ID
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- Unit Boiler View
|
||||||
|
--
|
||||||
|
|
||||||
local types = require("scada-common.types")
|
local types = require("scada-common.types")
|
||||||
local util = require("scada-common.util")
|
local util = require("scada-common.util")
|
||||||
|
|
||||||
@ -13,8 +17,8 @@ local TextBox = require("graphics.elements.TextBox")
|
|||||||
local PushButton = require("graphics.elements.controls.PushButton")
|
local PushButton = require("graphics.elements.controls.PushButton")
|
||||||
|
|
||||||
local DataIndicator = require("graphics.elements.indicators.DataIndicator")
|
local DataIndicator = require("graphics.elements.indicators.DataIndicator")
|
||||||
local StateIndicator = require("graphics.elements.indicators.StateIndicator")
|
|
||||||
local IconIndicator = require("graphics.elements.indicators.IconIndicator")
|
local IconIndicator = require("graphics.elements.indicators.IconIndicator")
|
||||||
|
local StateIndicator = require("graphics.elements.indicators.StateIndicator")
|
||||||
local VerticalBar = require("graphics.elements.indicators.VerticalBar")
|
local VerticalBar = require("graphics.elements.indicators.VerticalBar")
|
||||||
|
|
||||||
local ALIGN = core.ALIGN
|
local ALIGN = core.ALIGN
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- Unit Reactor View
|
||||||
|
--
|
||||||
|
|
||||||
local types = require("scada-common.types")
|
local types = require("scada-common.types")
|
||||||
local util = require("scada-common.util")
|
local util = require("scada-common.util")
|
||||||
|
|
||||||
@ -13,8 +17,8 @@ local TextBox = require("graphics.elements.TextBox")
|
|||||||
local PushButton = require("graphics.elements.controls.PushButton")
|
local PushButton = require("graphics.elements.controls.PushButton")
|
||||||
|
|
||||||
local DataIndicator = require("graphics.elements.indicators.DataIndicator")
|
local DataIndicator = require("graphics.elements.indicators.DataIndicator")
|
||||||
local StateIndicator = require("graphics.elements.indicators.StateIndicator")
|
|
||||||
local IconIndicator = require("graphics.elements.indicators.IconIndicator")
|
local IconIndicator = require("graphics.elements.indicators.IconIndicator")
|
||||||
|
local StateIndicator = require("graphics.elements.indicators.StateIndicator")
|
||||||
local VerticalBar = require("graphics.elements.indicators.VerticalBar")
|
local VerticalBar = require("graphics.elements.indicators.VerticalBar")
|
||||||
|
|
||||||
local ALIGN = core.ALIGN
|
local ALIGN = core.ALIGN
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- Unit Turbine View
|
||||||
|
--
|
||||||
|
|
||||||
local util = require("scada-common.util")
|
local util = require("scada-common.util")
|
||||||
|
|
||||||
local iocontrol = require("pocket.iocontrol")
|
local iocontrol = require("pocket.iocontrol")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user