#115, #116 multiple bugfixes with reactor PLC code

This commit is contained in:
Mikayla Fischler
2022-11-05 12:44:40 -04:00
parent 1828920873
commit aaab34f1a8
3 changed files with 34 additions and 22 deletions

View File

@@ -82,13 +82,16 @@ function plc.rps_init(reactor, is_formed)
-- check if the reactor is formed
local function _is_formed()
local is_formed = self.reactor.isFormed()
if is_formed == ppm.ACCESS_FAULT then
local formed = self.reactor.isFormed()
if formed == ppm.ACCESS_FAULT then
-- lost the peripheral or terminated, handled later
_set_fault()
elseif not self.state[state_keys.sys_fail] then
self.formed = is_formed
self.state[state_keys.sys_fail] = not is_formed
else
self.formed = formed
if not self.state[state_keys.sys_fail] then
self.state[state_keys.sys_fail] = not formed
end
end
end