From de539a4d33d79bd4164d54994af8a81dd90779af Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Mon, 19 Feb 2024 10:33:02 +0800 Subject: [PATCH] waveform: remove None cursor label --- artiq/dashboard/waveform.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/artiq/dashboard/waveform.py b/artiq/dashboard/waveform.py index b34dae6d0..6b9f1e99d 100644 --- a/artiq/dashboard/waveform.py +++ b/artiq/dashboard/waveform.py @@ -278,7 +278,10 @@ class BitWaveform(_BaseWaveform): def onCursorMove(self, x): _BaseWaveform.onCursorMove(self, x) - self.cursor_label.setText(self.cursor_y) + if self.cursor_y is not None: + self.cursor_label.setText(self.cursor_y) + else: + self.cursor_label.setText("") class AnalogWaveform(_BaseWaveform): @@ -299,9 +302,10 @@ class AnalogWaveform(_BaseWaveform): def onCursorMove(self, x): _BaseWaveform.onCursorMove(self, x) - t = None if self.cursor_y is not None: t = self._format_string.format(self.cursor_y) + else: + t = "" self.cursor_label.setText(t) @@ -356,9 +360,10 @@ class BitVectorWaveform(_BaseWaveform): def onCursorMove(self, x): _BaseWaveform.onCursorMove(self, x) - t = None if self.cursor_y is not None: t = self._format_string.format(int(self.cursor_y, 2)) + else: + t = "" self.cursor_label.setText(t)