summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/__pycache__/acquisition.cpython-312.pycbin11417 -> 11456 bytes
-rw-r--r--core/__pycache__/signal_processor.cpython-312.pycbin23682 -> 24525 bytes
-rw-r--r--core/acquisition.py2
-rw-r--r--core/signal_processor.py13
4 files changed, 14 insertions, 1 deletions
diff --git a/core/__pycache__/acquisition.cpython-312.pyc b/core/__pycache__/acquisition.cpython-312.pyc
index c593432..cb5f3f3 100644
--- a/core/__pycache__/acquisition.cpython-312.pyc
+++ b/core/__pycache__/acquisition.cpython-312.pyc
Binary files differ
diff --git a/core/__pycache__/signal_processor.cpython-312.pyc b/core/__pycache__/signal_processor.cpython-312.pyc
index e914490..4572e55 100644
--- a/core/__pycache__/signal_processor.cpython-312.pyc
+++ b/core/__pycache__/signal_processor.cpython-312.pyc
Binary files 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)