- 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:
+1
-3
@@ -34,9 +34,7 @@ class GnssReader(QThread):
|
||||
chunk = self._transport.read(512)
|
||||
frames = self.packetizer.on_recv(chunk)
|
||||
res = extract_satellites(frames)
|
||||
if 'sat' in res:
|
||||
self.satellites_updated.emit(res)
|
||||
if 'dop' in res:
|
||||
if res:
|
||||
self.satellites_updated.emit(res)
|
||||
|
||||
except (serial.SerialException, OSError, ConnectionRefusedError,
|
||||
|
||||
+1
-16
@@ -228,22 +228,7 @@ class SinglePlotPanel(QWidget):
|
||||
h = self._history[key]
|
||||
color = CURVE_PALETTE[idx % len(CURVE_PALETTE)]
|
||||
active = h.get("active", True)
|
||||
|
||||
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
|
||||
pen = pg.mkPen(color=color, width=1, style=Qt.SolidLine)
|
||||
|
||||
if key not in self._curves:
|
||||
self._curves[key] = self._plot.plot(
|
||||
|
||||
@@ -174,11 +174,12 @@ def parse_nav_dop(payload: bytes) -> dict:
|
||||
return res
|
||||
|
||||
def extract_satellites(frames: list[dict]) -> dict:
|
||||
res = {}
|
||||
for f in frames:
|
||||
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:
|
||||
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:
|
||||
return {'dop': parse_nav_dop(f["payload"])}
|
||||
return {}
|
||||
res['dop'] = parse_nav_dop(f["payload"])
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user