ISS alarm status packet adjustments
This commit is contained in:
parent
3fe47f99a9
commit
479194b589
@ -147,7 +147,7 @@ function iss_init(reactor)
|
|||||||
elseif self.cache[5] then
|
elseif self.cache[5] then
|
||||||
log._warning("ISS: no fuel!")
|
log._warning("ISS: no fuel!")
|
||||||
status = "no_fuel"
|
status = "no_fuel"
|
||||||
elseif self.timed_out then
|
elseif self.cache[7] then
|
||||||
log._warning("ISS: supervisor connection timeout!")
|
log._warning("ISS: supervisor connection timeout!")
|
||||||
status = "timeout"
|
status = "timeout"
|
||||||
else
|
else
|
||||||
@ -368,14 +368,16 @@ function comms_init(id, modem, local_port, server_port, reactor, iss)
|
|||||||
_send(RPLC_TYPES.STATUS, sys_status)
|
_send(RPLC_TYPES.STATUS, sys_status)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- send safety system status
|
||||||
local send_iss_status = function ()
|
local send_iss_status = function ()
|
||||||
_send(RPLC_TYPES.ISS_STATUS, iss.status())
|
_send(RPLC_TYPES.ISS_STATUS, iss.status())
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- send safety system alarm
|
||||||
local send_iss_alarm = function (cause)
|
local send_iss_alarm = function (cause)
|
||||||
local iss_alarm = {
|
local iss_alarm = {
|
||||||
cause,
|
cause,
|
||||||
iss.status()
|
table.unpack(iss.status())
|
||||||
}
|
}
|
||||||
|
|
||||||
_send(RPLC_TYPES.ISS_ALARM, iss_alarm)
|
_send(RPLC_TYPES.ISS_ALARM, iss_alarm)
|
||||||
|
|||||||
@ -49,6 +49,8 @@ function new_session(id, for_reactor, in_queue, out_queue)
|
|||||||
control_state = false,
|
control_state = false,
|
||||||
overridden = false,
|
overridden = false,
|
||||||
degraded = false,
|
degraded = false,
|
||||||
|
iss_tripped = false,
|
||||||
|
iss_trip_cause = "ok",
|
||||||
iss_status = {
|
iss_status = {
|
||||||
dmg_crit = false,
|
dmg_crit = false,
|
||||||
ex_hcool = false,
|
ex_hcool = false,
|
||||||
@ -262,13 +264,15 @@ function new_session(id, for_reactor, in_queue, out_queue)
|
|||||||
elseif rplc_pkt.type == RPLC_TYPES.ISS_ALARM then
|
elseif rplc_pkt.type == RPLC_TYPES.ISS_ALARM then
|
||||||
-- ISS alarm
|
-- ISS alarm
|
||||||
self.sDB.overridden = true
|
self.sDB.overridden = true
|
||||||
if rplc_pkt.length == 7 then
|
if rplc_pkt.length == 8 then
|
||||||
local status = pcall(_copy_iss_status, rplc_pkt.data)
|
self.sDB.iss_tripped = true
|
||||||
|
self.sDB.iss_trip_cause = rplc_pkt.data[1]
|
||||||
|
local status = pcall(_copy_iss_status, { table.unpack(rplc_pkt.data, 2, #rplc_pkt.length) })
|
||||||
if status then
|
if status then
|
||||||
-- copied in ISS status data OK
|
-- copied in ISS status data OK
|
||||||
else
|
else
|
||||||
-- error copying ISS status data
|
-- error copying ISS status data
|
||||||
log._error(log_header .. "failed to parse ISS status packet data")
|
log._error(log_header .. "failed to parse ISS alarm status data")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log._debug(log_header .. "RPLC ISS alarm packet length mismatch")
|
log._debug(log_header .. "RPLC ISS alarm packet length mismatch")
|
||||||
@ -277,6 +281,9 @@ function new_session(id, for_reactor, in_queue, out_queue)
|
|||||||
-- ISS clear acknowledgement
|
-- ISS clear acknowledgement
|
||||||
if _get_ack(rplc_pkt) == false then
|
if _get_ack(rplc_pkt) == false then
|
||||||
log._warning(log_header .. "ISS clear failed")
|
log._warning(log_header .. "ISS clear failed")
|
||||||
|
else
|
||||||
|
self.sDB.iss_tripped = false
|
||||||
|
self.sDB.iss_trip_cause = "ok"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log._debug(log_header .. "handler received unsupported RPLC packet type " .. rplc_pkt.type)
|
log._debug(log_header .. "handler received unsupported RPLC packet type " .. rplc_pkt.type)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user