bugfix to trilight, change to test code in unit view

This commit is contained in:
Mikayla Fischler 2022-09-08 10:22:11 -04:00
parent 3621f53c45
commit c5ba95449f
3 changed files with 8 additions and 8 deletions

View File

@ -16,7 +16,7 @@ local config = require("coordinator.config")
local coordinator = require("coordinator.coordinator")
local renderer = require("coordinator.renderer")
local COORDINATOR_VERSION = "alpha-v0.4.7"
local COORDINATOR_VERSION = "alpha-v0.4.8"
local print = util.print
local println = util.println

View File

@ -291,7 +291,7 @@ local function init(monitor, id)
---@fixme test code
local rps = true
local function _test_toggle()
rps_nof.update(rps)
rps_trp.update(rps)
rps = not rps
tcallbackdsp.dispatch(0.25, _test_toggle)
end

View File

@ -19,9 +19,9 @@ local element = require("graphics.element")
---@return graphics_element element, element_id id
local function tristate_indicator_light(args)
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.c2) == "integer", "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.c1) == "number", "graphics.elements.indicators.trilight: c1 is a required field")
assert(type(args.c2) == "number", "graphics.elements.indicators.trilight: c2 is a required field")
assert(type(args.c3) == "number", "graphics.elements.indicators.trilight: c3 is a required field")
-- single line
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
-- blit translations
local c1 colors.toBlit(args.c1)
local c2 colors.toBlit(args.c2)
local c3 colors.toBlit(args.c3)
local c1 = colors.toBlit(args.c1)
local c2 = colors.toBlit(args.c2)
local c3 = colors.toBlit(args.c3)
-- create new graphics element base object
local e = element.new(args)