From 9d04b6e9d915f6ede2a8c58cad5de7e5f0ef71ce Mon Sep 17 00:00:00 2001 From: appel_c Date: Tue, 15 Apr 2025 20:59:58 +0200 Subject: [PATCH] wip: test avoid registering 2 callbacks --- bec_widgets/widgets/plots/waveform/waveform.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bec_widgets/widgets/plots/waveform/waveform.py b/bec_widgets/widgets/plots/waveform/waveform.py index d38fb049..1433ed57 100644 --- a/bec_widgets/widgets/plots/waveform/waveform.py +++ b/bec_widgets/widgets/plots/waveform/waveform.py @@ -1543,7 +1543,11 @@ class Waveform(PlotBase): Categorise the device curves into sync and async based on the readout priority. """ if self.scan_item is None: - self.update_with_scan_history(-1) + # If scan_item is None, than update_with_scan_history will call `_categorise_device_curves` via + # `_emit_signal_update`. All of this happens while old_scan_id is still set. So we actually register + # a callback twice for the same scan_id. This is a problem since data will be duplicated. + + # self.update_with_scan_history(-1) if self.scan_item is None: logger.info("No scan executed so far; skipping device curves categorisation.") return "none"