mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
bugfix to trilight, change to test code in unit view
This commit is contained in:
parent
3621f53c45
commit
c5ba95449f
@ -16,7 +16,7 @@ local config = require("coordinator.config")
|
|||||||
local coordinator = require("coordinator.coordinator")
|
local coordinator = require("coordinator.coordinator")
|
||||||
local renderer = require("coordinator.renderer")
|
local renderer = require("coordinator.renderer")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "alpha-v0.4.7"
|
local COORDINATOR_VERSION = "alpha-v0.4.8"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
@ -291,7 +291,7 @@ local function init(monitor, id)
|
|||||||
---@fixme test code
|
---@fixme test code
|
||||||
local rps = true
|
local rps = true
|
||||||
local function _test_toggle()
|
local function _test_toggle()
|
||||||
rps_nof.update(rps)
|
rps_trp.update(rps)
|
||||||
rps = not rps
|
rps = not rps
|
||||||
tcallbackdsp.dispatch(0.25, _test_toggle)
|
tcallbackdsp.dispatch(0.25, _test_toggle)
|
||||||
end
|
end
|
||||||
|
@ -19,9 +19,9 @@ local element = require("graphics.element")
|
|||||||
---@return graphics_element element, element_id id
|
---@return graphics_element element, element_id id
|
||||||
local function tristate_indicator_light(args)
|
local function tristate_indicator_light(args)
|
||||||
assert(type(args.label) == "string", "graphics.elements.indicators.trilight: label is a required field")
|
assert(type(args.label) == "string", "graphics.elements.indicators.trilight: label is a required field")
|
||||||
assert(type(args.c1) == "integer", "graphics.elements.indicators.trilight: c1 is a required field")
|
assert(type(args.c1) == "number", "graphics.elements.indicators.trilight: c1 is a required field")
|
||||||
assert(type(args.c2) == "integer", "graphics.elements.indicators.trilight: c2 is a required field")
|
assert(type(args.c2) == "number", "graphics.elements.indicators.trilight: c2 is a required field")
|
||||||
assert(type(args.c3) == "integer", "graphics.elements.indicators.trilight: c3 is a required field")
|
assert(type(args.c3) == "number", "graphics.elements.indicators.trilight: c3 is a required field")
|
||||||
|
|
||||||
-- single line
|
-- single line
|
||||||
args.height = 1
|
args.height = 1
|
||||||
@ -30,9 +30,9 @@ local function tristate_indicator_light(args)
|
|||||||
args.width = math.max(args.min_label_width or 1, string.len(args.label)) + 2
|
args.width = math.max(args.min_label_width or 1, string.len(args.label)) + 2
|
||||||
|
|
||||||
-- blit translations
|
-- blit translations
|
||||||
local c1 colors.toBlit(args.c1)
|
local c1 = colors.toBlit(args.c1)
|
||||||
local c2 colors.toBlit(args.c2)
|
local c2 = colors.toBlit(args.c2)
|
||||||
local c3 colors.toBlit(args.c3)
|
local c3 = colors.toBlit(args.c3)
|
||||||
|
|
||||||
-- create new graphics element base object
|
-- create new graphics element base object
|
||||||
local e = element.new(args)
|
local e = element.new(args)
|
||||||
|
Loading…
Reference in New Issue
Block a user