forked from M-Labs/artiq
1
0
Fork 0

waveform: remove None cursor label

This commit is contained in:
Simon Renblad 2024-02-19 10:33:02 +08:00 committed by Sébastien Bourdeauducq
parent 1749fa661f
commit de539a4d33
1 changed files with 8 additions and 3 deletions

View File

@ -278,7 +278,10 @@ class BitWaveform(_BaseWaveform):
def onCursorMove(self, x):
_BaseWaveform.onCursorMove(self, x)
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)