forked from M-Labs/artiq
big_number: refactor data_changed
This commit is contained in:
parent
5695e9f77e
commit
25959d0cd6
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue