fixes and comments

This commit is contained in:
Mikayla Fischler 2024-04-14 16:16:18 -04:00
parent d2df7db18b
commit 473b0dd10d
6 changed files with 21 additions and 7 deletions

View File

@ -485,7 +485,7 @@ function coordinator.comms(version, nic, sv_watchdog)
_send_api_establish_ack(packet.scada_frame, ESTABLISH_ACK.BAD_VERSION)
elseif api_v ~= comms.api_version then
if self.last_api_est_acks[src_addr] ~= ESTABLISH_ACK.BAD_API_VERSION then
log.info(util.c("dropping API establish packet with incorrect api version v", comms_v, " (expected v", comms.version, ")"))
log.info(util.c("dropping API establish packet with incorrect api version v", api_v, " (expected v", comms.api_version, ")"))
end
_send_api_establish_ack(packet.scada_frame, ESTABLISH_ACK.BAD_API_VERSION)

View File

@ -279,7 +279,20 @@ function iocontrol.init(conf, comms, temp_scale)
},
---@type alarms
alarms = { ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE, ALARM_STATE.INACTIVE },
alarms = {
ALARM_STATE.INACTIVE, -- containment breach
ALARM_STATE.INACTIVE, -- containment radiation
ALARM_STATE.INACTIVE, -- reactor lost
ALARM_STATE.INACTIVE, -- damage critical
ALARM_STATE.INACTIVE, -- reactor taking damage
ALARM_STATE.INACTIVE, -- reactor over temperature
ALARM_STATE.INACTIVE, -- reactor high temperature
ALARM_STATE.INACTIVE, -- waste leak
ALARM_STATE.INACTIVE, -- waste level high
ALARM_STATE.INACTIVE, -- RPS transient
ALARM_STATE.INACTIVE, -- RCS transient
ALARM_STATE.INACTIVE -- turbine trip
},
annunciator = {}, ---@type annunciator

View File

@ -151,6 +151,8 @@ function pocket.new_session(id, s_addr, in_queue, out_queue, timeout)
u.has_tank
})
end
_send(CRDN_TYPE.API_GET_UNITS, data)
else
log.debug(log_header .. "handler received unsupported CRDN packet type " .. pkt.type)
end

View File

@ -13,7 +13,7 @@ local MOUSE_CLICK = core.events.MOUSE_CLICK
---@field nav_colors cpair on/off colors (a/b respectively) for page navigator
---@field scroll_nav boolean? true to allow scrolling to change the active pane
---@field drag_nav boolean? true to allow mouse dragging to change the active pane (on mouse up)
---@field callback function? function to call when scrolling or dragging changes the pane
---@field callback function? function to call when pane is changed by mouse interaction
---@field parent graphics_element
---@field id? string element id
---@field x? integer 1 if omitted
@ -44,6 +44,7 @@ local function multipane(args)
for i = 1, #args.panes do args.panes[i].hide() end
args.panes[e.value].show()
-- draw page indicator dots
for i = 1, #args.panes do
e.w_set_cur(nav_x_start + (i - 1), e.frame.h)
e.w_set_fgd(util.trinary(i == e.value, args.nav_colors.color_a, args.nav_colors.color_b))
@ -62,10 +63,8 @@ local function multipane(args)
if event.type == MOUSE_CLICK.TAP then
e.set_value(id)
args.callback(e.value)
elseif event.type == MOUSE_CLICK.UP then
e.set_value(id)
args.callback(e.value)
end
end
end

View File

@ -99,7 +99,7 @@ function iocontrol.alloc_nav()
end
end
-- create a new page entry in the page navigation tree
-- create a new page entry in the app's page navigation tree
---@param parent nav_tree_page? a parent page or nil to set this as the root
---@param nav_to function|integer function to navigate to this page or pane index
---@return nav_tree_page new_page this new page

View File

@ -18,7 +18,7 @@ local iocontrol = require("pocket.iocontrol")
local pocket = require("pocket.pocket")
local renderer = require("pocket.renderer")
local POCKET_VERSION = "v0.7.5-alpha"
local POCKET_VERSION = "v0.8.0-alpha"
local println = util.println
local println_ts = util.println_ts