This commit is contained in:
1 parent
e87b019b57
commit
c85bde6127
7 files changed
+92
-1
No files matched your search
@@ -1,4 +1,5 @@
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.actors_config import MxActorConfigWidget
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.task_panel import MxTaskPanel
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.task_queue import MxTaskQueueWidget
|
||||
|
||||
__all__ = ["MxActorConfigWidget", "MxTaskQueueWidget"]
|
||||
__all__ = ["MxActorConfigWidget", "MxTaskPanel", "MxTaskQueueWidget"]
|
||||
@@ -14,6 +14,7 @@ logger = bec_logger.logger
|
||||
|
||||
_Widgets = {
|
||||
"PxIIActorConfigWiget": "PxIIActorConfigWiget",
|
||||
"PxIITaskPanel": "PxIITaskPanel",
|
||||
"PxIITaskQueueWidget": "PxIITaskQueueWidget",
|
||||
"ScanHistory": "ScanHistory",
|
||||
}
|
||||
@@ -29,6 +30,16 @@ class PxIIActorConfigWiget(RPCBase):
|
||||
"""
|
||||
|
||||
|
||||
class PxIITaskPanel(RPCBase):
|
||||
_IMPORT_MODULE = "pxii_bec.bec_widgets.widgets.imported"
|
||||
|
||||
@rpc_call
|
||||
def request_task(self, name: "str", *args, **kwargs):
|
||||
"""
|
||||
Submit a task request to the AareBec service.
|
||||
"""
|
||||
|
||||
|
||||
class PxIITaskQueueWidget(RPCBase):
|
||||
_IMPORT_MODULE = "pxii_bec.bec_widgets.widgets.imported"
|
||||
|
||||
|
||||
@@ -6,12 +6,14 @@ from __future__ import annotations
|
||||
|
||||
designer_plugins = {
|
||||
"PxIIActorConfigWiget": ("pxii_bec.bec_widgets.widgets.imported", "PxIIActorConfigWiget"),
|
||||
"PxIITaskPanel": ("pxii_bec.bec_widgets.widgets.imported", "PxIITaskPanel"),
|
||||
"PxIITaskQueueWidget": ("pxii_bec.bec_widgets.widgets.imported", "PxIITaskQueueWidget"),
|
||||
"ScanHistory": ("pxii_bec.bec_widgets.widgets.scan_history.scan_history", "ScanHistory"),
|
||||
}
|
||||
|
||||
widget_icons = {
|
||||
"PxIIActorConfigWiget": "format_list_bulleted",
|
||||
"PxIITaskPanel": "play_arrow",
|
||||
"PxIITaskQueueWidget": "pending_actions",
|
||||
"ScanHistory": "widgets",
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.actors_config import MxActorConfigWidget
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.task_panel import MxTaskPanel
|
||||
from mx_bec.bec_widgets.widgets.aare_bec.task_queue import MxTaskQueueWidget
|
||||
|
||||
|
||||
@@ -6,3 +7,6 @@ class PxIIActorConfigWiget(MxActorConfigWidget): ...
|
||||
|
||||
|
||||
class PxIITaskQueueWidget(MxTaskQueueWidget): ...
|
||||
|
||||
|
||||
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 PxIITaskPanel
|
||||
|
||||
DOM_XML = """
|
||||
<ui language='c++'>
|
||||
<widget class='PxIITaskPanel' name='px_ii_task_panel'>
|
||||
</widget>
|
||||
</ui>
|
||||
"""
|
||||
|
||||
|
||||
class PxIITaskPanelPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._form_editor = None
|
||||
|
||||
def createWidget(self, parent):
|
||||
if parent is None:
|
||||
return QWidget()
|
||||
t = PxIITaskPanel(parent)
|
||||
return t
|
||||
|
||||
def domXml(self):
|
||||
return DOM_XML
|
||||
|
||||
def group(self):
|
||||
return ""
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon(PxIITaskPanel.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "px_ii_task_panel"
|
||||
|
||||
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 "PxIITaskPanel"
|
||||
|
||||
def toolTip(self):
|
||||
return "PxIITaskPanel"
|
||||
|
||||
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_task_panel_plugin import PxIITaskPanelPlugin
|
||||
|
||||
QPyDesignerCustomWidgetCollection.addCustomWidget(PxIITaskPanelPlugin())
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
main()
|
||||
Reference in new issue
Block a user