#399 unit waste data updating

This commit is contained in:
Mikayla Fischler
2024-11-17 18:22:40 -05:00
parent 3e1f567c0f
commit 8fad94c4c6
8 changed files with 97 additions and 12 deletions

View File

@@ -339,6 +339,31 @@ function pocket.new_session(id, s_addr, i_seq_num, in_queue, out_queue, timeout)
{ proc.mode, proc.burn_target, proc.charge_target, proc.gen_target }
}
_send(CRDN_TYPE.API_GET_PROC, data)
elseif pkt.type == CRDN_TYPE.API_GET_WASTE then
local data = {}
-- local fac = db.facility
-- local proc = process.get_control_states().process
-- unit data
for i = 1, #db.units do
local u = db.units[i]
data[i] = {
u.waste_mode,
u.waste_product,
u.num_snas,
u.sna_peak_rate,
u.sna_max_rate,
u.sna_out_rate,
u.waste_stats
}
end
-- facility data
data[#db.units + 1] = {}
_send(CRDN_TYPE.API_GET_PROC, data)
else
log.debug(log_tag .. "handler received unsupported CRDN packet type " .. pkt.type)