From a0094aafbbd68820ffbdb1bc87e59180b6d67701 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Tue, 18 Jul 2023 10:19:09 +0800 Subject: [PATCH] entries: rename ndecimals to precision --- artiq/gui/entries.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/artiq/gui/entries.py b/artiq/gui/entries.py index d3d0ff8fb..34468930e 100644 --- a/artiq/gui/entries.py +++ b/artiq/gui/entries.py @@ -120,7 +120,7 @@ class NumberEntryFloat(ScientificSpinBox): disable_scroll_wheel(self) procdesc = argument["desc"] scale = procdesc["scale"] - self.setDecimals(procdesc["ndecimals"]) + self.setDecimals(procdesc["precision"]) self.setPrecision() self.setSingleStep(procdesc["step"]/scale) self.setRelativeStep() @@ -159,7 +159,7 @@ class _NoScan(LayoutWidget): scale = procdesc["scale"] self.value = ScientificSpinBox() disable_scroll_wheel(self.value) - self.value.setDecimals(procdesc["ndecimals"]) + self.value.setDecimals(procdesc["precision"]) self.value.setPrecision() if procdesc["global_min"] is not None: self.value.setMinimum(procdesc["global_min"]/scale) @@ -202,7 +202,7 @@ class _RangeScan(LayoutWidget): scale = procdesc["scale"] def apply_properties(widget): - widget.setDecimals(procdesc["ndecimals"]) + widget.setDecimals(procdesc["precision"]) if procdesc["global_min"] is not None: widget.setMinimum(procdesc["global_min"]/scale) else: @@ -293,7 +293,7 @@ class _CenterScan(LayoutWidget): scale = procdesc["scale"] def apply_properties(widget): - widget.setDecimals(procdesc["ndecimals"]) + widget.setDecimals(procdesc["precision"]) if procdesc["global_min"] is not None: widget.setMinimum(procdesc["global_min"]/scale) else: @@ -469,7 +469,7 @@ class ScanEntry(LayoutWidget): def procdesc_to_entry(procdesc): ty = procdesc["ty"] if ty == "NumberValue": - is_int = (procdesc["ndecimals"] == 0 + is_int = (procdesc["precision"] == 0 and int(procdesc["step"]) == procdesc["step"] and procdesc["scale"] == 1) if is_int: