forked from M-Labs/artiq
1
0
Fork 0

entries: rename ndecimals to precision

This commit is contained in:
Simon Renblad 2023-07-18 10:19:09 +08:00 committed by Sébastien Bourdeauducq
parent 0befadee96
commit a0094aafbb
1 changed files with 5 additions and 5 deletions

View File

@ -120,7 +120,7 @@ class NumberEntryFloat(ScientificSpinBox):
disable_scroll_wheel(self) disable_scroll_wheel(self)
procdesc = argument["desc"] procdesc = argument["desc"]
scale = procdesc["scale"] scale = procdesc["scale"]
self.setDecimals(procdesc["ndecimals"]) self.setDecimals(procdesc["precision"])
self.setPrecision() self.setPrecision()
self.setSingleStep(procdesc["step"]/scale) self.setSingleStep(procdesc["step"]/scale)
self.setRelativeStep() self.setRelativeStep()
@ -159,7 +159,7 @@ class _NoScan(LayoutWidget):
scale = procdesc["scale"] scale = procdesc["scale"]
self.value = ScientificSpinBox() self.value = ScientificSpinBox()
disable_scroll_wheel(self.value) disable_scroll_wheel(self.value)
self.value.setDecimals(procdesc["ndecimals"]) self.value.setDecimals(procdesc["precision"])
self.value.setPrecision() self.value.setPrecision()
if procdesc["global_min"] is not None: if procdesc["global_min"] is not None:
self.value.setMinimum(procdesc["global_min"]/scale) self.value.setMinimum(procdesc["global_min"]/scale)
@ -202,7 +202,7 @@ class _RangeScan(LayoutWidget):
scale = procdesc["scale"] scale = procdesc["scale"]
def apply_properties(widget): def apply_properties(widget):
widget.setDecimals(procdesc["ndecimals"]) widget.setDecimals(procdesc["precision"])
if procdesc["global_min"] is not None: if procdesc["global_min"] is not None:
widget.setMinimum(procdesc["global_min"]/scale) widget.setMinimum(procdesc["global_min"]/scale)
else: else:
@ -293,7 +293,7 @@ class _CenterScan(LayoutWidget):
scale = procdesc["scale"] scale = procdesc["scale"]
def apply_properties(widget): def apply_properties(widget):
widget.setDecimals(procdesc["ndecimals"]) widget.setDecimals(procdesc["precision"])
if procdesc["global_min"] is not None: if procdesc["global_min"] is not None:
widget.setMinimum(procdesc["global_min"]/scale) widget.setMinimum(procdesc["global_min"]/scale)
else: else:
@ -469,7 +469,7 @@ class ScanEntry(LayoutWidget):
def procdesc_to_entry(procdesc): def procdesc_to_entry(procdesc):
ty = procdesc["ty"] ty = procdesc["ty"]
if ty == "NumberValue": if ty == "NumberValue":
is_int = (procdesc["ndecimals"] == 0 is_int = (procdesc["precision"] == 0
and int(procdesc["step"]) == procdesc["step"] and int(procdesc["step"]) == procdesc["step"]
and procdesc["scale"] == 1) and procdesc["scale"] == 1)
if is_int: if is_int: