Merge branch 'devel' into 232-waste-valve-and-flow-monitoring-display
This commit is contained in:
@@ -733,6 +733,23 @@ function unit.new(reactor_id, num_boilers, num_turbines)
|
||||
return false
|
||||
end
|
||||
|
||||
-- check if the reactor is connected, is stopped, the RPS is not tripped, and no alarms are active
|
||||
---@nodiscard
|
||||
function public.is_safe_idle()
|
||||
-- can't be disconnected
|
||||
if self.plc_i == nil then return false end
|
||||
|
||||
-- reactor must be stopped and RPS can't be tripped
|
||||
if self.plc_i.get_status().status or self.plc_i.get_db().rps_tripped then return false end
|
||||
|
||||
-- alarms must be inactive and not tripping
|
||||
for _, alarm in pairs(self.alarms) do
|
||||
if not (alarm.state == AISTATE.INACTIVE or alarm.state == AISTATE.RING_BACK) then return false end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- check if emergency coolant activation has been tripped
|
||||
---@nodiscard
|
||||
function public.is_emer_cool_tripped() return self.emcool_opened end
|
||||
|
||||
Reference in New Issue
Block a user