mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#153 facility alarm acknowledge button
This commit is contained in:
parent
678dafa62f
commit
07ee792163
@ -444,6 +444,8 @@ function coordinator.comms(version, modem, sv_port, sv_listen, api_listen, range
|
|||||||
else
|
else
|
||||||
log.debug("SCADA_CRDN process start (with configuration) ack echo packet length mismatch")
|
log.debug("SCADA_CRDN process start (with configuration) ack echo packet length mismatch")
|
||||||
end
|
end
|
||||||
|
elseif cmd == FAC_COMMANDS.ACK_ALL_ALARMS then
|
||||||
|
iocontrol.get_db().facility.ack_alarms_ack(ack)
|
||||||
else
|
else
|
||||||
log.debug(util.c("received facility command ack with unknown command ", cmd))
|
log.debug(util.c("received facility command ack with unknown command ", cmd))
|
||||||
end
|
end
|
||||||
|
@ -37,6 +37,7 @@ function iocontrol.init(conf, comms)
|
|||||||
start_ack = function (success) end, ---@param success boolean
|
start_ack = function (success) end, ---@param success boolean
|
||||||
stop_ack = function (success) end, ---@param success boolean
|
stop_ack = function (success) end, ---@param success boolean
|
||||||
scram_ack = function (success) end, ---@param success boolean
|
scram_ack = function (success) end, ---@param success boolean
|
||||||
|
ack_alarms_ack = function (success) end, ---@param success boolean
|
||||||
|
|
||||||
ps = psil.create(),
|
ps = psil.create(),
|
||||||
|
|
||||||
|
@ -17,11 +17,11 @@ local self = {
|
|||||||
comms = nil, ---@type coord_comms
|
comms = nil, ---@type coord_comms
|
||||||
---@class coord_auto_config
|
---@class coord_auto_config
|
||||||
config = {
|
config = {
|
||||||
mode = 0, ---@type PROCESS
|
mode = PROCESS.INACTIVE,
|
||||||
burn_target = 0.0,
|
burn_target = 0.0,
|
||||||
charge_target = 0.0,
|
charge_target = 0.0,
|
||||||
gen_target = 0.0,
|
gen_target = 0.0,
|
||||||
limits = {} ---@type table
|
limits = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,6 +88,18 @@ function process.init(iocontrol, comms)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- facility SCRAM command
|
||||||
|
function process.fac_scram()
|
||||||
|
self.comms.send_fac_command(FAC_COMMANDS.SCRAM_ALL)
|
||||||
|
log.debug("FAC: SCRAM ALL")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- facility alarm acknowledge command
|
||||||
|
function process.fac_ack_alarms()
|
||||||
|
self.comms.send_fac_command(FAC_COMMANDS.ACK_ALL_ALARMS)
|
||||||
|
log.debug("FAC: ACK ALL ALARMS")
|
||||||
|
end
|
||||||
|
|
||||||
-- start reactor
|
-- start reactor
|
||||||
---@param id integer unit ID
|
---@param id integer unit ID
|
||||||
function process.start(id)
|
function process.start(id)
|
||||||
@ -193,12 +205,6 @@ end
|
|||||||
-- AUTO PROCESS CONTROL --
|
-- AUTO PROCESS CONTROL --
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
-- facility SCRAM command
|
|
||||||
function process.fac_scram()
|
|
||||||
self.comms.send_fac_command(FAC_COMMANDS.SCRAM_ALL)
|
|
||||||
log.debug("FAC: SCRAM ALL")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- stop automatic process control
|
-- stop automatic process control
|
||||||
function process.stop_auto()
|
function process.stop_auto()
|
||||||
self.comms.send_fac_command(FAC_COMMANDS.STOP)
|
self.comms.send_fac_command(FAC_COMMANDS.STOP)
|
||||||
|
@ -19,7 +19,7 @@ local iocontrol = require("coordinator.iocontrol")
|
|||||||
local renderer = require("coordinator.renderer")
|
local renderer = require("coordinator.renderer")
|
||||||
local sounder = require("coordinator.sounder")
|
local sounder = require("coordinator.sounder")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "beta-v0.9.2"
|
local COORDINATOR_VERSION = "beta-v0.9.3"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
@ -47,8 +47,10 @@ local function new_view(root, x, y)
|
|||||||
local main = Div{parent=root,width=104,height=24,x=x,y=y}
|
local main = Div{parent=root,width=104,height=24,x=x,y=y}
|
||||||
|
|
||||||
local scram = HazardButton{parent=main,x=1,y=1,text="FAC SCRAM",accent=colors.yellow,dis_colors=dis_colors,callback=process.fac_scram,fg_bg=hzd_fg_bg}
|
local scram = HazardButton{parent=main,x=1,y=1,text="FAC SCRAM",accent=colors.yellow,dis_colors=dis_colors,callback=process.fac_scram,fg_bg=hzd_fg_bg}
|
||||||
|
local ack_a = HazardButton{parent=main,x=16,y=1,text="ACK \x13",accent=colors.orange,dis_colors=dis_colors,callback=process.fac_ack_alarms,fg_bg=hzd_fg_bg}
|
||||||
|
|
||||||
facility.scram_ack = scram.on_response
|
facility.scram_ack = scram.on_response
|
||||||
|
facility.ack_alarms_ack = ack_a.on_response
|
||||||
|
|
||||||
local all_ok = IndicatorLight{parent=main,y=5,label="Unit Systems Online",colors=cpair(colors.green,colors.red)}
|
local all_ok = IndicatorLight{parent=main,y=5,label="Unit Systems Online",colors=cpair(colors.green,colors.red)}
|
||||||
local ind_mat = IndicatorLight{parent=main,label="Induction Matrix",colors=cpair(colors.green,colors.gray)}
|
local ind_mat = IndicatorLight{parent=main,label="Induction Matrix",colors=cpair(colors.green,colors.gray)}
|
||||||
@ -208,7 +210,7 @@ local function new_view(root, x, y)
|
|||||||
|
|
||||||
local save = HazardButton{parent=auto_controls,x=2,y=2,text="SAVE",accent=colors.purple,dis_colors=dis_colors,callback=_save_cfg,fg_bg=hzd_fg_bg}
|
local save = HazardButton{parent=auto_controls,x=2,y=2,text="SAVE",accent=colors.purple,dis_colors=dis_colors,callback=_save_cfg,fg_bg=hzd_fg_bg}
|
||||||
local start = HazardButton{parent=auto_controls,x=13,y=2,text="START",accent=colors.lightBlue,dis_colors=dis_colors,callback=_start_auto,fg_bg=hzd_fg_bg}
|
local start = HazardButton{parent=auto_controls,x=13,y=2,text="START",accent=colors.lightBlue,dis_colors=dis_colors,callback=_start_auto,fg_bg=hzd_fg_bg}
|
||||||
local stop = HazardButton{parent=auto_controls,x=23,y=2,text="STOP",accent=colors.orange,dis_colors=dis_colors,callback=process.stop_auto,fg_bg=hzd_fg_bg}
|
local stop = HazardButton{parent=auto_controls,x=23,y=2,text="STOP",accent=colors.red,dis_colors=dis_colors,callback=process.stop_auto,fg_bg=hzd_fg_bg}
|
||||||
|
|
||||||
facility.start_ack = start.on_response
|
facility.start_ack = start.on_response
|
||||||
facility.stop_ack = stop.on_response
|
facility.stop_ack = stop.on_response
|
||||||
|
@ -14,7 +14,7 @@ local config = require("reactor-plc.config")
|
|||||||
local plc = require("reactor-plc.plc")
|
local plc = require("reactor-plc.plc")
|
||||||
local threads = require("reactor-plc.threads")
|
local threads = require("reactor-plc.threads")
|
||||||
|
|
||||||
local R_PLC_VERSION = "beta-v0.10.6"
|
local R_PLC_VERSION = "beta-v0.10.7"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
@ -25,7 +25,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
|
|||||||
local sps_rtu = require("rtu.dev.sps_rtu")
|
local sps_rtu = require("rtu.dev.sps_rtu")
|
||||||
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
||||||
|
|
||||||
local RTU_VERSION = "beta-v0.10.0"
|
local RTU_VERSION = "beta-v0.10.1"
|
||||||
|
|
||||||
local rtu_t = types.rtu_t
|
local rtu_t = types.rtu_t
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ local insert = table.insert
|
|||||||
|
|
||||||
local max_distance = nil
|
local max_distance = nil
|
||||||
|
|
||||||
comms.version = "1.3.0"
|
comms.version = "1.3.1"
|
||||||
|
|
||||||
---@alias PROTOCOLS integer
|
---@alias PROTOCOLS integer
|
||||||
local PROTOCOLS = {
|
local PROTOCOLS = {
|
||||||
@ -103,7 +103,8 @@ local PLC_AUTO_ACK = {
|
|||||||
local FAC_COMMANDS = {
|
local FAC_COMMANDS = {
|
||||||
SCRAM_ALL = 0, -- SCRAM all reactors
|
SCRAM_ALL = 0, -- SCRAM all reactors
|
||||||
STOP = 1, -- stop automatic control
|
STOP = 1, -- stop automatic control
|
||||||
START = 2 -- start automatic control
|
START = 2, -- start automatic control
|
||||||
|
ACK_ALL_ALARMS = 3 -- acknowledge all alarms on all units
|
||||||
}
|
}
|
||||||
|
|
||||||
---@alias UNIT_COMMANDS integer
|
---@alias UNIT_COMMANDS integer
|
||||||
|
@ -233,6 +233,9 @@ function coordinator.new_session(id, in_queue, out_queue, facility)
|
|||||||
else
|
else
|
||||||
log.debug(log_header .. "CRDN auto start (with configuration) packet length mismatch")
|
log.debug(log_header .. "CRDN auto start (with configuration) packet length mismatch")
|
||||||
end
|
end
|
||||||
|
elseif cmd == FAC_COMMANDS.ACK_ALL_ALARMS then
|
||||||
|
facility.ack_all()
|
||||||
|
_send(SCADA_CRDN_TYPES.FAC_CMD, { cmd, true })
|
||||||
else
|
else
|
||||||
log.debug(log_header .. "CRDN facility command unknown")
|
log.debug(log_header .. "CRDN facility command unknown")
|
||||||
end
|
end
|
||||||
|
@ -556,6 +556,14 @@ function facility.new(num_reactors, cooling_conf)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- ack all alarms on all reactor units
|
||||||
|
function public.ack_all()
|
||||||
|
for i = 1, #self.units do
|
||||||
|
local u = self.units[i] ---@type reactor_unit
|
||||||
|
u.ack_all()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- stop auto control
|
-- stop auto control
|
||||||
function public.auto_stop()
|
function public.auto_stop()
|
||||||
self.mode = PROCESS.INACTIVE
|
self.mode = PROCESS.INACTIVE
|
||||||
|
@ -14,7 +14,7 @@ local svsessions = require("supervisor.session.svsessions")
|
|||||||
local config = require("supervisor.config")
|
local config = require("supervisor.config")
|
||||||
local supervisor = require("supervisor.supervisor")
|
local supervisor = require("supervisor.supervisor")
|
||||||
|
|
||||||
local SUPERVISOR_VERSION = "beta-v0.10.1"
|
local SUPERVISOR_VERSION = "beta-v0.10.2"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
Loading…
x
Reference in New Issue
Block a user