diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2026-04-23 10:52:37 -0600 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2026-04-23 10:52:37 -0600 |
| commit | 4244e5d97da0273fed70f734a4cfe822bd15c9cb (patch) | |
| tree | 225943bad9854f5ee08ac8f0c122e1b42a6525b6 /core/signal_processor.py | |
| parent | 99445c6fd2fd4f15df828c79600b96b80fa1cfa6 (diff) | |
Fixed clear signal feature to inlcude all signals
Diffstat (limited to 'core/signal_processor.py')
| -rw-r--r-- | core/signal_processor.py | 13 |
1 files changed, 13 insertions, 0 deletions
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) |
