From 284e3ddb2b5e19eef2cffb0b671aae0b7bb2582f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 22 Aug 2015 21:05:24 +0800 Subject: [PATCH] gui/scan: enforce min <= max --- artiq/gui/scan.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/artiq/gui/scan.py b/artiq/gui/scan.py index ee97a1401..ea34cf8d3 100644 --- a/artiq/gui/scan.py +++ b/artiq/gui/scan.py @@ -40,9 +40,13 @@ class _Range(LayoutWidget): force_spinbox_value(self.npoints, npoints) def get_values(self): + min = self.min.value() + max = self.max.value() + if min > max: + raise ValueError("Minimum scan boundary must be less than maximum") return { - "min": self.min.value(), - "max": self.max.value(), + "min": min, + "max": max, "npoints": self.npoints.value() }