added AUTO_GROUP enum
This commit is contained in:
@@ -2,11 +2,10 @@
|
||||
-- I/O Control for Pocket Integration with Supervisor & Coordinator
|
||||
--
|
||||
|
||||
local const = require("scada-common.constants")
|
||||
-- local log = require("scada-common.log")
|
||||
local psil = require("scada-common.psil")
|
||||
local types = require("scada-common.types")
|
||||
local util = require("scada-common.util")
|
||||
local const = require("scada-common.constants")
|
||||
local psil = require("scada-common.psil")
|
||||
local types = require("scada-common.types")
|
||||
local util = require("scada-common.util")
|
||||
|
||||
local process = require("pocket.process")
|
||||
|
||||
@@ -22,8 +21,6 @@ local TEMP_UNITS = types.TEMP_SCALE_UNITS
|
||||
local WARN_TT = 40
|
||||
local HIGH_TT = 80
|
||||
|
||||
local GROUP_NAMES = { "Manual", "Primary", "Secondary", "Tertiary", "Backup" }
|
||||
|
||||
local iocontrol = {}
|
||||
|
||||
---@enum POCKET_LINK_STATE
|
||||
@@ -318,7 +315,7 @@ function iocontrol.init_fac(conf)
|
||||
turbine_flow_stable = false,
|
||||
|
||||
-- auto control group
|
||||
a_group = 0,
|
||||
a_group = types.AUTO_GROUP.MANUAL,
|
||||
|
||||
start = function () process.start(i) end,
|
||||
scram = function () process.scram(i) end,
|
||||
@@ -499,7 +496,7 @@ function iocontrol.record_unit_data(data)
|
||||
unit.alarms = data[5]
|
||||
|
||||
unit.unit_ps.publish("auto_group_id", unit.a_group)
|
||||
unit.unit_ps.publish("auto_group", GROUP_NAMES[unit.a_group + 1])
|
||||
unit.unit_ps.publish("auto_group", types.AUTO_GROUP_NAMES[unit.a_group + 1])
|
||||
|
||||
--#region Annunciator
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
-- Unit Control Page
|
||||
--
|
||||
|
||||
local types = require("scada-common.types")
|
||||
local util = require("scada-common.util")
|
||||
|
||||
local iocontrol = require("pocket.iocontrol")
|
||||
@@ -26,6 +27,8 @@ local NumberField = require("graphics.elements.form.number_field")
|
||||
local DataIndicator = require("graphics.elements.indicators.data")
|
||||
local IconIndicator = require("graphics.elements.indicators.icon")
|
||||
|
||||
local AUTO_GROUP = types.AUTO_GROUP
|
||||
|
||||
local ALIGN = core.ALIGN
|
||||
local cpair = core.cpair
|
||||
|
||||
@@ -146,10 +149,10 @@ local function new_view(root)
|
||||
|
||||
-- enable/disable controls based on group assignment (start button is separate)
|
||||
burn_cmd.register(u_ps, "auto_group_id", function (gid)
|
||||
if gid == 0 then burn_cmd.enable() else burn_cmd.disable() end
|
||||
if gid == AUTO_GROUP.MANUAL then burn_cmd.enable() else burn_cmd.disable() end
|
||||
end)
|
||||
set_burn_btn.register(u_ps, "auto_group_id", function (gid)
|
||||
if gid == 0 then set_burn_btn.enable() else set_burn_btn.disable() end
|
||||
if gid == AUTO_GROUP.MANUAL then set_burn_btn.enable() else set_burn_btn.disable() end
|
||||
end)
|
||||
|
||||
burn_cmd.register(u_ps, "burn_rate", burn_cmd.set_value)
|
||||
@@ -169,7 +172,7 @@ local function new_view(root)
|
||||
if (unit.reactor_data ~= nil) and (unit.reactor_data.mek_status ~= nil) then
|
||||
local can_start = (not unit.reactor_data.mek_status.status) and
|
||||
(not unit.reactor_data.rps_tripped) and
|
||||
(unit.a_group == 0)
|
||||
(unit.a_group == AUTO_GROUP.MANUAL)
|
||||
if can_start then start.enable() else start.disable() end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user