#469 made ETA tolerant to induction matrix capacity changes

This commit is contained in:
Mikayla Fischler
2024-04-28 01:26:44 -04:00
parent 826086951e
commit 6f768ef6b3
2 changed files with 17 additions and 8 deletions

View File

@@ -189,11 +189,15 @@ function util.mov_avg(length)
---@class moving_average
local public = {}
-- reset all to a given value
---@param x number value
-- reset all to a given value, or clear all data if no value is given
---@param x number? value
function public.reset(x)
index = 1
data = {}
for _ = 1, length do t_insert(data, x) end
if x then
for _ = 1, length do t_insert(data, x) end
end
end
-- record a new value