forked from M-Labs/artiq
sketching alt_moninj
This commit is contained in:
parent
43edffc67e
commit
760d70cf33
|
@ -0,0 +1,73 @@
|
||||||
|
# Sketching up a potential overhaul for the moninj GUI interface
|
||||||
|
|
||||||
|
from PyQt5 import QtWidgets, QtCore
|
||||||
|
|
||||||
|
from artiq.gui.models import DictSyncTreeSepModel
|
||||||
|
|
||||||
|
|
||||||
|
# MoninjView contains these and adds according to the proper type
|
||||||
|
# (the class should be resolved with a helper and the interface generic)
|
||||||
|
# All widgets should take a refresh hook (slot) for monitoring
|
||||||
|
# All widgets should expose an inject signal with the "command" and "value"
|
||||||
|
# -> this is passed directly to the device manager
|
||||||
|
# suboptimally multiple signals could be exposed
|
||||||
|
class _MoninjWidget(QtWidgets.QWidget):
|
||||||
|
inject = QtCore.pyqtSignal(tuple)
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
QtWidgets.QWidget.__init__(self)
|
||||||
|
|
||||||
|
def refresh(self, value):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
class _TTLWidget(_MoninjWidget):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class _DDSWidget(_MoninjWidget):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class _DACWidget(_MoninjWidget):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# The main tree / table view of the dock -> probably inherits from QTreeView and connects with the
|
||||||
|
# 'MoninjModel' MoninjModel and View could be merged as QTreeWidget but probably not a good idea..
|
||||||
|
class MoninjView:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Like the _AddChannelDialog but should have search function enabled with QRecursiveFilterProxyModel
|
||||||
|
class MoninjAddChannelDialog(QtWidgets.QDialog):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Contains the necessary identifiers for listing all available channels, organized by type and name
|
||||||
|
# does not do any moninj itself, only exists as reference to add channels to 'MoninjModel'
|
||||||
|
class MoninjChannelModel(DictSyncTreeSepModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Currently displayed data, should either be AbstractTableModel
|
||||||
|
# extends features to connect widgets with device manager
|
||||||
|
class MoninjModel:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Retains most functionality of old DeviceManager (contain any device interface here)
|
||||||
|
# What previously connected directly with widgets should now connect with 'MoninjModel'
|
||||||
|
class DeviceManager:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# A standalone Dock
|
||||||
|
# Should include
|
||||||
|
# Toolbar header:
|
||||||
|
# + save and open configurations
|
||||||
|
# + search bar (sort options / if not in view itself)
|
||||||
|
# + add channels dialog window
|
||||||
|
class MoninjDock(QtWidgets.QDockWidget):
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in New Issue