#184 supervisor graphics updates for new system, added PLC and CRD pages on supervisor front panel

This commit is contained in:
Mikayla Fischler
2023-05-23 19:22:22 -04:00
parent 4aba79f232
commit ece7c0fe9a
9 changed files with 190 additions and 39 deletions

View File

@ -52,6 +52,8 @@ local function data(args)
clear_width = args.width - (label_len + 1)
end
local value_color = e.fg_bg.fgd
-- on state change
---@param value any new value
function e.on_update(value)
@ -64,7 +66,7 @@ local function data(args)
-- write data
local data_str = util.sprintf(args.format, value)
e.window.setCursorPos(data_start, 1)
e.window.setTextColor(e.fg_bg.fgd)
e.window.setTextColor(value_color)
if args.commas then
e.window.write(util.comma_format(data_str))
else
@ -84,6 +86,13 @@ local function data(args)
---@param val any new value
function e.set_value(val) e.on_update(val) end
-- change the foreground color of the value, or all text if no label/unit colors provided
---@param c color
function e.recolor(c)
value_color = c
e.on_update(e.value)
end
-- initial value draw
e.on_update(args.value)