pytec: Stop using client report mode in plot.py #153

Merged
sb10q merged 1 commits from atse/thermostat:pytec-fix-plot into master 2024-11-18 13:57:54 +08:00
1 changed files with 4 additions and 1 deletions
Showing only changes of commit 2db7188ebc - Show all commits

View File

@ -1,3 +1,4 @@
import time
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib.animation as animation import matplotlib.animation as animation
@ -47,7 +48,8 @@ quit = False
def recv_data(tec): def recv_data(tec):
global last_packet_time global last_packet_time
for data in tec.report_mode(): while True:
data = tec.get_report()
ch0 = data[0] ch0 = data[0]
series_lock.acquire() series_lock.acquire()
try: try:
@ -61,6 +63,7 @@ def recv_data(tec):
if quit: if quit:
break break
time.sleep(0.05)
thread = Thread(target=recv_data, args=(tec,)) thread = Thread(target=recv_data, args=(tec,))
thread.start() thread.start()