summaryrefslogtreecommitdiff
path: root/core/profile.py
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2026-06-09 19:39:35 -0600
committerChristian Kolset <christian.kolset@gmail.com>2026-06-09 19:39:35 -0600
commitb776e70b4cd94c5d1f53dde39b2e46f6447cac3e (patch)
treefade07a8ecd7a771c095a4d636fa5570e1f8ee7c /core/profile.py
parent51f04ada503b02c598c9940c96fdc444cf5da52a (diff)
Motion capture: profile support, FPS config, persistent tracking, window state
Profile integration: - CameraDevice.get_save_config() serialises camera_index, simulate, resolution, fps — cameras now persist in .labdaq profiles - ProfileManager.register/unregister_device_factory() lets plugins register their device classes for profile restoration without core → plugin dependency - MotionCapturePlugin registers CameraDevice factory on load/unload Camera configuration: - Add Frame Rate combo to CameraPanel (Default/15/24/30/60/120 fps) defaults to 30 fps; flows through to CAP_PROP_FPS on connect - tracker.start() accepts fps param alongside existing resolution Tracking persistence: - CameraTracker.is_running() — checks thread alive state - MotionCaptureWindow initialises _connected from tracker.is_running() so reopening the window resumes the live feed without restarting the camera or losing the active tracking state Window state: - Plugin saves px_per_mm + camera_idx when window closes - Reopened window restores saved values and syncs mode/shape UI from tracker state via restore_ui_state() (signals blocked to avoid resetting tracker) - Window type changed to Qt.WindowType.Window for independent close button on all Linux WMs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'core/profile.py')
-rw-r--r--core/profile.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/profile.py b/core/profile.py
index fdd3a48..39cb3ca 100644
--- a/core/profile.py
+++ b/core/profile.py
@@ -131,6 +131,18 @@ class ProfileManager:
ProfileManager.apply(profile, registry, processor, ...)
"""
+ # Plugin device factories registered at runtime (device_type → class)
+ _extra_factories: dict = {}
+
+ @staticmethod
+ def register_device_factory(device_type: str, factory):
+ """Register a plugin device class so it can be restored from profiles."""
+ ProfileManager._extra_factories[device_type] = factory
+
+ @staticmethod
+ def unregister_device_factory(device_type: str):
+ ProfileManager._extra_factories.pop(device_type, None)
+
# ── Capture ──────────────────────────────────────────────────────────────
@staticmethod
@@ -234,7 +246,7 @@ class ProfileManager:
)
# ── Devices ──────────────────────────────────────────────────────
- _DEVICE_FACTORIES = {}
+ _DEVICE_FACTORIES = dict(ProfileManager._extra_factories)
try:
from devices.arduino_device import ArduinoDevice
_DEVICE_FACTORIES["arduino"] = ArduinoDevice