mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
luacheck fixes
This commit is contained in:
parent
1984b63837
commit
56e69e3a29
@ -113,6 +113,8 @@ function coordinator.load_config()
|
||||
mon_cfv.assert_eq(#config.UnitDisplays, config.UnitCount)
|
||||
|
||||
if mon_cfv.valid() then
|
||||
local w, h, _
|
||||
|
||||
mon_cfv.assert(util.table_contains(names, config.MainDisplay))
|
||||
|
||||
if not mon_cfv.valid() then return 2, "Main monitor is not connected." end
|
||||
@ -120,7 +122,7 @@ function coordinator.load_config()
|
||||
monitors.primary = ppm.get_periph(config.MainDisplay)
|
||||
monitors.primary_name = config.MainDisplay
|
||||
|
||||
local w, h = ppm.monitor_block_size(monitors.primary.getSize())
|
||||
w, _ = ppm.monitor_block_size(monitors.primary.getSize())
|
||||
mon_cfv.assert(w == 8)
|
||||
|
||||
if not mon_cfv.valid() then return 2, "Main monitor width is incorrect." end
|
||||
@ -133,7 +135,7 @@ function coordinator.load_config()
|
||||
monitors.flow = ppm.get_periph(config.FlowDisplay)
|
||||
monitors.flow_name = config.FlowDisplay
|
||||
|
||||
w, h = ppm.monitor_block_size(monitors.flow.getSize())
|
||||
w, _ = ppm.monitor_block_size(monitors.flow.getSize())
|
||||
mon_cfv.assert(w == 8)
|
||||
|
||||
if not mon_cfv.valid() then return 2, "Flow monitor width is incorrect." end
|
||||
|
@ -3,8 +3,6 @@
|
||||
--
|
||||
|
||||
local log = require("scada-common.log")
|
||||
local util = require("scada-common.util")
|
||||
local ppm = require("scada-common.ppm")
|
||||
|
||||
local iocontrol = require("coordinator.iocontrol")
|
||||
|
||||
|
@ -427,7 +427,7 @@ end
|
||||
---@nodiscard
|
||||
---@param w integer character width
|
||||
---@param h integer character width
|
||||
---@return integer block_width, integer block_height
|
||||
---@return integer block_width, integer block_height
|
||||
function ppm.monitor_block_size(w, h)
|
||||
local width = math.floor((w - 15) / 21) + 1
|
||||
local height = math.floor((h - 10) / 14) + 1
|
||||
|
Loading…
Reference in New Issue
Block a user