Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d3f092ce989c
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9dcd43fb0dd9
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jun 11, 2016

  1. Copy the full SHA
    1faac10 View commit details
  2. Copy the full SHA
    ddd1c12 View commit details
  3. gui/scanwidget: use -inf/inf to represent absence of boundaries (cons…

    …istently with QDoubleSpinbox)
    sbourdeauducq committed Jun 11, 2016
    Copy the full SHA
    9dcd43f View commit details
Showing with 11 additions and 9 deletions.
  1. +2 −1 artiq/examples/master/repository/arguments_demo.py
  2. +4 −3 artiq/gui/entries.py
  3. +5 −5 artiq/gui/scanwidget.py
3 changes: 2 additions & 1 deletion artiq/examples/master/repository/arguments_demo.py
Original file line number Diff line number Diff line change
@@ -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")
7 changes: 4 additions & 3 deletions artiq/gui/entries.py
Original file line number Diff line number Diff line change
@@ -177,6 +177,10 @@ def apply_properties(widget):
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 @@ def update_npoints(value):
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):
10 changes: 5 additions & 5 deletions artiq/gui/scanwidget.py
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ def __init__(self):
qfm.lineSpacing())

self._start, self._stop, self._num = None, None, None
self._min, self._max = None, None
self._min, self._max = float("-inf"), float("inf")
self._axisView = None
self._offset, self._drag, self._rubber = None, None, None

@@ -71,10 +71,10 @@ def _setViewAxis(self, center, scale):
self._setView(left, scale)

def _clamp(self, v):
if self._min is not None:
v = max(self._min, v)
if self._max is not None:
v = min(self._max, v)
if v is None:
return None
v = max(self._min, v)
v = min(self._max, v)
return v

def setStart(self, val):