forked from M-Labs/artiq
1
0
Fork 0

gui/scan: enforce min <= max

This commit is contained in:
Sebastien Bourdeauducq 2015-08-22 21:05:24 +08:00
parent 21a28a13c9
commit 284e3ddb2b
1 changed files with 6 additions and 2 deletions

View File

@ -40,9 +40,13 @@ class _Range(LayoutWidget):
force_spinbox_value(self.npoints, npoints) force_spinbox_value(self.npoints, npoints)
def get_values(self): 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 { return {
"min": self.min.value(), "min": min,
"max": self.max.value(), "max": max,
"npoints": self.npoints.value() "npoints": self.npoints.value()
} }