From ddd1c128526c1c37a5090a2fe499e1152f181dcd Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 11 Jun 2016 16:50:16 -0600 Subject: [PATCH] gui/entries/_RangeScan: set range before setting value. Fixes clamping to 99.99 --- artiq/examples/master/repository/arguments_demo.py | 3 ++- artiq/gui/entries.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/artiq/examples/master/repository/arguments_demo.py b/artiq/examples/master/repository/arguments_demo.py index 8c6370d56..1b48c0727 100644 --- a/artiq/examples/master/repository/arguments_demo.py +++ b/artiq/examples/master/repository/arguments_demo.py @@ -22,7 +22,8 @@ class SubComponent2(HasEnvironment): def build(self): self.setattr_argument("sc2_boolean", BooleanValue(False), "Transporter") - self.setattr_argument("sc2_scan", Scannable(default=NoScan(325)), + self.setattr_argument("sc2_scan", Scannable( + default=LinearScan(200, 300, 49)), "Transporter") self.setattr_argument("sc2_enum", EnumerationValue(["3", "4", "5"]), "Transporter") diff --git a/artiq/gui/entries.py b/artiq/gui/entries.py index dc065e111..4927b0751 100644 --- a/artiq/gui/entries.py +++ b/artiq/gui/entries.py @@ -177,6 +177,10 @@ class _RangeScan(LayoutWidget): disable_scroll_wheel(stop) self.addWidget(stop, 2, 1) + apply_properties(start) + apply_properties(stop) + apply_properties(scanner) + def update_start(value): state["start"] = value*scale scanner.setStart(value) @@ -198,9 +202,6 @@ class _RangeScan(LayoutWidget): scanner.setStart(state["start"]/scale) scanner.setNum(state["npoints"]) scanner.setStop(state["stop"]/scale) - apply_properties(start) - apply_properties(stop) - apply_properties(scanner) class _ExplicitScan(LayoutWidget):