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: 1f5a49d263f3
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: 968760d48fac
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Aug 6, 2015

  1. Verified

    This commit was signed with the committer’s verified signature.
    makenowjust Hiroya Fujinami
    Copy the full SHA
    705ec6b View commit details
  2. Copy the full SHA
    e078dab View commit details
  3. Copy the full SHA
    968760d View commit details
Showing with 23 additions and 13 deletions.
  1. +11 −4 artiq/frontend/artiq_gui.py
  2. +4 −1 artiq/tools.py
  3. +8 −8 examples/master/repository/flopping_f_simulation.py
15 changes: 11 additions & 4 deletions artiq/frontend/artiq_gui.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

# Quamash must be imported first so that pyqtgraph picks up the Qt binding
# it has chosen.
from quamash import QEventLoop, QtGui
from quamash import QEventLoop, QtGui, QtCore
from pyqtgraph import dockarea

from artiq.tools import verbosity_args, init_logger
@@ -44,17 +44,23 @@ def get_argparser():
return parser


class _MainWindow(QtGui.QMainWindow):
class MainWindow(QtGui.QMainWindow):
def __init__(self, app):
QtGui.QMainWindow.__init__(self)
self.setWindowIcon(QtGui.QIcon(os.path.join(data_dir, "icon.png")))
self.resize(1400, 800)
#self.resize(1400, 800)
self.setWindowTitle("ARTIQ")
self.exit_request = asyncio.Event()

def closeEvent(self, *args):
self.exit_request.set()

def save_state(self):
return bytes(self.saveGeometry())

def restore_state(self, state):
self.restoreGeometry(QtCore.QByteArray(state))


def main():
args = get_argparser().parse_args()
@@ -72,9 +78,10 @@ def main():
args.server, args.port_control, "master_schedule"))
atexit.register(lambda: schedule_ctl.close_rpc())

win = _MainWindow(app)
win = MainWindow(app)
area = dockarea.DockArea()
smgr.register(area)
smgr.register(win)
win.setCentralWidget(area)
status_bar = QtGui.QStatusBar()
status_bar.showMessage("Connected to {}".format(args.server))
5 changes: 4 additions & 1 deletion artiq/tools.py
Original file line number Diff line number Diff line change
@@ -128,7 +128,10 @@ def start(self):
@asyncio.coroutine
def stop(self):
self.task.cancel()
yield from asyncio.wait([self.task])
try:
yield from asyncio.wait_for(self.task, None)
except asyncio.CancelledError:
pass
del self.task

@asyncio.coroutine
16 changes: 8 additions & 8 deletions examples/master/repository/flopping_f_simulation.py
Original file line number Diff line number Diff line change
@@ -37,16 +37,16 @@ def build(self):
self.attr_device("scheduler")

def run(self):
self.frequency = self.set_result("flopping_f_frequency", [],
realtime=True, store=False)
self.brightness = self.set_result("flopping_f_brightness", [],
realtime=True)
frequency = self.set_result("flopping_f_frequency", [],
realtime=True, store=False)
brightness = self.set_result("flopping_f_brightness", [],
realtime=True)
self.set_result("flopping_f_fit", [], realtime=True, store=False)

for frequency in self.frequency_scan:
brightness = model(frequency, self.F0) + self.noise_amplitude*random.random()
self.frequency.append(frequency)
self.brightness.append(brightness)
for f in self.frequency_scan:
m_brightness = model(f, self.F0) + self.noise_amplitude*random.random()
frequency.append(f)
brightness.append(m_brightness)
time.sleep(0.1)
self.scheduler.submit(self.scheduler.pipeline_name, self.scheduler.expid,
self.scheduler.priority, time.time() + 20, False)