summaryrefslogtreecommitdiff
path: root/plugins/motion_capture/window.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/motion_capture/window.py')
-rw-r--r--plugins/motion_capture/window.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/plugins/motion_capture/window.py b/plugins/motion_capture/window.py
index bc9a0de..46b8850 100644
--- a/plugins/motion_capture/window.py
+++ b/plugins/motion_capture/window.py
@@ -245,10 +245,9 @@ class MotionCaptureWindow(QWidget):
closed = pyqtSignal()
def __init__(self, tracker, parent=None):
- super().__init__(parent, Qt.WindowType.Window | Qt.WindowType.Tool)
+ super().__init__(parent, Qt.WindowType.Window)
self._tracker = tracker
- self._connected = False
- self._selecting = False # True while frame is frozen for selection
+ self._selecting = False
self.setWindowTitle("Motion Capture")
self.setMinimumSize(680, 560)
@@ -256,6 +255,11 @@ class MotionCaptureWindow(QWidget):
self._build()
+ # Reflect tracker's actual state — it may already be running
+ self._connected = tracker.is_running()
+ self._sim_badge.setVisible(self._connected and tracker.simulated)
+ self._sync_controls()
+
self._refresh = QTimer(self)
self._refresh.timeout.connect(self._update)
self._refresh.start(33)
@@ -500,6 +504,19 @@ class MotionCaptureWindow(QWidget):
# ── State accessors ────────────────────────────────────────────────────
+ def restore_ui_state(self, mode: str, shape: str):
+ """Sync mode/shape UI to tracker state without triggering tracker resets."""
+ self._mode_cb.blockSignals(True)
+ self._shape_cb.blockSignals(True)
+ self._mode_cb.setCurrentIndex(1 if mode == "csrt" else 0)
+ self._shape_cb.setCurrentIndex(1 if shape == "circle" else 0)
+ is_template = mode == "template"
+ self._shape_lbl.setVisible(is_template)
+ self._shape_cb.setVisible(is_template)
+ self._mode_cb.blockSignals(False)
+ self._shape_cb.blockSignals(False)
+ self._feed.set_shape(shape)
+
def get_camera_index(self) -> int:
i = self._cam_combo.currentIndex()
cameras = getattr(self, "_cameras", [])