From ae0d593139d11aad3e44b4c4c34854a7a7cfa3a7 Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 18 Nov 2024 11:52:58 +0800 Subject: [PATCH] pytec: Stop using client report mode in plot.py Report mode has been removed from the client, stop using it. --- pytec/plot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pytec/plot.py b/pytec/plot.py index 4a1e6da..90deaca 100644 --- a/pytec/plot.py +++ b/pytec/plot.py @@ -1,3 +1,4 @@ +import time import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation @@ -47,7 +48,8 @@ quit = False def recv_data(tec): global last_packet_time - for data in tec.report_mode(): + while True: + data = tec.get_report() ch0 = data[0] series_lock.acquire() try: @@ -61,6 +63,7 @@ def recv_data(tec): if quit: break + time.sleep(0.05) thread = Thread(target=recv_data, args=(tec,)) thread.start()