mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#184 supervisor graphics updates for new system, added PLC and CRD pages on supervisor front panel
This commit is contained in:
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user