From 436c5424cfeb0d81f5e02177f2c0b3583ffc6e8a Mon Sep 17 00:00:00 2001 From: Leonardo Martinez <leonardo.martinez.hornak@fing.edu.uy> Date: Sat, 15 May 2021 14:19:03 -0300 Subject: [PATCH] AGC error with None values fixed --- software/smartwatch.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/software/smartwatch.py b/software/smartwatch.py index 4d1a133..87cda5f 100644 --- a/software/smartwatch.py +++ b/software/smartwatch.py @@ -12,8 +12,6 @@ from matplotlib.animation import FuncAnimation from types import SimpleNamespace from enum import Enum -import threading -import random from threading import Thread TIME_OUT = 0.5 #Time out used for refreshing the User Interface @@ -173,10 +171,11 @@ class Application(tk.Frame): maxValue = 0 minValue = 0 for p in copyOfChartQueue: - if p > maxValue: - maxValue = p - if p < minValue: - minValue = p + if(type(p) == int): + if p > maxValue: + maxValue = p + if p < minValue: + minValue = p self.ax.cla() @@ -207,12 +206,4 @@ if __name__ == '__main__': t.daemon = True t.start() - #Test thread (DELETE) - def work (): - threading.Timer(0.1, work).start() - guiRef.ppgQueue.put(random.randrange(-5,5)) - - - work() - app.mainloop() -- GitLab