From 760d70cf33498592c8d507f4e3771dc483042553 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 10 Apr 2024 17:47:44 +0800 Subject: [PATCH] sketching alt_moninj --- artiq/dashboard/alt_moninj.py | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 artiq/dashboard/alt_moninj.py diff --git a/artiq/dashboard/alt_moninj.py b/artiq/dashboard/alt_moninj.py new file mode 100644 index 000000000..fc706ae37 --- /dev/null +++ b/artiq/dashboard/alt_moninj.py @@ -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 +