From 4244e5d97da0273fed70f734a4cfe822bd15c9cb Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Thu, 23 Apr 2026 10:52:37 -0600 Subject: Fixed clear signal feature to inlcude all signals --- core/__pycache__/acquisition.cpython-312.pyc | Bin 11417 -> 11456 bytes core/__pycache__/signal_processor.cpython-312.pyc | Bin 23682 -> 24525 bytes core/acquisition.py | 2 +- core/signal_processor.py | 13 +++++++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/__pycache__/acquisition.cpython-312.pyc b/core/__pycache__/acquisition.cpython-312.pyc index c593432..cb5f3f3 100644 Binary files a/core/__pycache__/acquisition.cpython-312.pyc and b/core/__pycache__/acquisition.cpython-312.pyc differ diff --git a/core/__pycache__/signal_processor.cpython-312.pyc b/core/__pycache__/signal_processor.cpython-312.pyc index e914490..4572e55 100644 Binary files a/core/__pycache__/signal_processor.cpython-312.pyc and b/core/__pycache__/signal_processor.cpython-312.pyc differ diff --git a/core/acquisition.py b/core/acquisition.py index 57fda7e..a984c71 100644 --- a/core/acquisition.py +++ b/core/acquisition.py @@ -176,7 +176,7 @@ class AcquisitionEngine(QObject): for ch in dev.info.channels: val = readings.get(ch.channel_id) - if val is None: + if val is None or not ch.enabled: log_row.append("") continue buf = self._buffers.get(dev.info.device_id, {}).get(ch.channel_id) diff --git a/core/signal_processor.py b/core/signal_processor.py index 0d4ed39..417d142 100644 --- a/core/signal_processor.py +++ b/core/signal_processor.py @@ -359,6 +359,14 @@ class SignalProcessor(QObject): def all_virtual_channel_ids(self) -> List[str]: return list(self._derived_bufs.keys()) + def clear_history(self): + """Clear derived channel buffers and latest-value cache.""" + with self._lock: + for t_buf, v_buf in self._derived_bufs.values(): + t_buf.clear() + v_buf.clear() + self._latest.clear() + # ── Main data path ──────────────────────────────────────────────────── def on_raw_data(self, device_id: str, channel_id: str, @@ -401,6 +409,11 @@ class SignalProcessor(QObject): try: result = self._compute_derived(dc, inputs, timestamp, latest) if result is not None: + # Write back into local snapshot so downstream derived + # channels that depend on this one can see it this pass + latest[("derived", dc.channel_id)] = (timestamp, result) + with self._lock: + self._latest[("derived", dc.channel_id)] = (timestamp, result) bufs = self._derived_bufs.get(dc.channel_id) if bufs: bufs[0].append(timestamp) -- cgit v1.2.3