From deb3ad65d25d4c3167a3cbeca2ac19b5c45b0627 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Thu, 7 May 2026 13:02:34 -0600 Subject: Added plugin/add-on system Plugins live in plugins// with a manifest.json and a LabPlugin subclass. Enabled/disabled in Settings > Plugins tab; state persists in plugins/enabled.json and in .labdaq profiles (loading a profile enables/disables plugins to match). Plugins can contribute toolbar buttons, BaseDevice instances (auto-wired into acquisition pipeline), custom signal filter classes, a settings widget, and profile state via get_save_state/apply_save_state. Load errors now report the exact failing stage (file not found, class missing, on_load crash). Includes example plugin skeleton and docs/plugin-development.md. Co-Authored-By: Claude Sonnet 4.6 --- core/signal_processor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/signal_processor.py') diff --git a/core/signal_processor.py b/core/signal_processor.py index 417d142..723de66 100644 --- a/core/signal_processor.py +++ b/core/signal_processor.py @@ -185,6 +185,16 @@ def filter_from_dict(d: dict) -> FilterBase: return cls(**params) +def register_filter_class(name: str, cls) -> None: + """Register a plugin-provided filter class by type name.""" + FILTER_CLASSES[name] = cls + + +def unregister_filter_class(name: str) -> None: + """Remove a previously registered plugin filter class.""" + FILTER_CLASSES.pop(name, None) + + # ══════════════════════════════════════════════════════════════════════════════ # Derived channel definitions # ══════════════════════════════════════════════════════════════════════════════ -- cgit v1.2.3