refactor: standardize codebase formatting, optimize import orders, and update GUI resolution to 1080p
This commit is contained in:
@@ -6,7 +6,6 @@ QML via @Slot methods on a QObject controller.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import serial.tools.list_ports
|
||||
@@ -42,8 +41,8 @@ class DeviceService:
|
||||
|
||||
# On macOS/Linux, also detect virtual loopback serial ports (PTYs) opened by socat
|
||||
import platform
|
||||
import subprocess
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
if platform.system() in ("Darwin", "Linux"):
|
||||
try:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Continuous serial frame reader (Live-mode source)"""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import threading
|
||||
import time
|
||||
@@ -13,7 +14,7 @@ log = logging.getLogger(__name__)
|
||||
ParseFrame = Callable[[bytes, int], Frame]
|
||||
|
||||
class StreamReader:
|
||||
|
||||
|
||||
def __init__(self, transport, parse_frame: ParseFrame,
|
||||
on_frame: Callable[[Frame], None],
|
||||
on_error: Callable[[Exception], None] | None = None,
|
||||
@@ -26,7 +27,7 @@ class StreamReader:
|
||||
self._thread: threading.Thread | None = None
|
||||
self._stop = threading.Event()
|
||||
self.error_count = 0
|
||||
|
||||
|
||||
def start(self) -> None:
|
||||
self._stop.clear()
|
||||
self._thread = threading.Thread(target=self._run, daemon = True)
|
||||
|
||||
Reference in New Issue
Block a user