fix(beamline-states): remove designer plugin for BeamlineStatePill

This commit is contained in:
2026-06-10 17:35:29 +02:00
parent f9cbeda30c
commit f5955ad2ed
6 changed files with 2 additions and 132 deletions
-49
View File
@@ -33,7 +33,6 @@ _Widgets = {
"BECShell": "BECShell",
"BECStatusBox": "BECStatusBox",
"BeamlineStateManager": "BeamlineStateManager",
"BeamlineStatePill": "BeamlineStatePill",
"BecConsole": "BecConsole",
"DapComboBox": "DapComboBox",
"DeviceBrowser": "DeviceBrowser",
@@ -775,54 +774,6 @@ class BeamlineStateManager(RPCBase):
"""
class BeamlineStatePill(RPCBase):
"""Compact widget showing one BEC beamline state."""
_IMPORT_MODULE = "bec_widgets.widgets.services.beamline_states.beamline_state_pill"
@property
@rpc_call
def state_name(self) -> "str | None":
"""
Name of the BEC beamline state displayed by this pill.
"""
@rpc_call
def set_state_name(self, state_name: "str | None", title: "str | None" = None) -> "None":
"""
Set the BEC beamline state this pill displays.
Args:
state_name: State name as published by ``AvailableBeamlineStatesMessage``.
title: Optional human-readable title for the state.
"""
@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.
"""
@rpc_timeout(None)
@rpc_call
def screenshot(self, file_name: "str | None" = None):
"""
Take a screenshot of the dock area and save it to a file.
"""
class BecConsole(RPCBase):
"""A console widget with access to a shared registry of terminals, such that instances can be moved around."""
-5
View File
@@ -23,10 +23,6 @@ designer_plugins = {
"bec_widgets.widgets.services.beamline_states.beamline_state_pill",
"BeamlineStateManager",
),
"BeamlineStatePill": (
"bec_widgets.widgets.services.beamline_states.beamline_state_pill",
"BeamlineStatePill",
),
"BecConsole": ("bec_widgets.widgets.editors.bec_console.bec_console", "BecConsole"),
"ColorButton": ("bec_widgets.widgets.utility.visual.color_button.color_button", "ColorButton"),
"ColorButtonNative": (
@@ -127,7 +123,6 @@ widget_icons = {
"BECSpinBox": "123",
"BECStatusBox": "widgets",
"BeamlineStateManager": "format_list_bulleted",
"BeamlineStatePill": "info",
"BecConsole": "terminal",
"ColorButton": "colors",
"ColorButtonNative": "colors",
@@ -93,9 +93,8 @@ class BeamlineStatePill(BECWidget, QWidget):
a ``BeamlineStateMessage`` is published for that state.
"""
PLUGIN = True
ICON_NAME = "info"
USER_ACCESS = ["state_name", "set_state_name", "remove", "attach", "detach", "screenshot"]
PLUGIN = False
RPC = False
state_changed = Signal(str, str, str)
update_requested = Signal(str, object)
@@ -1 +0,0 @@
{'files': ['beamline_state_pill.py']}
@@ -1,57 +0,0 @@
# 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 bec_widgets.widgets.services.beamline_states.beamline_state_pill import BeamlineStatePill
DOM_XML = """
<ui language='c++'>
<widget class='BeamlineStatePill' name='beamline_state_pill'>
</widget>
</ui>
"""
class BeamlineStatePillPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
def __init__(self):
super().__init__()
self._form_editor = None
def createWidget(self, parent):
if parent is None:
return QWidget()
t = BeamlineStatePill(parent)
return t
def domXml(self):
return DOM_XML
def group(self):
return ""
def icon(self):
return designer_material_icon(BeamlineStatePill.ICON_NAME)
def includeFile(self):
return "beamline_state_pill"
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 "BeamlineStatePill"
def toolTip(self):
return ""
def whatsThis(self):
return self.toolTip()
@@ -1,17 +0,0 @@
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 bec_widgets.widgets.services.beamline_states.beamline_state_pill_plugin import (
BeamlineStatePillPlugin,
)
QPyDesignerCustomWidgetCollection.addCustomWidget(BeamlineStatePillPlugin())
if __name__ == "__main__": # pragma: no cover
main()