#181 independent emergency coolant valve control
This commit is contained in:
@@ -8,13 +8,14 @@ local crash = require("scada-common.crash")
|
||||
local log = require("scada-common.log")
|
||||
local mqueue = require("scada-common.mqueue")
|
||||
local ppm = require("scada-common.ppm")
|
||||
local rsio = require("scada-common.rsio")
|
||||
local util = require("scada-common.util")
|
||||
|
||||
local config = require("reactor-plc.config")
|
||||
local plc = require("reactor-plc.plc")
|
||||
local threads = require("reactor-plc.threads")
|
||||
|
||||
local R_PLC_VERSION = "v1.0.0"
|
||||
local R_PLC_VERSION = "v1.0.1"
|
||||
|
||||
local print = util.print
|
||||
local println = util.println
|
||||
@@ -39,6 +40,15 @@ cfv.assert_type_int(config.LOG_MODE)
|
||||
|
||||
assert(cfv.valid(), "bad config file: missing/invalid fields")
|
||||
|
||||
-- check emergency coolant configuration
|
||||
if type(config.EMERGENCY_COOL) == "table" then
|
||||
if not rsio.is_valid_side(config.EMERGENCY_COOL.side) then
|
||||
assert(false, "bad config file: emergency coolant side unrecognized")
|
||||
elseif config.EMERGENCY_COOL.color ~= nil and not rsio.is_color(config.EMERGENCY_COOL.color) then
|
||||
assert(false, "bad config file: emergency coolant invalid redstone channel color provided")
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------
|
||||
-- log init
|
||||
----------------------------------------
|
||||
@@ -155,7 +165,7 @@ local function main()
|
||||
end
|
||||
|
||||
-- init reactor protection system
|
||||
smem_sys.rps = plc.rps_init(smem_dev.reactor, plc_state.reactor_formed)
|
||||
smem_sys.rps = plc.rps_init(smem_dev.reactor, plc_state.reactor_formed, config.EMERGENCY_COOL)
|
||||
log.debug("init> rps init")
|
||||
|
||||
if __shared_memory.networked then
|
||||
@@ -172,6 +182,12 @@ local function main()
|
||||
log.info("init> running without networking")
|
||||
end
|
||||
|
||||
-- notify user of emergency coolant configuration status
|
||||
if config.EMERGENCY_COOL ~= nil then
|
||||
println("init> emergency coolant control ready")
|
||||
log.info("init> running with emergency coolant control available")
|
||||
end
|
||||
|
||||
util.push_event("clock_start")
|
||||
|
||||
println("init> completed")
|
||||
|
||||
Reference in New Issue
Block a user