From b6721ae9f395ca89b3cb6acf95563d12f7399675 Mon Sep 17 00:00:00 2001 From: Bryce W <58643544+02bwilson@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:01:07 -0400 Subject: [PATCH] Added time scale factor. v1.0 done. --- DataManager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DataManager.py b/DataManager.py index f1cf077..3f7343b 100644 --- a/DataManager.py +++ b/DataManager.py @@ -7,6 +7,8 @@ class DataManager(QThread): + _TIME_SCALE_FACTOR = 1.0 + _IIR_ALPHA = .999 _SAMPLE_RATE = 64 @@ -73,7 +75,7 @@ def gatherData(self): now = time.time() curVal = 1 for fn in self.functions.values(): - curVal = eval(str(curVal) + fn[0] + str(fn[1](now))) + curVal = eval(str(curVal) + fn[0] + str(fn[1](now * self._TIME_SCALE_FACTOR))) if len(self.dataList[0]) == 4 * self._SAMPLE_RATE: self.dataList[0].pop(0) self.timeList.pop(0)