This commit is contained in:
1 parent
acd92d903d
commit
417db43d6b
6 files changed
+102
No files matched your search
@@ -14,6 +14,7 @@ logger = bec_logger.logger
|
||||
|
||||
_Widgets = {
|
||||
"PxIIActorConfigWiget": "PxIIActorConfigWiget",
|
||||
"PxIISpreadsheetDisplay": "PxIISpreadsheetDisplay",
|
||||
"PxIITaskPanel": "PxIITaskPanel",
|
||||
"PxIITaskQueueWidget": "PxIITaskQueueWidget",
|
||||
"ScanHistory": "ScanHistory",
|
||||
@@ -30,6 +31,28 @@ class PxIIActorConfigWiget(RPCBase):
|
||||
"""
|
||||
|
||||
|
||||
class PxIISpreadsheetDisplay(RPCBase):
|
||||
_IMPORT_MODULE = "pxii_bec.bec_widgets.widgets.imported"
|
||||
|
||||
@rpc_call
|
||||
def remove(self):
|
||||
"""
|
||||
Cleanup the BECConnector
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def attach(self):
|
||||
"""
|
||||
None
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def detach(self):
|
||||
"""
|
||||
Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget.
|
||||
"""
|
||||
|
||||
|
||||
class PxIITaskPanel(RPCBase):
|
||||
_IMPORT_MODULE = "pxii_bec.bec_widgets.widgets.imported"
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ from __future__ import annotations
|
||||
|
||||
designer_plugins = {
|
||||
"PxIIActorConfigWiget": ("pxii_bec.bec_widgets.widgets.imported", "PxIIActorConfigWiget"),
|
||||
"PxIISpreadsheetDisplay": ("pxii_bec.bec_widgets.widgets.imported", "PxIISpreadsheetDisplay"),
|
||||
"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"),
|
||||
@@ -13,6 +14,7 @@ designer_plugins = {
|
||||
|
||||
widget_icons = {
|
||||
"PxIIActorConfigWiget": "format_list_bulleted",
|
||||
"PxIISpreadsheetDisplay": "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.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
|
||||
|
||||
@@ -10,3 +11,6 @@ class PxIITaskQueueWidget(MxTaskQueueWidget): ...
|
||||
|
||||
|
||||
class PxIITaskPanel(MxTaskPanel): ...
|
||||
|
||||
|
||||
class PxIISpreadsheetDisplay(SampleSpreadsheetDisplay): ...
|
||||
@@ -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 PxIISpreadsheetDisplay
|
||||
|
||||
DOM_XML = """
|
||||
<ui language='c++'>
|
||||
<widget class='PxIISpreadsheetDisplay' name='px_ii_spreadsheet_display'>
|
||||
</widget>
|
||||
</ui>
|
||||
"""
|
||||
|
||||
|
||||
class PxIISpreadsheetDisplayPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._form_editor = None
|
||||
|
||||
def createWidget(self, parent):
|
||||
if parent is None:
|
||||
return QWidget()
|
||||
t = PxIISpreadsheetDisplay(parent)
|
||||
return t
|
||||
|
||||
def domXml(self):
|
||||
return DOM_XML
|
||||
|
||||
def group(self):
|
||||
return ""
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon(PxIISpreadsheetDisplay.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "px_ii_spreadsheet_display"
|
||||
|
||||
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 "PxIISpreadsheetDisplay"
|
||||
|
||||
def toolTip(self):
|
||||
return "PxIISpreadsheetDisplay"
|
||||
|
||||
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_spreadsheet_display_plugin import PxIISpreadsheetDisplayPlugin
|
||||
|
||||
QPyDesignerCustomWidgetCollection.addCustomWidget(PxIISpreadsheetDisplayPlugin())
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
main()
|
||||
Reference in new issue
Block a user