mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
updated supervisor front panel RTT coloring limits
This commit is contained in:
parent
e16b0d237e
commit
671f8b55bc
@ -6,6 +6,10 @@ local psil = require("scada-common.psil")
|
|||||||
|
|
||||||
local pgi = require("supervisor.panel.pgi")
|
local pgi = require("supervisor.panel.pgi")
|
||||||
|
|
||||||
|
-- nominal RTT is ping (0ms to 10ms usually) + 150ms for SV main loop tick
|
||||||
|
local WARN_RTT = 300 -- 2x as long as expected w/ 0 ping
|
||||||
|
local HIGH_RTT = 500 -- 3.33x as long as expected w/ 0 ping
|
||||||
|
|
||||||
local databus = {}
|
local databus = {}
|
||||||
|
|
||||||
-- databus PSIL
|
-- databus PSIL
|
||||||
@ -54,9 +58,9 @@ end
|
|||||||
function databus.tx_plc_rtt(reactor_id, rtt)
|
function databus.tx_plc_rtt(reactor_id, rtt)
|
||||||
databus.ps.publish("plc_" .. reactor_id .. "_rtt", rtt)
|
databus.ps.publish("plc_" .. reactor_id .. "_rtt", rtt)
|
||||||
|
|
||||||
if rtt > 700 then
|
if rtt > HIGH_RTT then
|
||||||
databus.ps.publish("plc_" .. reactor_id .. "_rtt_color", colors.red)
|
databus.ps.publish("plc_" .. reactor_id .. "_rtt_color", colors.red)
|
||||||
elseif rtt > 300 then
|
elseif rtt > WARN_RTT then
|
||||||
databus.ps.publish("plc_" .. reactor_id .. "_rtt_color", colors.yellow_hc)
|
databus.ps.publish("plc_" .. reactor_id .. "_rtt_color", colors.yellow_hc)
|
||||||
else
|
else
|
||||||
databus.ps.publish("plc_" .. reactor_id .. "_rtt_color", colors.green)
|
databus.ps.publish("plc_" .. reactor_id .. "_rtt_color", colors.green)
|
||||||
@ -85,9 +89,9 @@ end
|
|||||||
function databus.tx_rtu_rtt(session_id, rtt)
|
function databus.tx_rtu_rtt(session_id, rtt)
|
||||||
databus.ps.publish("rtu_" .. session_id .. "_rtt", rtt)
|
databus.ps.publish("rtu_" .. session_id .. "_rtt", rtt)
|
||||||
|
|
||||||
if rtt > 700 then
|
if rtt > HIGH_RTT then
|
||||||
databus.ps.publish("rtu_" .. session_id .. "_rtt_color", colors.red)
|
databus.ps.publish("rtu_" .. session_id .. "_rtt_color", colors.red)
|
||||||
elseif rtt > 300 then
|
elseif rtt > WARN_RTT then
|
||||||
databus.ps.publish("rtu_" .. session_id .. "_rtt_color", colors.yellow_hc)
|
databus.ps.publish("rtu_" .. session_id .. "_rtt_color", colors.yellow_hc)
|
||||||
else
|
else
|
||||||
databus.ps.publish("rtu_" .. session_id .. "_rtt_color", colors.green)
|
databus.ps.publish("rtu_" .. session_id .. "_rtt_color", colors.green)
|
||||||
@ -124,9 +128,9 @@ end
|
|||||||
function databus.tx_crd_rtt(rtt)
|
function databus.tx_crd_rtt(rtt)
|
||||||
databus.ps.publish("crd_rtt", rtt)
|
databus.ps.publish("crd_rtt", rtt)
|
||||||
|
|
||||||
if rtt > 700 then
|
if rtt > HIGH_RTT then
|
||||||
databus.ps.publish("crd_rtt_color", colors.red)
|
databus.ps.publish("crd_rtt_color", colors.red)
|
||||||
elseif rtt > 300 then
|
elseif rtt > WARN_RTT then
|
||||||
databus.ps.publish("crd_rtt_color", colors.yellow_hc)
|
databus.ps.publish("crd_rtt_color", colors.yellow_hc)
|
||||||
else
|
else
|
||||||
databus.ps.publish("crd_rtt_color", colors.green)
|
databus.ps.publish("crd_rtt_color", colors.green)
|
||||||
@ -155,9 +159,9 @@ end
|
|||||||
function databus.tx_pdg_rtt(session_id, rtt)
|
function databus.tx_pdg_rtt(session_id, rtt)
|
||||||
databus.ps.publish("pdg_" .. session_id .. "_rtt", rtt)
|
databus.ps.publish("pdg_" .. session_id .. "_rtt", rtt)
|
||||||
|
|
||||||
if rtt > 700 then
|
if rtt > HIGH_RTT then
|
||||||
databus.ps.publish("pdg_" .. session_id .. "_rtt_color", colors.red)
|
databus.ps.publish("pdg_" .. session_id .. "_rtt_color", colors.red)
|
||||||
elseif rtt > 300 then
|
elseif rtt > WARN_RTT then
|
||||||
databus.ps.publish("pdg_" .. session_id .. "_rtt_color", colors.yellow_hc)
|
databus.ps.publish("pdg_" .. session_id .. "_rtt_color", colors.yellow_hc)
|
||||||
else
|
else
|
||||||
databus.ps.publish("pdg_" .. session_id .. "_rtt_color", colors.green)
|
databus.ps.publish("pdg_" .. session_id .. "_rtt_color", colors.green)
|
||||||
|
@ -20,7 +20,7 @@ local supervisor = require("supervisor.supervisor")
|
|||||||
|
|
||||||
local svsessions = require("supervisor.session.svsessions")
|
local svsessions = require("supervisor.session.svsessions")
|
||||||
|
|
||||||
local SUPERVISOR_VERSION = "v0.17.2"
|
local SUPERVISOR_VERSION = "v0.17.3"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
Loading…
Reference in New Issue
Block a user