sky tab: extend trail storage to 24h, add visible trail depth spinbox
Trail history increased from 1h to 24h (86400 points). Added a spinbox (0-24h, default 1h) next to 'Show Trails' to control how much trail is rendered; spinbox is disabled when trails are off. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+18
-4
@@ -10,7 +10,7 @@ for _p in [_root, _gui]:
|
||||
from PyQt5.QtWidgets import (
|
||||
QWidget, QHBoxLayout, QVBoxLayout, QLabel, QListWidget,
|
||||
QListWidgetItem, QTableWidget, QTableWidgetItem, QHeaderView,
|
||||
QSplitter, QGroupBox, QFrame, QCheckBox,
|
||||
QSplitter, QGroupBox, QFrame, QCheckBox, QSpinBox,
|
||||
)
|
||||
from PyQt5.QtCore import Qt, QTimer
|
||||
from PyQt5.QtGui import QColor, QBrush
|
||||
@@ -19,7 +19,8 @@ from data_model import ReceiverManager, GNSS_NAMES, GNSS_COLORS
|
||||
from sky_widget import SkyPlotWidget
|
||||
|
||||
_COL_HEADERS = ['GNSS', 'SV', 'Elev °', 'Az °', 'C/N₀', 'Fix', 'Receiver']
|
||||
_TRAIL_MAXLEN = 3600 # 1 hour at 1 Hz
|
||||
_TRAIL_MAXLEN = 86400 # 24 hours at 1 Hz
|
||||
_TRAIL_MAX_HOURS = 24
|
||||
|
||||
|
||||
class SkyTab(QWidget):
|
||||
@@ -54,6 +55,15 @@ class SkyTab(QWidget):
|
||||
self._trail_cb.setChecked(False)
|
||||
self._trail_cb.toggled.connect(self._on_trail_toggled)
|
||||
src_bl.addWidget(self._trail_cb)
|
||||
|
||||
self._trail_spin = QSpinBox()
|
||||
self._trail_spin.setRange(0, _TRAIL_MAX_HOURS)
|
||||
self._trail_spin.setValue(1)
|
||||
self._trail_spin.setSuffix(" h")
|
||||
self._trail_spin.setFixedWidth(58)
|
||||
self._trail_spin.setEnabled(False)
|
||||
self._trail_spin.valueChanged.connect(self._on_trail_toggled)
|
||||
src_bl.addWidget(self._trail_spin)
|
||||
outer.addWidget(src_box)
|
||||
|
||||
# ── Info bar (one card per receiver) ──────────────────────────────────
|
||||
@@ -154,14 +164,18 @@ class SkyTab(QWidget):
|
||||
def _active_trails(self) -> dict:
|
||||
if not self._trail_cb.isChecked():
|
||||
return {}
|
||||
n_points = self._trail_spin.value() * 3600
|
||||
if n_points == 0:
|
||||
return {}
|
||||
selected = self._selected_rids()
|
||||
return {key: list(dq)
|
||||
return {key: list(dq)[-n_points:]
|
||||
for key, dq in self._trail.items()
|
||||
if key[0] in selected}
|
||||
|
||||
# ── Trail toggle ──────────────────────────────────────────────────────────
|
||||
|
||||
def _on_trail_toggled(self, _checked: bool):
|
||||
def _on_trail_toggled(self, _value=None):
|
||||
self._trail_spin.setEnabled(self._trail_cb.isChecked())
|
||||
self._sky.update_data(self._visible_sats(), self._active_trails())
|
||||
|
||||
# ── Info bar ──────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user