From 99445c6fd2fd4f15df828c79600b96b80fa1cfa6 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Wed, 22 Apr 2026 14:50:13 -0600 Subject: Added derived signal to be sources of other derived signals. Fixed derived signal saving profile. Renamed Signals>Pipeline to Signas>Channels and adding/removing channels feature. --- core/profile.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'core/profile.py') diff --git a/core/profile.py b/core/profile.py index 2a70370..ef8c55b 100644 --- a/core/profile.py +++ b/core/profile.py @@ -231,6 +231,16 @@ class ProfileManager: except Exception: pass + # Clear all existing devices — profile defines the complete device set + for dev in list(registry.all_instances()): + try: + dev.disconnect() + except Exception: + pass + registry.remove_instance(dev.info.device_id) + if engine is not None: + engine.remove_device(dev.info.device_id) + for dev_cfg in profile.devices: dev_type = dev_cfg.get("device_type") dev_id = dev_cfg.get("device_id") @@ -241,17 +251,6 @@ class ProfileManager: print(f"[Profile] Unknown device type: {dev_type}") continue try: - # Replace existing device so saved config takes effect - existing = registry.get_instance(dev_id) - if existing is not None: - try: - existing.disconnect() - except Exception: - pass - registry.remove_instance(dev_id) - if engine is not None: - engine.remove_device(dev_id) - kwargs = {k: v for k, v in dev_cfg.items() if k != "device_type"} dev = factory(**kwargs) registry.add_instance(dev) -- cgit v1.2.3