mirror of https://github.com/m-labs/artiq.git
gui: remove console
This commit is contained in:
parent
fb2f53ea9b
commit
6b6393ff56
|
@ -17,7 +17,7 @@ from artiq.tools import *
|
||||||
from artiq.protocols.pc_rpc import AsyncioClient
|
from artiq.protocols.pc_rpc import AsyncioClient
|
||||||
from artiq.gui.models import ModelSubscriber
|
from artiq.gui.models import ModelSubscriber
|
||||||
from artiq.gui import (state, experiments, shortcuts, explorer,
|
from artiq.gui import (state, experiments, shortcuts, explorer,
|
||||||
moninj, datasets, applets, schedule, log, console)
|
moninj, datasets, applets, schedule, log)
|
||||||
|
|
||||||
|
|
||||||
def get_argparser():
|
def get_argparser():
|
||||||
|
@ -129,9 +129,6 @@ def main():
|
||||||
logmgr = log.LogDockManager(dock_area, sub_clients["log"])
|
logmgr = log.LogDockManager(dock_area, sub_clients["log"])
|
||||||
smgr.register(logmgr)
|
smgr.register(logmgr)
|
||||||
|
|
||||||
d_console = console.ConsoleDock(sub_clients["datasets"],
|
|
||||||
rpc_clients["dataset_db"])
|
|
||||||
|
|
||||||
# lay out docks
|
# lay out docks
|
||||||
if os.name != "nt":
|
if os.name != "nt":
|
||||||
dock_area.addDock(d_ttl_dds.dds_dock, "top")
|
dock_area.addDock(d_ttl_dds.dds_dock, "top")
|
||||||
|
@ -143,8 +140,7 @@ def main():
|
||||||
dock_area.addDock(d_datasets, "above", d_applets)
|
dock_area.addDock(d_datasets, "above", d_applets)
|
||||||
dock_area.addDock(d_shortcuts, "above", d_datasets)
|
dock_area.addDock(d_shortcuts, "above", d_datasets)
|
||||||
dock_area.addDock(d_explorer, "above", d_shortcuts)
|
dock_area.addDock(d_explorer, "above", d_shortcuts)
|
||||||
dock_area.addDock(d_console, "bottom")
|
dock_area.addDock(d_schedule, "bottom")
|
||||||
dock_area.addDock(d_schedule, "above", d_console)
|
|
||||||
|
|
||||||
# load/initialize state
|
# load/initialize state
|
||||||
smgr.load()
|
smgr.load()
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
import asyncio
|
|
||||||
|
|
||||||
from quamash import QtCore
|
|
||||||
from pyqtgraph import console, dockarea
|
|
||||||
|
|
||||||
|
|
||||||
_help = """
|
|
||||||
This is an interactive Python console.
|
|
||||||
|
|
||||||
The following functions are available:
|
|
||||||
get_dataset(key)
|
|
||||||
set_dataset(key, value, persist=False) [asynchronous update]
|
|
||||||
del_dataset(key) [asynchronous update]
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
class ConsoleDock(dockarea.Dock):
|
|
||||||
def __init__(self, dataset_sub, dataset_ctl):
|
|
||||||
dockarea.Dock.__init__(self, "Console")
|
|
||||||
self.setMinimumSize(QtCore.QSize(720, 300))
|
|
||||||
self.dataset_sub = dataset_sub
|
|
||||||
self.dataset_ctl = dataset_ctl
|
|
||||||
ns = {
|
|
||||||
"get_dataset": self.get_dataset,
|
|
||||||
"set_dataset": self.set_dataset,
|
|
||||||
"del_dataset": self.del_dataset
|
|
||||||
}
|
|
||||||
c = console.ConsoleWidget(namespace=ns, text=_help)
|
|
||||||
self.addWidget(c)
|
|
||||||
|
|
||||||
def get_dataset(self, k):
|
|
||||||
if self.dataset_sub.model is None:
|
|
||||||
raise IOError("Datasets not available yet")
|
|
||||||
return self.dataset_sub.model.backing_store[k][1]
|
|
||||||
|
|
||||||
def set_dataset(self, k, v):
|
|
||||||
asyncio.ensure_future(self.dataset_ctl.set(k, v))
|
|
||||||
|
|
||||||
def del_dataset(self, k):
|
|
||||||
asyncio.ensure_future(self.dataset_ctl.delete(k))
|
|
Loading…
Reference in New Issue