#367 RTU fail enum and logging messages

This commit is contained in:
Mikayla
2024-08-22 16:42:57 +00:00
parent a1b6ff4bcc
commit a087eda0ee
6 changed files with 72 additions and 36 deletions

View File

@@ -2,6 +2,8 @@
-- RTU ID Check Failure Entry
--
local types = require("scada-common.types")
local style = require("supervisor.panel.style")
local core = require("graphics.core")
@@ -25,10 +27,10 @@ local function init(parent, msg, fail_code)
local fg_bg = cpair(colors.black,colors.yellow)
local tag = "MISSING"
if fail_code == 1 then
if fail_code == types.RTU_ID_FAIL.OUT_OF_RANGE then
fg_bg = cpair(colors.black,colors.orange)
tag = "BAD INDEX"
elseif fail_code == 2 then
elseif fail_code == types.RTU_ID_FAIL.DUPLICATE then
fg_bg = cpair(colors.black,colors.red)
tag = "DUPLICATE"
end