mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#188 refactored RPS dmg_crit to dmg_high
This commit is contained in:
parent
85a9532962
commit
c9f1bddb36
@ -19,7 +19,7 @@ local iocontrol = require("coordinator.iocontrol")
|
||||
local renderer = require("coordinator.renderer")
|
||||
local sounder = require("coordinator.sounder")
|
||||
|
||||
local COORDINATOR_VERSION = "v0.11.11"
|
||||
local COORDINATOR_VERSION = "v0.11.12"
|
||||
|
||||
local print = util.print
|
||||
local println = util.println
|
||||
|
@ -210,7 +210,7 @@ local function init(parent, id)
|
||||
local rps_annunc = Div{parent=rps,width=31,height=10,x=2,y=1}
|
||||
|
||||
local rps_trp = IndicatorLight{parent=rps_annunc,label="RPS Trip",colors=cpair(colors.red,colors.gray),flash=true,period=period.BLINK_250_MS}
|
||||
local rps_dmg = IndicatorLight{parent=rps_annunc,label="Damage Critical",colors=cpair(colors.red,colors.gray),flash=true,period=period.BLINK_250_MS}
|
||||
local rps_dmg = IndicatorLight{parent=rps_annunc,label="Damage High",colors=cpair(colors.red,colors.gray),flash=true,period=period.BLINK_250_MS}
|
||||
local rps_exh = IndicatorLight{parent=rps_annunc,label="Excess Heated Coolant",colors=cpair(colors.yellow,colors.gray)}
|
||||
local rps_exw = IndicatorLight{parent=rps_annunc,label="Excess Waste",colors=cpair(colors.yellow,colors.gray)}
|
||||
local rps_tmp = IndicatorLight{parent=rps_annunc,label="Core Temperature High",colors=cpair(colors.red,colors.gray),flash=true,period=period.BLINK_250_MS}
|
||||
@ -221,7 +221,7 @@ local function init(parent, id)
|
||||
local rps_sfl = IndicatorLight{parent=rps_annunc,label="System Failure",colors=cpair(colors.orange,colors.gray),flash=true,period=period.BLINK_500_MS}
|
||||
|
||||
u_ps.subscribe("rps_tripped", rps_trp.update)
|
||||
u_ps.subscribe("dmg_crit", rps_dmg.update)
|
||||
u_ps.subscribe("dmg_high", rps_dmg.update)
|
||||
u_ps.subscribe("ex_hcool", rps_exh.update)
|
||||
u_ps.subscribe("ex_waste", rps_exw.update)
|
||||
u_ps.subscribe("high_temp", rps_tmp.update)
|
||||
|
@ -1 +1 @@
|
||||
{"versions": {"installer": "v0.9m", "bootloader": "0.2", "comms": "1.4.0", "reactor-plc": "v0.12.3", "rtu": "v0.12.4", "supervisor": "v0.13.12", "coordinator": "v0.11.11", "pocket": "alpha-v0.0.0"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/tcallbackdsp.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/threads.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua"], "rtu": ["rtu/threads.lua", "rtu/rtu.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/apisessions.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/unit_waiting.lua", "coordinator/ui/components/turbine.lua"], "pocket": ["pocket/config.lua", "pocket/startup.lua"]}, "depends": {"reactor-plc": ["system", "common"], "rtu": ["system", "common"], "supervisor": ["system", "common"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 4650, "system": 1982, "common": 91075, "graphics": 99858, "lockbox": 100797, "reactor-plc": 75545, "rtu": 82913, "supervisor": 274269, "coordinator": 179964, "pocket": 335}}
|
||||
{"versions": {"installer": "v0.9m", "bootloader": "0.2", "comms": "1.4.0", "reactor-plc": "v0.12.4", "rtu": "v0.12.5", "supervisor": "v0.13.13", "coordinator": "v0.11.12", "pocket": "alpha-v0.0.0"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/tcallbackdsp.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/threads.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua"], "rtu": ["rtu/threads.lua", "rtu/rtu.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/apisessions.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/unit_waiting.lua", "coordinator/ui/components/turbine.lua"], "pocket": ["pocket/config.lua", "pocket/startup.lua"]}, "depends": {"reactor-plc": ["system", "common"], "rtu": ["system", "common"], "supervisor": ["system", "common"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 4650, "system": 1982, "common": 91071, "graphics": 99858, "lockbox": 100797, "reactor-plc": 75535, "rtu": 83729, "supervisor": 274484, "coordinator": 179960, "pocket": 335}}
|
@ -36,7 +36,7 @@ local PCALL_START_MSG = "pcall: Reactor is already active."
|
||||
---@param is_formed boolean
|
||||
function plc.rps_init(reactor, is_formed)
|
||||
local state_keys = {
|
||||
dmg_crit = 1,
|
||||
dmg_high = 1,
|
||||
high_temp = 2,
|
||||
no_coolant = 3,
|
||||
ex_waste = 4,
|
||||
@ -104,14 +104,14 @@ function plc.rps_init(reactor, is_formed)
|
||||
end
|
||||
end
|
||||
|
||||
-- check for critical damage
|
||||
local function _damage_critical()
|
||||
-- check for high damage
|
||||
local function _damage_high()
|
||||
local damage_percent = reactor.getDamagePercent()
|
||||
if damage_percent == ppm.ACCESS_FAULT then
|
||||
-- lost the peripheral or terminated, handled later
|
||||
_set_fault()
|
||||
elseif not self.state[state_keys.dmg_crit] then
|
||||
self.state[state_keys.dmg_crit] = damage_percent >= RPS_LIMITS.MAX_DAMAGE_PERCENT
|
||||
elseif not self.state[state_keys.dmg_high] then
|
||||
self.state[state_keys.dmg_high] = damage_percent >= RPS_LIMITS.MAX_DAMAGE_PERCENT
|
||||
end
|
||||
end
|
||||
|
||||
@ -273,7 +273,7 @@ function plc.rps_init(reactor, is_formed)
|
||||
parallel.waitForAll(
|
||||
_is_formed,
|
||||
_is_force_disabled,
|
||||
_damage_critical,
|
||||
_damage_high,
|
||||
_high_temp,
|
||||
_no_coolant,
|
||||
_excess_waste,
|
||||
@ -294,9 +294,9 @@ function plc.rps_init(reactor, is_formed)
|
||||
elseif self.state[state_keys.force_disabled] then
|
||||
log.warning("RPS: reactor was force disabled")
|
||||
status = RPS_TRIP_CAUSE.FORCE_DISABLED
|
||||
elseif self.state[state_keys.dmg_crit] then
|
||||
log.warning("RPS: damage critical")
|
||||
status = RPS_TRIP_CAUSE.DMG_CRIT
|
||||
elseif self.state[state_keys.dmg_high] then
|
||||
log.warning("RPS: damage level high")
|
||||
status = RPS_TRIP_CAUSE.DMG_HIGH
|
||||
elseif self.state[state_keys.high_temp] then
|
||||
log.warning("RPS: high temperature")
|
||||
status = RPS_TRIP_CAUSE.HIGH_TEMP
|
||||
|
@ -14,7 +14,7 @@ local config = require("reactor-plc.config")
|
||||
local plc = require("reactor-plc.plc")
|
||||
local threads = require("reactor-plc.threads")
|
||||
|
||||
local R_PLC_VERSION = "v0.12.3"
|
||||
local R_PLC_VERSION = "v0.12.4"
|
||||
|
||||
local print = util.print
|
||||
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 turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
||||
|
||||
local RTU_VERSION = "v0.12.4"
|
||||
local RTU_VERSION = "v0.12.5"
|
||||
|
||||
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
|
||||
|
||||
|
@ -65,7 +65,7 @@ local IO_PORT = {
|
||||
R_AUTO_CTRL = 13, -- active high, if the reactor burn rate is automatic
|
||||
R_SCRAMMED = 14, -- active high, if the reactor is scrammed
|
||||
R_AUTO_SCRAM = 15, -- active high, if the reactor was automatically scrammed
|
||||
R_DMG_CRIT = 16, -- active high, if the reactor damage is critical
|
||||
R_DMG_HIGH = 16, -- active high, if the reactor damage is high
|
||||
R_HIGH_TEMP = 17, -- active high, if the reactor is at a high temperature
|
||||
R_NO_COOLANT = 18, -- active high, if the reactor has no coolant
|
||||
R_EXCESS_HC = 19, -- active high, if the reactor has excess heated coolant
|
||||
@ -108,7 +108,7 @@ function rsio.to_string(port)
|
||||
"R_AUTO_CTRL",
|
||||
"R_SCRAMMED",
|
||||
"R_AUTO_SCRAM",
|
||||
"R_DMG_CRIT",
|
||||
"R_DMG_HIGH",
|
||||
"R_HIGH_TEMP",
|
||||
"R_NO_COOLANT",
|
||||
"R_EXCESS_HC",
|
||||
@ -171,7 +171,7 @@ local RS_DIO_MAP = {
|
||||
{ _in = _I_ACTIVE_HIGH, _out = _O_ACTIVE_HIGH, mode = IO_DIR.OUT },
|
||||
-- R_AUTO_SCRAM
|
||||
{ _in = _I_ACTIVE_HIGH, _out = _O_ACTIVE_HIGH, mode = IO_DIR.OUT },
|
||||
-- R_DMG_CRIT
|
||||
-- R_DMG_HIGH
|
||||
{ _in = _I_ACTIVE_HIGH, _out = _O_ACTIVE_HIGH, mode = IO_DIR.OUT },
|
||||
-- R_HIGH_TEMP
|
||||
{ _in = _I_ACTIVE_HIGH, _out = _O_ACTIVE_HIGH, mode = IO_DIR.OUT },
|
||||
@ -215,7 +215,7 @@ function rsio.get_io_mode(port)
|
||||
IO_MODE.DIGITAL_OUT, -- R_AUTO_CTRL
|
||||
IO_MODE.DIGITAL_OUT, -- R_SCRAMMED
|
||||
IO_MODE.DIGITAL_OUT, -- R_AUTO_SCRAM
|
||||
IO_MODE.DIGITAL_OUT, -- R_DMG_CRIT
|
||||
IO_MODE.DIGITAL_OUT, -- R_DMG_HIGH
|
||||
IO_MODE.DIGITAL_OUT, -- R_HIGH_TEMP
|
||||
IO_MODE.DIGITAL_OUT, -- R_NO_COOLANT
|
||||
IO_MODE.DIGITAL_OUT, -- R_EXCESS_HC
|
||||
|
@ -273,7 +273,7 @@ types.FLUID = {
|
||||
|
||||
---@alias rps_trip_cause
|
||||
---| "ok"
|
||||
---| "dmg_crit"
|
||||
---| "dmg_high"
|
||||
---| "high_temp"
|
||||
---| "no_coolant"
|
||||
---| "ex_waste"
|
||||
@ -288,7 +288,7 @@ types.FLUID = {
|
||||
|
||||
types.RPS_TRIP_CAUSE = {
|
||||
OK = "ok",
|
||||
DMG_CRIT = "dmg_crit",
|
||||
DMG_HIGH = "dmg_high",
|
||||
HIGH_TEMP = "high_temp",
|
||||
NO_COOLANT = "no_coolant",
|
||||
EX_WASTE = "ex_waste",
|
||||
|
@ -102,7 +102,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
||||
rps_trip_cause = "ok", ---@type rps_trip_cause
|
||||
---@class rps_status
|
||||
rps_status = {
|
||||
dmg_crit = false,
|
||||
dmg_high = false,
|
||||
high_temp = false,
|
||||
no_cool = false,
|
||||
ex_waste = false,
|
||||
@ -169,7 +169,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
||||
local function _copy_rps_status(rps_status)
|
||||
self.sDB.rps_tripped = rps_status[1]
|
||||
self.sDB.rps_trip_cause = rps_status[2]
|
||||
self.sDB.rps_status.dmg_crit = rps_status[3]
|
||||
self.sDB.rps_status.dmg_high = rps_status[3]
|
||||
self.sDB.rps_status.high_temp = rps_status[4]
|
||||
self.sDB.rps_status.no_cool = rps_status[5]
|
||||
self.sDB.rps_status.ex_waste = rps_status[6]
|
||||
|
@ -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.12"
|
||||
local SUPERVISOR_VERSION = "v0.13.13"
|
||||
|
||||
local print = util.print
|
||||
local println = util.println
|
||||
|
@ -96,7 +96,7 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
||||
last_rate_change_ms = 0,
|
||||
---@type rps_status
|
||||
last_rps_trips = {
|
||||
dmg_crit = false,
|
||||
dmg_high = false,
|
||||
high_temp = false,
|
||||
no_cool = false,
|
||||
ex_waste = false,
|
||||
@ -115,7 +115,7 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
||||
rps_trip = false,
|
||||
---@type rps_status
|
||||
rps_status = {
|
||||
dmg_crit = false,
|
||||
dmg_high = false,
|
||||
high_temp = false,
|
||||
no_cool = false,
|
||||
ex_waste = false,
|
||||
|
@ -8,10 +8,11 @@ local plc = require("supervisor.session.plc")
|
||||
|
||||
local qtypes = require("supervisor.session.rtu.qtypes")
|
||||
|
||||
local TRI_FAIL = types.TRI_FAIL
|
||||
local DUMPING_MODE = types.DUMPING_MODE
|
||||
local PRIO = types.ALARM_PRIORITY
|
||||
local ALARM_STATE = types.ALARM_STATE
|
||||
local RPS_TRIP_CAUSE = types.RPS_TRIP_CAUSE
|
||||
local TRI_FAIL = types.TRI_FAIL
|
||||
local DUMPING_MODE = types.DUMPING_MODE
|
||||
local PRIO = types.ALARM_PRIORITY
|
||||
local ALARM_STATE = types.ALARM_STATE
|
||||
|
||||
local TBV_RTU_S_DATA = qtypes.TBV_RTU_S_DATA
|
||||
|
||||
@ -473,7 +474,7 @@ function logic.update_alarms(self)
|
||||
_update_alarm_state(self, plc_cache.damage >= 100, self.alarms.CriticalDamage)
|
||||
|
||||
-- Reactor Damage
|
||||
local rps_dmg_90 = plc_cache.rps_status.dmg_crit and not self.last_rps_trips.dmg_crit
|
||||
local rps_dmg_90 = plc_cache.rps_status.dmg_high and not self.last_rps_trips.dmg_high
|
||||
_update_alarm_state(self, (plc_cache.damage > 0) or rps_dmg_90, self.alarms.ReactorDamage)
|
||||
|
||||
-- Over-Temperature
|
||||
@ -673,31 +674,31 @@ function logic.update_status_text(self)
|
||||
elseif plc_db.rps_tripped then
|
||||
local cause = "unknown"
|
||||
|
||||
if plc_db.rps_trip_cause == "ok" then
|
||||
if plc_db.rps_trip_cause == RPS_TRIP_CAUSE.OK then
|
||||
-- hmm...
|
||||
elseif plc_db.rps_trip_cause == "dmg_crit" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.DMG_HIGH then
|
||||
cause = "core damage high"
|
||||
elseif plc_db.rps_trip_cause == "high_temp" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.HIGH_TEMP then
|
||||
cause = "core temperature high"
|
||||
elseif plc_db.rps_trip_cause == "no_coolant" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.NO_COOLANT then
|
||||
cause = "insufficient coolant"
|
||||
elseif plc_db.rps_trip_cause == "ex_waste" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.EX_WASTE then
|
||||
cause = "excess waste"
|
||||
elseif plc_db.rps_trip_cause == "ex_heated_coolant" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.EX_HCOOLANT then
|
||||
cause = "excess heated coolant"
|
||||
elseif plc_db.rps_trip_cause == "no_fuel" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.NO_FUEL then
|
||||
cause = "insufficient fuel"
|
||||
elseif plc_db.rps_trip_cause == "fault" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.FAULT then
|
||||
cause = "hardware fault"
|
||||
elseif plc_db.rps_trip_cause == "timeout" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.TIMEOUT then
|
||||
cause = "connection timed out"
|
||||
elseif plc_db.rps_trip_cause == "manual" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.MANUAL then
|
||||
cause = "manual operator SCRAM"
|
||||
elseif plc_db.rps_trip_cause == "automatic" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.AUTOMATIC then
|
||||
cause = "automated system SCRAM"
|
||||
elseif plc_db.rps_trip_cause == "sys_fail" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.SYS_FAIL then
|
||||
cause = "PLC system failure"
|
||||
elseif plc_db.rps_trip_cause == "force_disabled" then
|
||||
elseif plc_db.rps_trip_cause == RPS_TRIP_CAUSE.FORCE_DISABLED then
|
||||
cause = "reactor force disabled"
|
||||
end
|
||||
|
||||
@ -771,7 +772,7 @@ function logic.handle_redstone(self)
|
||||
self.io_ctl.digital_write(IO.R_AUTO_CTRL, self.auto_engaged)
|
||||
self.io_ctl.digital_write(IO.R_SCRAMMED, self.plc_cache.rps_trip)
|
||||
self.io_ctl.digital_write(IO.R_AUTO_SCRAM, self.plc_cache.rps_status.automatic)
|
||||
self.io_ctl.digital_write(IO.R_DMG_CRIT, self.plc_cache.rps_status.dmg_crit)
|
||||
self.io_ctl.digital_write(IO.R_DMG_HIGH, self.plc_cache.rps_status.dmg_high)
|
||||
self.io_ctl.digital_write(IO.R_HIGH_TEMP, self.plc_cache.rps_status.high_temp)
|
||||
self.io_ctl.digital_write(IO.R_NO_COOLANT, self.plc_cache.rps_status.no_cool)
|
||||
self.io_ctl.digital_write(IO.R_EXCESS_HC, self.plc_cache.rps_status.ex_hcool)
|
||||
|
Loading…
Reference in New Issue
Block a user