From 671f8b55bcc8127efc34cc422e422b4110c8758d Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Tue, 6 Jun 2023 19:49:28 -0400 Subject: [PATCH] updated supervisor front panel RTT coloring limits --- supervisor/databus.lua | 20 ++++++++++++-------- supervisor/startup.lua | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/supervisor/databus.lua b/supervisor/databus.lua index 664b3fe..96e0e80 100644 --- a/supervisor/databus.lua +++ b/supervisor/databus.lua @@ -6,6 +6,10 @@ local psil = require("scada-common.psil") 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 = {} -- databus PSIL @@ -54,9 +58,9 @@ end function databus.tx_plc_rtt(reactor_id, 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) - elseif rtt > 300 then + elseif rtt > WARN_RTT then databus.ps.publish("plc_" .. reactor_id .. "_rtt_color", colors.yellow_hc) else databus.ps.publish("plc_" .. reactor_id .. "_rtt_color", colors.green) @@ -85,9 +89,9 @@ end function databus.tx_rtu_rtt(session_id, 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) - elseif rtt > 300 then + elseif rtt > WARN_RTT then databus.ps.publish("rtu_" .. session_id .. "_rtt_color", colors.yellow_hc) else databus.ps.publish("rtu_" .. session_id .. "_rtt_color", colors.green) @@ -124,9 +128,9 @@ end function databus.tx_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) - elseif rtt > 300 then + elseif rtt > WARN_RTT then databus.ps.publish("crd_rtt_color", colors.yellow_hc) else databus.ps.publish("crd_rtt_color", colors.green) @@ -155,9 +159,9 @@ end function databus.tx_pdg_rtt(session_id, 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) - elseif rtt > 300 then + elseif rtt > WARN_RTT then databus.ps.publish("pdg_" .. session_id .. "_rtt_color", colors.yellow_hc) else databus.ps.publish("pdg_" .. session_id .. "_rtt_color", colors.green) diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 4f35394..bb48cc7 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -20,7 +20,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v0.17.2" +local SUPERVISOR_VERSION = "v0.17.3" local println = util.println local println_ts = util.println_ts