mirror of https://github.com/m-labs/artiq.git
progress_bar: refactor data_changed
This commit is contained in:
parent
6c588b83d7
commit
068a2d1663
|
@ -12,12 +12,12 @@ class ProgressWidget(QtWidgets.QProgressBar):
|
||||||
self.setMaximum(args.max)
|
self.setMaximum(args.max)
|
||||||
self.dataset_value = args.value
|
self.dataset_value = args.value
|
||||||
|
|
||||||
def data_changed(self, data, mods):
|
def data_changed(self, value, metadata, persist, mods):
|
||||||
try:
|
try:
|
||||||
value = round(data[self.dataset_value][1])
|
val = round(value[self.dataset_value])
|
||||||
except (KeyError, ValueError, TypeError):
|
except (KeyError, ValueError, TypeError):
|
||||||
value = 0
|
val = 0
|
||||||
self.setValue(value)
|
self.setValue(val)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue