2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-26 03:38:25 +08:00

big_number: refactor data_changed

This commit is contained in:
Simon Renblad 2023-07-12 12:03:29 +08:00 committed by Sébastien Bourdeauducq
parent 5695e9f77e
commit 25959d0cd6

View File

@ -61,9 +61,9 @@ class NumberWidget(QtWidgets.QStackedWidget):
def cancel_edit(self): def cancel_edit(self):
self.setCurrentWidget(self.lcd_widget) self.setCurrentWidget(self.lcd_widget)
def data_changed(self, data, mods): def data_changed(self, value, metadata, persist, mods):
try: try:
n = float(data[self.dataset_name][1]) n = float(value[self.dataset_name])
except (KeyError, ValueError, TypeError): except (KeyError, ValueError, TypeError):
n = "---" n = "---"
self.lcd_widget.display(n) self.lcd_widget.display(n)