1 parent
417db43d6b
commit
ee52a6f2ce
7 files changed
+112
-6
No files matched your search
@@ -14,6 +14,7 @@ logger = bec_logger.logger
|
||||
|
||||
_Widgets = {
|
||||
"PxIIActorConfigWiget": "PxIIActorConfigWiget",
|
||||
"PxIISampleQueueWidget": "PxIISampleQueueWidget",
|
||||
"PxIISpreadsheetDisplay": "PxIISpreadsheetDisplay",
|
||||
"PxIITaskPanel": "PxIITaskPanel",
|
||||
"PxIITaskQueueWidget": "PxIITaskQueueWidget",
|
||||
@@ -31,6 +32,22 @@ class PxIIActorConfigWiget(RPCBase):
|
||||
"""
|
||||
|
||||
|
||||
class PxIISampleQueueWidget(RPCBase):
|
||||
_IMPORT_MODULE = "pxii_bec.bec_widgets.widgets.imported"
|
||||
|
||||
@rpc_call
|
||||
def refresh(self):
|
||||
"""
|
||||
Reload the queued samples from Redis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def clear_queue(self):
|
||||
"""
|
||||
Delete the queue contents
|
||||
"""
|
||||
|
||||
|
||||
class PxIISpreadsheetDisplay(RPCBase):
|
||||
_IMPORT_MODULE = "pxii_bec.bec_widgets.widgets.imported"
|
||||
|
||||
@@ -72,6 +89,12 @@ class PxIITaskQueueWidget(RPCBase):
|
||||
Reload the queued tasks from Redis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def clear_queue(self):
|
||||
"""
|
||||
Delete the queue contents
|
||||
"""
|
||||
|
||||
|
||||
class ScanHistory(RPCBase):
|
||||
_IMPORT_MODULE = "pxii_bec.bec_widgets.widgets.scan_history.scan_history"
|
||||
|
||||
@@ -6,6 +6,7 @@ from __future__ import annotations
|
||||
|
||||
designer_plugins = {
|
||||
"PxIIActorConfigWiget": ("pxii_bec.bec_widgets.widgets.imported", "PxIIActorConfigWiget"),
|
||||
"PxIISampleQueueWidget": ("pxii_bec.bec_widgets.widgets.imported", "PxIISampleQueueWidget"),
|
||||
"PxIISpreadsheetDisplay": ("pxii_bec.bec_widgets.widgets.imported", "PxIISpreadsheetDisplay"),
|
||||
"PxIITaskPanel": ("pxii_bec.bec_widgets.widgets.imported", "PxIITaskPanel"),
|
||||
"PxIITaskQueueWidget": ("pxii_bec.bec_widgets.widgets.imported", "PxIITaskQueueWidget"),
|
||||
@@ -14,6 +15,7 @@ designer_plugins = {
|
||||
|
||||
widget_icons = {
|
||||
"PxIIActorConfigWiget": "format_list_bulleted",
|
||||
"PxIISampleQueueWidget": "pending_actions",
|
||||
"PxIISpreadsheetDisplay": "format_list_bulleted",
|
||||
"PxIITaskPanel": "play_arrow",
|
||||
"PxIITaskQueueWidget": "pending_actions",
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.actors_config import MxActorConfigWidget
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.sample_spreadsheet_display import SampleSpreadsheetDisplay
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.task_panel import MxTaskPanel
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.task_queue import MxTaskQueueWidget
|
||||
from mx_bec.bec_widgets.widgets.aare_bec import (
|
||||
MxActorConfigWidget,
|
||||
MxTaskPanel,
|
||||
MxTaskQueueWidget,
|
||||
SampleQueueWidget,
|
||||
SampleSpreadsheetDisplay,
|
||||
)
|
||||
|
||||
|
||||
class PxIIActorConfigWiget(MxActorConfigWidget): ...
|
||||
@@ -10,6 +13,9 @@ class PxIIActorConfigWiget(MxActorConfigWidget): ...
|
||||
class PxIITaskQueueWidget(MxTaskQueueWidget): ...
|
||||
|
||||
|
||||
class PxIISampleQueueWidget(SampleQueueWidget): ...
|
||||
|
||||
|
||||
class PxIITaskPanel(MxTaskPanel): ...
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{'files': ['imported.py']}
|
||||
@@ -0,0 +1,57 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
||||
from qtpy.QtWidgets import QWidget
|
||||
|
||||
from bec_widgets.utils.bec_designer import designer_material_icon
|
||||
from pxii_bec.bec_widgets.widgets.imported import PxIISampleQueueWidget
|
||||
|
||||
DOM_XML = """
|
||||
<ui language='c++'>
|
||||
<widget class='PxIISampleQueueWidget' name='px_ii_sample_queue_widget'>
|
||||
</widget>
|
||||
</ui>
|
||||
"""
|
||||
|
||||
|
||||
class PxIISampleQueueWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._form_editor = None
|
||||
|
||||
def createWidget(self, parent):
|
||||
if parent is None:
|
||||
return QWidget()
|
||||
t = PxIISampleQueueWidget(parent)
|
||||
return t
|
||||
|
||||
def domXml(self):
|
||||
return DOM_XML
|
||||
|
||||
def group(self):
|
||||
return ""
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon(PxIISampleQueueWidget.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "px_ii_sample_queue_widget"
|
||||
|
||||
def initialize(self, form_editor):
|
||||
self._form_editor = form_editor
|
||||
|
||||
def isContainer(self):
|
||||
return False
|
||||
|
||||
def isInitialized(self):
|
||||
return self._form_editor is not None
|
||||
|
||||
def name(self):
|
||||
return "PxIISampleQueueWidget"
|
||||
|
||||
def toolTip(self):
|
||||
return "PxIISampleQueueWidget"
|
||||
|
||||
def whatsThis(self):
|
||||
return self.toolTip()
|
||||
@@ -0,0 +1,15 @@
|
||||
def main(): # pragma: no cover
|
||||
from qtpy import PYSIDE6
|
||||
|
||||
if not PYSIDE6:
|
||||
print("PYSIDE6 is not available in the environment. Cannot patch designer.")
|
||||
return
|
||||
from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection
|
||||
|
||||
from pxii_bec.bec_widgets.widgets.px_ii_sample_queue_widget_plugin import PxIISampleQueueWidgetPlugin
|
||||
|
||||
QPyDesignerCustomWidgetCollection.addCustomWidget(PxIISampleQueueWidgetPlugin())
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
main()
|
||||
@@ -3,14 +3,16 @@ find them through the `bec.messages` entry point registered by this package."""
|
||||
|
||||
from mx_bec.messages import (
|
||||
MXMeasurementSequenceMessage,
|
||||
MXQueueChangedMessage,
|
||||
MXSampleExecutionMessage,
|
||||
MXTaskExecutionMessage,
|
||||
MXTaskQueueChangedMessage,
|
||||
OpticalPredictionMessage,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"MXMeasurementSequenceMessage",
|
||||
"MXTaskExecutionMessage",
|
||||
"MXTaskQueueChangedMessage",
|
||||
"MXSampleExecutionMessage",
|
||||
"MXQueueChangedMessage",
|
||||
"OpticalPredictionMessage",
|
||||
]
|
||||
Reference in new issue
Block a user