#186 improved sv config validation, changed waste high thresholds, fixed monitored max burn not showing as active, fixed redstone R_ENABLE and U_ALARM, changed RPS high waste trip to 95%
This commit is contained in:
@@ -14,7 +14,7 @@ local svsessions = require("supervisor.session.svsessions")
|
||||
local config = require("supervisor.config")
|
||||
local supervisor = require("supervisor.supervisor")
|
||||
|
||||
local SUPERVISOR_VERSION = "v0.13.4"
|
||||
local SUPERVISOR_VERSION = "v0.13.5"
|
||||
|
||||
local print = util.print
|
||||
local println = util.println
|
||||
@@ -43,15 +43,18 @@ cfv.assert_type_int(config.LOG_MODE)
|
||||
|
||||
assert(cfv.valid(), "bad config file: missing/invalid fields")
|
||||
|
||||
cfv.assert_eq(#config.REACTOR_COOLING, config.NUM_REACTORS)
|
||||
assert(cfv.valid(), "config: number of cooling configs different than number of units")
|
||||
|
||||
for i = 1, config.NUM_REACTORS do
|
||||
cfv.assert_type_table(config.REACTOR_COOLING[i])
|
||||
assert(cfv.valid(), "missing cooling entry for reactor " .. i)
|
||||
assert(cfv.valid(), "config: missing cooling entry for reactor " .. i)
|
||||
cfv.assert_type_int(config.REACTOR_COOLING[i].BOILERS)
|
||||
cfv.assert_type_int(config.REACTOR_COOLING[i].TURBINES)
|
||||
assert(cfv.valid(), "missing boilers/turbines for reactor " .. i)
|
||||
assert(cfv.valid(), "config: missing boilers/turbines for reactor " .. i)
|
||||
cfv.assert_min(config.REACTOR_COOLING[i].BOILERS, 0)
|
||||
cfv.assert_min(config.REACTOR_COOLING[i].TURBINES, 1)
|
||||
assert(cfv.valid(), "bad number of boilers/turbines for reactor " .. i)
|
||||
assert(cfv.valid(), "config: bad number of boilers/turbines for reactor " .. i)
|
||||
end
|
||||
|
||||
----------------------------------------
|
||||
|
||||
@@ -706,7 +706,7 @@ function logic.handle_redstone(self)
|
||||
end
|
||||
|
||||
if (not self.auto_engaged) and (not self.plc_cache.active) and
|
||||
(not self.plc_cache.rps_trip) and self.io_ctl.digital_read(IO.R_ACTIVE) then
|
||||
(not self.plc_cache.rps_trip) and self.io_ctl.digital_read(IO.R_ENABLE) then
|
||||
-- reactor enable requested and allowable, but not yet done; perform it
|
||||
self.plc_s.in_queue.push_command(PLC_S_CMDS.ENABLE)
|
||||
end
|
||||
@@ -739,7 +739,7 @@ function logic.handle_redstone(self)
|
||||
|
||||
local has_alarm = false
|
||||
for i = 1, #self.db.alarm_states do
|
||||
if self.db.alarm_states[i] == ALARM_STATE.TRIPPED then
|
||||
if self.db.alarm_states[i] == ALARM_STATE.TRIPPED or self.db.alarm_states[i] == ALARM_STATE.ACKED then
|
||||
has_alarm = true
|
||||
break
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user