#184 support supervisor running without front panel, halved heartbeat blink rate

This commit is contained in:
Mikayla Fischler
2023-06-03 15:45:48 -04:00
parent 69df5edbeb
commit 529371a0fd
11 changed files with 152 additions and 121 deletions

View File

@@ -11,9 +11,6 @@ local DEVICE_TYPE = comms.DEVICE_TYPE
local ESTABLISH_ACK = comms.ESTABLISH_ACK
local SCADA_MGMT_TYPE = comms.SCADA_MGMT_TYPE
-- local println = util.println
local println = function (str) end
-- supervisory controller communications
---@nodiscard
---@param _version string supervisor version
@@ -23,8 +20,12 @@ local println = function (str) end
---@param dev_listen integer listening port for PLC/RTU devices
---@param svctl_listen integer listening port for supervisor access
---@param range integer trusted device connection range
---@param fp_ok boolean if the front panel UI is running
---@diagnostic disable-next-line: unused-local
function supervisor.comms(_version, num_reactors, cooling_conf, modem, dev_listen, svctl_listen, range)
function supervisor.comms(_version, num_reactors, cooling_conf, modem, dev_listen, svctl_listen, range, fp_ok)
-- print a log message to the terminal as long as the UI isn't running
local function println(message) if not fp_ok then util.println_ts(message) end end
local self = {
last_est_acks = {}
}
@@ -42,8 +43,8 @@ function supervisor.comms(_version, num_reactors, cooling_conf, modem, dev_liste
_conf_channels()
-- link modem to svsessions
svsessions.init(modem, num_reactors, cooling_conf)
-- pass modem, status, and config data to svsessions
svsessions.init(modem, fp_ok, num_reactors, cooling_conf)
-- send an establish request response to a PLC/RTU
---@param dest integer