From 2570444941027e3ee657cb1f0fbe069bb14314d6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 22 May 2015 23:30:46 +0800 Subject: [PATCH] gui: add empty explorer and console docks --- artiq/frontend/artiq_gui.py | 24 ++++++++++++++++-------- artiq/gui/console.py | 7 +++++++ artiq/gui/explorer.py | 7 +++++++ artiq/gui/parameters.py | 8 ++++---- artiq/gui/schedule.py | 8 ++++---- 5 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 artiq/gui/console.py create mode 100644 artiq/gui/explorer.py diff --git a/artiq/frontend/artiq_gui.py b/artiq/frontend/artiq_gui.py index e1549c6fd..c346674cf 100755 --- a/artiq/frontend/artiq_gui.py +++ b/artiq/frontend/artiq_gui.py @@ -7,11 +7,13 @@ import atexit # Quamash must be imported first so that pyqtgraph picks up the Qt binding # it has chosen. from quamash import QEventLoop, QtGui -from pyqtgraph.dockarea import DockArea +from pyqtgraph import dockarea from artiq.protocols.file_db import FlatFileDB -from artiq.gui.schedule import ScheduleDock +from artiq.gui.explorer import ExplorerDock from artiq.gui.parameters import ParametersDock +from artiq.gui.console import ConsoleDock +from artiq.gui.schedule import ScheduleDock def get_argparser(): @@ -42,19 +44,25 @@ def main(): atexit.register(lambda: loop.close()) win = QtGui.QMainWindow() - area = DockArea() + area = dockarea.DockArea() win.setCentralWidget(area) - win.resize(1000, 500) + win.resize(1400, 800) win.setWindowTitle("ARTIQ") - d_params = ParametersDock(area) - area.addDock(d_params, "left") + d_explorer = ExplorerDock() + area.addDock(d_explorer, "top") + + d_params = ParametersDock() + area.addDock(d_params, "right", d_explorer) loop.run_until_complete(d_params.sub_connect( args.server, args.port_notify)) atexit.register(lambda: loop.run_until_complete(d_params.sub_close())) - d_schedule = ScheduleDock(area) - area.addDock(d_schedule, "top", d_params) + d_console = ConsoleDock() + area.addDock(d_console, "bottom") + + d_schedule = ScheduleDock() + area.addDock(d_schedule, "above", d_console) loop.run_until_complete(d_schedule.sub_connect( args.server, args.port_notify)) atexit.register(lambda: loop.run_until_complete(d_schedule.sub_close())) diff --git a/artiq/gui/console.py b/artiq/gui/console.py new file mode 100644 index 000000000..60d7352c2 --- /dev/null +++ b/artiq/gui/console.py @@ -0,0 +1,7 @@ +from quamash import QtGui +from pyqtgraph import dockarea + + +class ConsoleDock(dockarea.Dock): + def __init__(self): + dockarea.Dock.__init__(self, "Console", size=(1000, 300)) diff --git a/artiq/gui/explorer.py b/artiq/gui/explorer.py new file mode 100644 index 000000000..dcf7ee9ab --- /dev/null +++ b/artiq/gui/explorer.py @@ -0,0 +1,7 @@ +from quamash import QtGui +from pyqtgraph import dockarea + + +class ExplorerDock(dockarea.Dock): + def __init__(self): + dockarea.Dock.__init__(self, "Explorer", size=(1100, 400)) diff --git a/artiq/gui/parameters.py b/artiq/gui/parameters.py index 4602373c9..c23bbeb6e 100644 --- a/artiq/gui/parameters.py +++ b/artiq/gui/parameters.py @@ -1,7 +1,7 @@ import asyncio from quamash import QtGui -from pyqtgraph.dockarea import Dock +from pyqtgraph import dockarea from artiq.protocols.sync_struct import Subscriber from artiq.gui.tools import DictSyncModel @@ -24,9 +24,9 @@ class ParametersModel(DictSyncModel): raise ValueError -class ParametersDock(Dock): - def __init__(self, parent): - Dock.__init__(self, "Parameters", size=(500, 300)) +class ParametersDock(dockarea.Dock): + def __init__(self): + dockarea.Dock.__init__(self, "Parameters", size=(500, 300)) self.table = QtGui.QTableView() self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) diff --git a/artiq/gui/schedule.py b/artiq/gui/schedule.py index 66d1cc19d..451d99be8 100644 --- a/artiq/gui/schedule.py +++ b/artiq/gui/schedule.py @@ -2,7 +2,7 @@ import asyncio import time from quamash import QtGui -from pyqtgraph.dockarea import Dock +from pyqtgraph import dockarea from artiq.protocols.sync_struct import Subscriber from artiq.gui.tools import DictSyncModel @@ -46,9 +46,9 @@ class _ScheduleModel(DictSyncModel): raise ValueError -class ScheduleDock(Dock): - def __init__(self, parent): - Dock.__init__(self, "Schedule", size=(1000, 300)) +class ScheduleDock(dockarea.Dock): + def __init__(self): + dockarea.Dock.__init__(self, "Schedule", size=(1000, 300)) self.table = QtGui.QTableView() self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)