Compare commits

..

7 Commits

Author SHA1 Message Date
Mikayla
bdbb3071b3 Merge pull request #294 from MikaylaFischler/devel
2023.07.19 Hotfix
2023-07-19 19:18:48 -04:00
Mikayla Fischler
def02a94d2 #293 fixed race condition with graphics element IDs 2023-07-19 11:27:33 -04:00
Mikayla Fischler
681bb0963e #291 RTU comms thread no longer yields every packet 2023-07-18 22:28:43 -04:00
Mikayla
8f7d7c3ead Merge pull request #288 from MikaylaFischler/devel
2023.07.17 Hotfix
2023-07-17 22:48:03 -04:00
Mikayla Fischler
c0f45cfb8b updated comments 2023-07-17 22:47:19 -04:00
Mikayla Fischler
455653074a #287 fixed coordinator not notifying supervisor of auto waste config 2023-07-17 22:09:21 -04:00
Mikayla Fischler
1202289fab #285 #286 mitigated false trips 2023-07-17 20:59:45 -04:00
11 changed files with 48 additions and 30 deletions

View File

@@ -75,6 +75,10 @@ function process.init(iocontrol, coord_comms)
end
log.info("PROCESS: loaded auto control settings from coord.settings")
-- notify supervisor of auto waste config
self.comms.send_fac_command(FAC_COMMAND.SET_WASTE_MODE, self.config.waste_product)
self.comms.send_fac_command(FAC_COMMAND.SET_PU_FB, self.config.pu_fallback)
end
-- unit waste states

View File

@@ -22,7 +22,7 @@ local sounder = require("coordinator.sounder")
local apisessions = require("coordinator.session.apisessions")
local COORDINATOR_VERSION = "v0.21.0"
local COORDINATOR_VERSION = "v0.21.2"
local println = util.println
local println_ts = util.println_ts

View File

@@ -52,6 +52,8 @@ function pgi.delete_pkt_entry(session_id)
if not success then
log.error(util.c("PGI: failed to delete PKT entry (", result, ")"), true)
end
else
log.debug(util.c("PGI: tried to delete unknown PKT entry ", session_id))
end
end

View File

@@ -7,7 +7,7 @@ local flasher = require("graphics.flasher")
local core = {}
core.version = "1.0.1"
core.version = "1.0.2"
core.flasher = flasher
core.events = events

View File

@@ -71,7 +71,8 @@ function element.new(args, child_offset_x, child_offset_y)
p_window = nil, ---@type table
position = { x = 1, y = 1 }, ---@type coordinate_2d
bounds = { x1 = 1, y1 = 1, x2 = 1, y2 = 1 }, ---@class element_bounds
next_y = 1,
next_y = 1, -- next child y coordinate
next_id = 0, -- next child ID
subscriptions = {},
mt = {}
}
@@ -352,13 +353,14 @@ function element.new(args, child_offset_x, child_offset_y)
local child_element = child.get()
if key == nil then
table.insert(protected.children, child_element)
return #protected.children
else
protected.children[key] = child_element
return key
local id = key ---@type string|integer|nil
if id == nil then
id = self.next_id
self.next_id = self.next_id + 1
end
protected.children[id] = child_element
return id
end
-- remove a child element

File diff suppressed because one or more lines are too long

View File

@@ -30,7 +30,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
local sps_rtu = require("rtu.dev.sps_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local RTU_VERSION = "v1.5.4"
local RTU_VERSION = "v1.5.5"
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE

View File

@@ -308,7 +308,9 @@ function threads.thread__comms(smem)
-- thread loop
while true do
-- check for messages in the message queue
local handle_start = util.time()
-- check for messages in the message queue while not shut down
while comms_queue.ready() and not rtu_state.shutdown do
local msg = comms_queue.pop()
@@ -324,10 +326,16 @@ function threads.thread__comms(smem)
end
end
-- quick yield
util.nop()
-- max 100ms spent processing queue
if util.time() - handle_start > 100 then
log.warning("comms thread exceeded 100ms queue process limit")
break
end
end
-- quick yield
util.nop()
-- check for termination request
if rtu_state.shutdown then
rtu_comms.close(rtu_state)
@@ -414,6 +422,12 @@ function threads.thread__unit_comms(smem, unit)
util.nop()
end
-- check for termination request
if rtu_state.shutdown then
log.info("rtu unit thread exiting -> " .. short_name)
break
end
-- check if multiblock is still formed if this is a multiblock
if unit.is_multiblock and (util.time_ms() - last_f_check > 250) then
local is_formed = unit.device.isFormed()
@@ -507,12 +521,6 @@ function threads.thread__unit_comms(smem, unit)
-- update hw status
databus.tx_unit_hw_status(unit.uid, unit.hw_state)
-- check for termination request
if rtu_state.shutdown then
log.info("rtu unit thread exiting -> " .. short_name)
break
end
-- delay before next check
last_update = util.adaptive_delay(COMMS_SLEEP, last_update)
end

View File

@@ -60,6 +60,8 @@ function pgi.delete_rtu_entry(session_id)
if not success then
log.error(util.c("PGI: failed to delete RTU entry (", result, ")"), true)
end
else
log.debug(util.c("PGI: tried to delete unknown RTU entry ", session_id))
end
end
@@ -87,6 +89,8 @@ function pgi.delete_pdg_entry(session_id)
if not success then
log.error(util.c("PGI: failed to delete PDG entry (", result, ")"), true)
end
else
log.debug(util.c("PGI: tried to delete unknown PDG entry ", session_id))
end
end

View File

@@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v0.20.2"
local SUPERVISOR_VERSION = "v0.20.4"
local println = util.println
local println_ts = util.println_ts

View File

@@ -327,13 +327,14 @@ function logic.update_annunciator(self)
--[[
Generator Trip
a generator trip is when a generator suddenly and unexpectedly loses it's external load
oftentimes this is when a power plant is disconnected from the grid for one reason or another
in this case we just:
- check if internal power storage of turbine is increasing
that means there is no external load and there will be a turbine trip soon if this is not resolved
a generator trip is when a generator suddenly and unexpectedly loses it's external load, which occurs when a power plant
is disconnected from the grid. in our case, this is when the turbine is disconnected, or what it's connected to becomes
fully charged. this is identified by detecting if:
- the internal power storage of the turbine is increasing AND
- there is at least 5% energy fill (preventing false trips with periodic power extraction from other mods)
this would then mean there is no external load and there will be a turbine trip soon if this is not resolved
]]--
self.db.annunciator.GeneratorTrip[idx] = _get_dt(DT_KEYS.TurbinePower .. idx) > 0.0
self.db.annunciator.GeneratorTrip[idx] = (_get_dt(DT_KEYS.TurbinePower .. idx) > 0.0) and (db.tanks.energy_fill > 0.05)
--[[
Turbine Trip
@@ -504,9 +505,6 @@ function logic.update_alarms(self)
local rcs_trans = any_low or any_over or gen_trip or annunc.RCPTrip or annunc.MaxWaterReturnFeed
-- only care about RCS flow low early with boilers
if self.num_boilers > 0 then rcs_trans = rcs_trans or annunc.RCSFlowLow end
-- annunciator indicators for these states may not indicate a real issue when:
-- > flow is ramping up right after reactor start
-- > flow is ramping down after reactor shutdown