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: df16a1da730f
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: d30fe60edda1
Choose a head ref
  • 2 commits
  • 12 files changed
  • 1 contributor

Commits on Feb 14, 2016

  1. Copy the full SHA
    3ab35f7 View commit details
  2. gui: remove pyqtgraph

    sbourdeauducq committed Feb 14, 2016
    Copy the full SHA
    d30fe60 View commit details
Showing with 218 additions and 209 deletions.
  1. +6 −6 artiq/frontend/artiq_gui.py
  2. +13 −13 artiq/gui/applets.py
  3. +9 −8 artiq/gui/datasets.py
  4. +26 −27 artiq/gui/entries.py
  5. +44 −45 artiq/gui/experiments.py
  6. +37 −37 artiq/gui/explorer.py
  7. +20 −20 artiq/gui/log.py
  8. +1 −1 artiq/gui/models.py
  9. +25 −25 artiq/gui/moninj.py
  10. +10 −11 artiq/gui/schedule.py
  11. +17 −16 artiq/gui/shortcuts.py
  12. +10 −0 artiq/gui/tools.py
12 changes: 6 additions & 6 deletions artiq/frontend/artiq_gui.py
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@
import atexit
import os

import PyQt5
from quamash import QEventLoop, QtGui, QtCore, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets
from quamash import QEventLoop

from artiq import __artiq_dir__ as artiq_dir
from artiq.tools import *
@@ -34,9 +34,9 @@ def get_argparser():
return parser


class MainWindow(QtGui.QMainWindow):
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, server):
QtGui.QMainWindow.__init__(self)
QtWidgets.QMainWindow.__init__(self)
icon = QtGui.QIcon(os.path.join(artiq_dir, "gui", "icon.png"))
self.setWindowIcon(icon)
self.setWindowTitle("ARTIQ - {}".format(server))
@@ -61,7 +61,7 @@ def main():
args = get_argparser().parse_args()
init_logger(args)

app = QtGui.QApplication([])
app = QtWidgets.QApplication([])
loop = QEventLoop(app)
asyncio.set_event_loop(loop)
atexit.register(loop.close)
@@ -90,7 +90,7 @@ def main():
# initialize main window
main_window = MainWindow(args.server)
smgr.register(main_window)
status_bar = QtGui.QStatusBar()
status_bar = QtWidgets.QStatusBar()
status_bar.showMessage("Connected to {}".format(args.server))
main_window.setStatusBar(status_bar)

26 changes: 13 additions & 13 deletions artiq/gui/applets.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import shlex
from functools import partial

from quamash import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets

from artiq.protocols.pipe_ipc import AsyncioParentComm
from artiq.protocols import pyon
@@ -195,35 +195,35 @@ def __init__(self, main_window, datasets_sub):

self.table = QtWidgets.QTableWidget(0, 3)
self.table.setHorizontalHeaderLabels(["Enable", "Name", "Command"])
self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.table.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
self.table.horizontalHeader().setStretchLastSection(True)
self.table.horizontalHeader().setResizeMode(
QtGui.QHeaderView.ResizeToContents)
self.table.verticalHeader().setResizeMode(
QtGui.QHeaderView.ResizeToContents)
self.table.horizontalHeader().setSectionResizeMode(
QtWidgets.QHeaderView.ResizeToContents)
self.table.verticalHeader().setSectionResizeMode(
QtWidgets.QHeaderView.ResizeToContents)
self.table.verticalHeader().hide()
self.table.setTextElideMode(QtCore.Qt.ElideNone)
self.setWidget(self.table)

self.table.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
new_action = QtGui.QAction("New applet", self.table)
new_action = QtWidgets.QAction("New applet", self.table)
new_action.triggered.connect(self.new)
self.table.addAction(new_action)
templates_menu = QtGui.QMenu()
templates_menu = QtWidgets.QMenu()
for name, template in _templates:
action = QtGui.QAction(name, self.table)
action = QtWidgets.QAction(name, self.table)
action.triggered.connect(partial(self.new_template, template))
templates_menu.addAction(action)
restart_action = QtGui.QAction("New applet from template", self.table)
restart_action = QtWidgets.QAction("New applet from template", self.table)
restart_action.setMenu(templates_menu)
self.table.addAction(restart_action)
restart_action = QtGui.QAction("Restart selected applet", self.table)
restart_action = QtWidgets.QAction("Restart selected applet", self.table)
restart_action.setShortcut("CTRL+R")
restart_action.setShortcutContext(QtCore.Qt.WidgetShortcut)
restart_action.triggered.connect(self.restart)
self.table.addAction(restart_action)
delete_action = QtGui.QAction("Delete selected applet", self.table)
delete_action = QtWidgets.QAction("Delete selected applet", self.table)
delete_action.setShortcut("DELETE")
delete_action.setShortcutContext(QtCore.Qt.WidgetShortcut)
delete_action.triggered.connect(self.delete)
17 changes: 9 additions & 8 deletions artiq/gui/datasets.py
Original file line number Diff line number Diff line change
@@ -3,10 +3,10 @@
from functools import partial
import logging

from quamash import QtGui, QtCore, QtWidgets
from pyqtgraph import LayoutWidget
from PyQt5 import QtCore, QtWidgets

from artiq.tools import short_format
from artiq.gui.tools import LayoutWidget
from artiq.gui.models import DictSyncTreeSepModel


@@ -39,19 +39,20 @@ def __init__(self, datasets_sub, dataset_ctl):
grid = LayoutWidget()
self.setWidget(grid)

self.search = QtGui.QLineEdit()
self.search = QtWidgets.QLineEdit()
self.search.setPlaceholderText("search...")
self.search.editingFinished.connect(self._search_datasets)
grid.addWidget(self.search, 0, 0)

self.table = QtGui.QTreeView()
self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
self.table.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.table = QtWidgets.QTreeView()
self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.table.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
self.table.header().setSectionResizeMode(
QtWidgets.QHeaderView.ResizeToContents)
grid.addWidget(self.table, 1, 0)

self.table.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
delete_action = QtGui.QAction("Delete dataset", self.table)
delete_action = QtWidgets.QAction("Delete dataset", self.table)
delete_action.triggered.connect(self.delete_clicked)
delete_action.setShortcut("DELETE")
delete_action.setShortcutContext(QtCore.Qt.WidgetShortcut)
53 changes: 26 additions & 27 deletions artiq/gui/entries.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import logging
from collections import OrderedDict

from quamash import QtGui, QtCore
from pyqtgraph import LayoutWidget
from PyQt5 import QtCore, QtGui, QtWidgets

from artiq.gui.tools import disable_scroll_wheel
from artiq.gui.tools import LayoutWidget, disable_scroll_wheel


logger = logging.getLogger(__name__)


class _StringEntry(QtGui.QLineEdit):
class _StringEntry(QtWidgets.QLineEdit):
def __init__(self, argument):
QtGui.QLineEdit.__init__(self)
QtWidgets.QLineEdit.__init__(self)
self.setText(argument["state"])
def update(text):
argument["state"] = text
@@ -27,9 +26,9 @@ def default_state(procdesc):
return procdesc.get("default", "")


class _BooleanEntry(QtGui.QCheckBox):
class _BooleanEntry(QtWidgets.QCheckBox):
def __init__(self, argument):
QtGui.QCheckBox.__init__(self)
QtWidgets.QCheckBox.__init__(self)
self.setChecked(argument["state"])
def update(checked):
argument["state"] = bool(checked)
@@ -44,9 +43,9 @@ def default_state(procdesc):
return procdesc.get("default", False)


class _EnumerationEntry(QtGui.QComboBox):
class _EnumerationEntry(QtWidgets.QComboBox):
def __init__(self, argument):
QtGui.QComboBox.__init__(self)
QtWidgets.QComboBox.__init__(self)
disable_scroll_wheel(self)
choices = argument["desc"]["choices"]
self.addItems(choices)
@@ -68,9 +67,9 @@ def default_state(procdesc):
return procdesc["choices"][0]


class _NumberEntry(QtGui.QDoubleSpinBox):
class _NumberEntry(QtWidgets.QDoubleSpinBox):
def __init__(self, argument):
QtGui.QDoubleSpinBox.__init__(self)
QtWidgets.QDoubleSpinBox.__init__(self)
disable_scroll_wheel(self)
procdesc = argument["desc"]
scale = procdesc["scale"]
@@ -109,7 +108,7 @@ def __init__(self, procdesc, state):
LayoutWidget.__init__(self)

scale = procdesc["scale"]
self.value = QtGui.QDoubleSpinBox()
self.value = QtWidgets.QDoubleSpinBox()
disable_scroll_wheel(self.value)
self.value.setDecimals(procdesc["ndecimals"])
if procdesc["global_min"] is not None:
@@ -123,7 +122,7 @@ def __init__(self, procdesc, state):
self.value.setSingleStep(procdesc["global_step"]/scale)
if procdesc["unit"]:
self.value.setSuffix(" " + procdesc["unit"])
self.addWidget(QtGui.QLabel("Value:"), 0, 0)
self.addWidget(QtWidgets.QLabel("Value:"), 0, 0)
self.addWidget(self.value, 0, 1)

self.value.setValue(state["value"]/scale)
@@ -152,20 +151,20 @@ def apply_properties(spinbox):
if procdesc["unit"]:
spinbox.setSuffix(" " + procdesc["unit"])

self.addWidget(QtGui.QLabel("Min:"), 0, 0)
self.min = QtGui.QDoubleSpinBox()
self.addWidget(QtWidgets.QLabel("Min:"), 0, 0)
self.min = QtWidgets.QDoubleSpinBox()
disable_scroll_wheel(self.min)
apply_properties(self.min)
self.addWidget(self.min, 0, 1)

self.addWidget(QtGui.QLabel("Max:"), 1, 0)
self.max = QtGui.QDoubleSpinBox()
self.addWidget(QtWidgets.QLabel("Max:"), 1, 0)
self.max = QtWidgets.QDoubleSpinBox()
disable_scroll_wheel(self.max)
apply_properties(self.max)
self.addWidget(self.max, 1, 1)

self.addWidget(QtGui.QLabel("#Points:"), 2, 0)
self.npoints = QtGui.QSpinBox()
self.addWidget(QtWidgets.QLabel("#Points:"), 2, 0)
self.npoints = QtWidgets.QSpinBox()
disable_scroll_wheel(self.npoints)
self.npoints.setMinimum(2)
self.npoints.setValue(10)
@@ -189,8 +188,8 @@ class _ExplicitScan(LayoutWidget):
def __init__(self, state):
LayoutWidget.__init__(self)

self.value = QtGui.QLineEdit()
self.addWidget(QtGui.QLabel("Sequence:"), 0, 0)
self.value = QtWidgets.QLineEdit()
self.addWidget(QtWidgets.QLabel("Sequence:"), 0, 0)
self.addWidget(self.value, 0, 1)

float_regexp = "[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?"
@@ -209,7 +208,7 @@ def __init__(self, argument):
LayoutWidget.__init__(self)
self.argument = argument

self.stack = QtGui.QStackedWidget()
self.stack = QtWidgets.QStackedWidget()
self.addWidget(self.stack, 1, 0, colspan=4)

procdesc = argument["desc"]
@@ -223,11 +222,11 @@ def __init__(self, argument):
self.stack.addWidget(widget)

self.radiobuttons = OrderedDict()
self.radiobuttons["NoScan"] = QtGui.QRadioButton("No scan")
self.radiobuttons["LinearScan"] = QtGui.QRadioButton("Linear")
self.radiobuttons["RandomScan"] = QtGui.QRadioButton("Random")
self.radiobuttons["ExplicitScan"] = QtGui.QRadioButton("Explicit")
scan_type = QtGui.QButtonGroup()
self.radiobuttons["NoScan"] = QtWidgets.QRadioButton("No scan")
self.radiobuttons["LinearScan"] = QtWidgets.QRadioButton("Linear")
self.radiobuttons["RandomScan"] = QtWidgets.QRadioButton("Random")
self.radiobuttons["ExplicitScan"] = QtWidgets.QRadioButton("Explicit")
scan_type = QtWidgets.QButtonGroup()
for n, b in enumerate(self.radiobuttons.values()):
self.addWidget(b, 0, n)
scan_type.addButton(b)
Loading