summaryrefslogtreecommitdiff
path: root/ui/main_window.py
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2026-05-07 13:42:30 -0600
committerChristian Kolset <christian.kolset@gmail.com>2026-06-03 09:50:17 -0600
commit8e5d0aec942fb9c49040fc525f0d697fd24d7c2f (patch)
treea9636db29be900698541441cb93b486b9a3c0acb /ui/main_window.py
parentdeb3ad65d25d4c3167a3cbeca2ac19b5c45b0627 (diff)
Added Motion Capture plugin
Tracks a user-selected point via webcam (OpenCV CSRT tracker) and streams x_pos / y_pos pixel coordinates as live channels into the acquisition pipeline. Falls back to a Lissajous figure simulation when opencv-python is not installed, so the plugin works immediately without hardware. - tracker.py: background thread, real camera + sim modes, thread-safe API - device.py: BaseDevice reading x/y from tracker, wires into engine - filter.py: custom pixel_to_mm filter (registered in FILTER_CLASSES) - window.py: floating tool window, live feed, click-to-track ROI selection - plugin.py: LabPlugin wiring all pieces together, toolbar button, settings widget, profile save/restore Also: PluginAction.button_ref_callback lets plugins store a ref to their toolbar button so they can uncheck it when their window closes. opencv-python install note added to requirements.txt. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'ui/main_window.py')
-rw-r--r--ui/main_window.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/main_window.py b/ui/main_window.py
index a4b62e9..4372b9f 100644
--- a/ui/main_window.py
+++ b/ui/main_window.py
@@ -245,6 +245,8 @@ class MainWindow(QMainWindow):
if pa.tooltip:
btn.setToolTip(pa.tooltip)
btn.clicked.connect(pa.callback)
+ if pa.button_ref_callback:
+ pa.button_ref_callback(btn)
action = self._toolbar.insertWidget(self._spacer_action, btn)
tb_actions.append(action)
self._plugin_toolbar_actions[plugin.plugin_id] = tb_actions