commit
e95d747b84
11
main.py
11
main.py
|
@ -52,12 +52,12 @@ exp_image_dict = {'41-65-93': 'A1', '87-152-13': 'A2', '213-109-81': 'A3', '23-2
|
||||||
|
|
||||||
|
|
||||||
class SerialManager:
|
class SerialManager:
|
||||||
p1Serial = serial.Serial(COM_PORT, COM_BAUDRATE)
|
|
||||||
settingPacket = bytearray([40, 0, 0, 0, 0, 41])
|
|
||||||
startUp = False
|
|
||||||
recvData = ""
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
self.p1Serial = serial.Serial(COM_PORT, COM_BAUDRATE)
|
||||||
|
self.settingPacket = bytearray([40, 0, 0, 0, 0, 41])
|
||||||
|
self.startUp = False
|
||||||
|
self.recvData = ""
|
||||||
|
|
||||||
self.touchQueue = queue.Queue()
|
self.touchQueue = queue.Queue()
|
||||||
self.data_lock = threading.Lock()
|
self.data_lock = threading.Lock()
|
||||||
self.touchThread = threading.Thread(target=self.touch_thread)
|
self.touchThread = threading.Thread(target=self.touch_thread)
|
||||||
|
@ -66,6 +66,7 @@ class SerialManager:
|
||||||
self.now_touch_keys = []
|
self.now_touch_keys = []
|
||||||
self.ping_touch_thread()
|
self.ping_touch_thread()
|
||||||
|
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
print(f"开始监听 {COM_PORT} 串口...")
|
print(f"开始监听 {COM_PORT} 串口...")
|
||||||
self.touchThread.start()
|
self.touchThread.start()
|
||||||
|
|
Loading…
Reference in New Issue