- diabled active stuff

- refactored update of widgets
- fixed dop update
- fixed data not processed if sat and dop info available at the same time
This commit is contained in:
2026-05-20 19:45:03 +02:00
parent f3a3f9b5a3
commit 3ecc550029
3 changed files with 7 additions and 23 deletions
+1 -3
View File
@@ -34,9 +34,7 @@ class GnssReader(QThread):
chunk = self._transport.read(512) chunk = self._transport.read(512)
frames = self.packetizer.on_recv(chunk) frames = self.packetizer.on_recv(chunk)
res = extract_satellites(frames) res = extract_satellites(frames)
if 'sat' in res: if res:
self.satellites_updated.emit(res)
if 'dop' in res:
self.satellites_updated.emit(res) self.satellites_updated.emit(res)
except (serial.SerialException, OSError, ConnectionRefusedError, except (serial.SerialException, OSError, ConnectionRefusedError,
+1 -16
View File
@@ -228,22 +228,7 @@ class SinglePlotPanel(QWidget):
h = self._history[key] h = self._history[key]
color = CURVE_PALETTE[idx % len(CURVE_PALETTE)] color = CURVE_PALETTE[idx % len(CURVE_PALETTE)]
active = h.get("active", True) active = h.get("active", True)
pen = pg.mkPen(color=color, width=1, style=Qt.SolidLine)
if active:
pen = pg.mkPen(color=color, width=1, style=Qt.SolidLine)
else:
# Inaktiver SV: gestrichelte Linie bei y=0
pen = pg.mkPen(color=color, width=1, style=Qt.DashLine)
x_data = h["x"] if h["x"] else [datetime.now().timestamp()]
y_data = [0.0] * len(x_data)
if key in self._curves:
self._curves[key].setData(x_data, y_data)
self._curves[key].setPen(pen)
else:
self._curves[key] = self._plot.plot(
x_data, y_data, pen=pen, name=f"{key} (weg)"
)
continue
if key not in self._curves: if key not in self._curves:
self._curves[key] = self._plot.plot( self._curves[key] = self._plot.plot(
+5 -4
View File
@@ -174,11 +174,12 @@ def parse_nav_dop(payload: bytes) -> dict:
return res return res
def extract_satellites(frames: list[dict]) -> dict: def extract_satellites(frames: list[dict]) -> dict:
res = {}
for f in frames: for f in frames:
if f["cls"] == UBX_CLASS_NAV and f["id"] == UBX_ID_NAV_SAT: if f["cls"] == UBX_CLASS_NAV and f["id"] == UBX_ID_NAV_SAT:
return {'sat': parse_nav_sat(f["payload"])} res['sat'] = parse_nav_sat(f["payload"])
if f["cls"] == UBX_CLASS_NAV and f["id"] == UBX_ID_NAV_SVINFO: if f["cls"] == UBX_CLASS_NAV and f["id"] == UBX_ID_NAV_SVINFO:
return {'sat': parse_nav_svinfo(f["payload"])} res['sat'] = parse_nav_svinfo(f["payload"])
if f["cls"] == UBX_CLASS_NAV and f["id"] == UBX_ID_NAV_DOP: if f["cls"] == UBX_CLASS_NAV and f["id"] == UBX_ID_NAV_DOP:
return {'dop': parse_nav_dop(f["payload"])} res['dop'] = parse_nav_dop(f["payload"])
return {} return res