bec-widgets 0.89.0__py3-none-any.whl → 0.91.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CHANGELOG.md +50 -52
- PKG-INFO +1 -1
- bec_widgets/assets/designer_icons/code.png +0 -0
- bec_widgets/assets/designer_icons/color_button.png +0 -0
- bec_widgets/assets/designer_icons/device_box.png +0 -0
- bec_widgets/assets/designer_icons/device_combo_box.png +0 -0
- bec_widgets/assets/designer_icons/device_line_edit.png +0 -0
- bec_widgets/assets/designer_icons/dock_area.png +0 -0
- bec_widgets/assets/designer_icons/games.png +0 -0
- bec_widgets/assets/designer_icons/image.png +0 -0
- bec_widgets/assets/designer_icons/position_indicator.png +0 -0
- bec_widgets/assets/designer_icons/queue.png +0 -0
- bec_widgets/assets/designer_icons/ring_progress.png +0 -0
- bec_widgets/assets/designer_icons/scan_control.png +0 -0
- bec_widgets/assets/designer_icons/spinner.png +0 -0
- bec_widgets/assets/designer_icons/status.png +0 -0
- bec_widgets/assets/designer_icons/stop.png +0 -0
- bec_widgets/assets/designer_icons/text.png +0 -0
- bec_widgets/assets/designer_icons/toggle.png +0 -0
- bec_widgets/assets/designer_icons/web.png +0 -0
- bec_widgets/assets/status_icons/error.svg +3 -0
- bec_widgets/assets/status_icons/not_connected.svg +3 -0
- bec_widgets/assets/status_icons/refresh.svg +3 -0
- bec_widgets/assets/status_icons/running.svg +3 -0
- bec_widgets/assets/status_icons/warning.svg +3 -0
- bec_widgets/assets/toolbar_icons/attach_all.svg +3 -0
- bec_widgets/assets/toolbar_icons/auto_range.svg +1 -1
- bec_widgets/assets/toolbar_icons/compare.svg +3 -0
- bec_widgets/assets/toolbar_icons/device_box.svg +3 -0
- bec_widgets/assets/toolbar_icons/fft.svg +11 -0
- bec_widgets/assets/toolbar_icons/image.svg +3 -0
- bec_widgets/assets/toolbar_icons/image_autorange.svg +3 -0
- bec_widgets/assets/toolbar_icons/line_curve.svg +3 -0
- bec_widgets/assets/toolbar_icons/lock_aspect_ratio.svg +3 -0
- bec_widgets/assets/toolbar_icons/log_scale.png +0 -0
- bec_widgets/assets/toolbar_icons/motor_map.svg +3 -0
- bec_widgets/assets/toolbar_icons/progress.svg +3 -0
- bec_widgets/assets/toolbar_icons/queue.svg +3 -0
- bec_widgets/assets/toolbar_icons/reset_settings.svg +3 -0
- bec_widgets/assets/toolbar_icons/restore_state.svg +3 -0
- bec_widgets/assets/toolbar_icons/ring_progress.svg +3 -0
- bec_widgets/assets/toolbar_icons/rotate_left.svg +3 -0
- bec_widgets/assets/toolbar_icons/rotate_right.svg +3 -0
- bec_widgets/assets/toolbar_icons/save_state.svg +3 -0
- bec_widgets/assets/toolbar_icons/scan_control.svg +3 -0
- bec_widgets/assets/toolbar_icons/status.svg +3 -0
- bec_widgets/assets/toolbar_icons/terminal.svg +3 -0
- bec_widgets/assets/toolbar_icons/transform.svg +3 -0
- bec_widgets/assets/toolbar_icons/waveform.svg +3 -0
- bec_widgets/cli/client.py +188 -3
- bec_widgets/examples/jupyter_console/jupyter_console_window.py +18 -19
- bec_widgets/examples/plugin_example_pyside/tictactoeplugin.py +8 -2
- bec_widgets/qt_utils/toolbar.py +52 -2
- bec_widgets/utils/generate_designer_plugin.py +1 -1
- bec_widgets/widgets/bec_queue/bec_queue_plugin.py +7 -2
- bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py +7 -2
- bec_widgets/widgets/bec_status_box/status_item.py +14 -8
- bec_widgets/widgets/color_button/color_button_plugin.py +3 -2
- bec_widgets/widgets/device_box/device_box_plugin.py +6 -1
- bec_widgets/widgets/device_combobox/{device_combobox_plugin.py → device_combo_box_plugin.py} +5 -3
- bec_widgets/widgets/device_combobox/device_combobox.py +0 -1
- bec_widgets/widgets/device_combobox/{register_device_combobox.py → register_device_combo_box.py} +1 -1
- bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py +5 -3
- bec_widgets/widgets/dock/dock.py +5 -2
- bec_widgets/widgets/dock/dock_area.py +139 -29
- bec_widgets/widgets/dock/dock_area.pyproject +1 -0
- bec_widgets/widgets/dock/dock_area_plugin.py +59 -0
- bec_widgets/widgets/dock/register_dock_area.py +15 -0
- bec_widgets/widgets/figure/figure.py +1 -3
- bec_widgets/widgets/figure/plots/axis_settings.ui +86 -100
- bec_widgets/widgets/figure/plots/image/image.py +85 -3
- bec_widgets/widgets/figure/plots/image/image_item.py +14 -0
- bec_widgets/widgets/image/__init__.py +0 -0
- bec_widgets/widgets/image/bec_image_widget.pyproject +1 -0
- bec_widgets/widgets/image/bec_image_widget_plugin.py +59 -0
- bec_widgets/widgets/image/image_widget.py +475 -0
- bec_widgets/widgets/image/register_bec_image_widget.py +15 -0
- bec_widgets/widgets/position_indicator/__init__.py +0 -0
- bec_widgets/widgets/position_indicator/position_indicator_plugin.py +7 -2
- bec_widgets/widgets/ring_progress_bar/register_ring_progress_bar.py +15 -0
- bec_widgets/widgets/ring_progress_bar/ring_progress_bar.pyproject +1 -0
- bec_widgets/widgets/ring_progress_bar/ring_progress_bar_plugin.py +58 -0
- bec_widgets/widgets/scan_control/register_scan_control.py +15 -0
- bec_widgets/widgets/scan_control/scan_control.pyproject +1 -0
- bec_widgets/widgets/scan_control/scan_control_plugin.py +58 -0
- bec_widgets/widgets/spinner/spinner_widget_plugin.py +7 -2
- bec_widgets/widgets/stop_button/stop_button_plugin.py +5 -3
- bec_widgets/widgets/text_box/register_text_box.py +15 -0
- bec_widgets/widgets/text_box/text_box.pyproject +1 -0
- bec_widgets/widgets/text_box/text_box_plugin.py +58 -0
- bec_widgets/widgets/toggle/toggle_switch_plugin.py +7 -2
- bec_widgets/widgets/vscode/register_vs_code_editor.py +15 -0
- bec_widgets/widgets/vscode/vs_code_editor.pyproject +1 -0
- bec_widgets/widgets/vscode/vs_code_editor_plugin.py +59 -0
- bec_widgets/widgets/waveform/bec_waveform_widget_plugin.py +1 -1
- bec_widgets/widgets/website/register_website_widget.py +15 -0
- bec_widgets/widgets/website/website_widget.pyproject +1 -0
- bec_widgets/widgets/website/website_widget_plugin.py +58 -0
- {bec_widgets-0.89.0.dist-info → bec_widgets-0.91.0.dist-info}/METADATA +1 -1
- {bec_widgets-0.89.0.dist-info → bec_widgets-0.91.0.dist-info}/RECORD +112 -45
- pyproject.toml +1 -1
- tests/unit_tests/client_mocks.py +9 -1
- tests/unit_tests/test_bec_dock.py +70 -30
- tests/unit_tests/test_bec_image_widget.py +218 -0
- tests/unit_tests/test_device_input_base.py +1 -1
- tests/unit_tests/test_device_input_widgets.py +2 -0
- tests/unit_tests/test_waveform_widget.py +1 -1
- bec_widgets/widgets/color_button/assets/color_button.png +0 -0
- bec_widgets/widgets/device_combobox/assets/device_combobox_icon.png +0 -0
- bec_widgets/widgets/device_line_edit/assets/line_edit_icon.png +0 -0
- bec_widgets/widgets/stop_button/assets/stop.png +0 -0
- /bec_widgets/assets/designer_icons/{BECWaveformWidget.png → waveform.png} +0 -0
- /bec_widgets/widgets/device_combobox/{device_combobox.pyproject → device_combo_box.pyproject} +0 -0
- {bec_widgets-0.89.0.dist-info → bec_widgets-0.91.0.dist-info}/WHEEL +0 -0
- {bec_widgets-0.89.0.dist-info → bec_widgets-0.91.0.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.89.0.dist-info → bec_widgets-0.91.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,11 +1,14 @@
|
|
1
1
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2
2
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
3
|
+
import os
|
3
4
|
|
4
5
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
5
6
|
from qtpy.QtGui import QIcon
|
6
7
|
from tictactoe import TicTacToe
|
7
8
|
from tictactoetaskmenu import TicTacToeTaskMenuFactory
|
8
9
|
|
10
|
+
import bec_widgets
|
11
|
+
|
9
12
|
DOM_XML = """
|
10
13
|
<ui language='c++'>
|
11
14
|
<widget class='TicTacToe' name='ticTacToe'>
|
@@ -24,6 +27,8 @@ DOM_XML = """
|
|
24
27
|
</ui>
|
25
28
|
"""
|
26
29
|
|
30
|
+
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
31
|
+
|
27
32
|
|
28
33
|
class TicTacToePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
29
34
|
def __init__(self):
|
@@ -38,10 +43,11 @@ class TicTacToePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
38
43
|
return DOM_XML
|
39
44
|
|
40
45
|
def group(self):
|
41
|
-
return ""
|
46
|
+
return "Games"
|
42
47
|
|
43
48
|
def icon(self):
|
44
|
-
|
49
|
+
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "games.png")
|
50
|
+
return QIcon(icon_path)
|
45
51
|
|
46
52
|
def includeFile(self):
|
47
53
|
return "tictactoe"
|
bec_widgets/qt_utils/toolbar.py
CHANGED
@@ -5,7 +5,7 @@ from collections import defaultdict
|
|
5
5
|
|
6
6
|
from qtpy.QtCore import QSize
|
7
7
|
from qtpy.QtGui import QAction, QIcon
|
8
|
-
from qtpy.QtWidgets import QHBoxLayout, QLabel, QToolBar, QToolButton, QWidget
|
8
|
+
from qtpy.QtWidgets import QHBoxLayout, QLabel, QMenu, QToolBar, QToolButton, QWidget
|
9
9
|
|
10
10
|
import bec_widgets
|
11
11
|
|
@@ -98,6 +98,52 @@ class DeviceSelectionAction(ToolBarAction):
|
|
98
98
|
self.device_combobox.setStyleSheet(f"QComboBox {{ background-color: {color}; }}")
|
99
99
|
|
100
100
|
|
101
|
+
class ExpandableMenuAction(ToolBarAction):
|
102
|
+
"""
|
103
|
+
Action for an expandable menu in the toolbar.
|
104
|
+
|
105
|
+
Args:
|
106
|
+
label (str): The label for the menu.
|
107
|
+
actions (dict): A dictionary of actions to populate the menu.
|
108
|
+
icon_path (str, optional): The path to the icon file. Defaults to None.
|
109
|
+
|
110
|
+
"""
|
111
|
+
|
112
|
+
def __init__(self, label: str, actions: dict, icon_path: str = None):
|
113
|
+
super().__init__(icon_path, label)
|
114
|
+
self.actions = actions
|
115
|
+
self.widgets = defaultdict(dict)
|
116
|
+
|
117
|
+
def add_to_toolbar(self, toolbar: QToolBar, target: QWidget):
|
118
|
+
button = QToolButton(toolbar)
|
119
|
+
if self.icon_path:
|
120
|
+
button.setIcon(QIcon(self.icon_path))
|
121
|
+
button.setText(self.tooltip)
|
122
|
+
button.setPopupMode(QToolButton.InstantPopup)
|
123
|
+
button.setStyleSheet(
|
124
|
+
"""
|
125
|
+
QToolButton {
|
126
|
+
font-size: 14px;
|
127
|
+
}
|
128
|
+
QMenu {
|
129
|
+
font-size: 14px;
|
130
|
+
}
|
131
|
+
"""
|
132
|
+
)
|
133
|
+
menu = QMenu(button)
|
134
|
+
for action_id, action in self.actions.items():
|
135
|
+
sub_action = QAction(action.tooltip, target)
|
136
|
+
if action.icon_path:
|
137
|
+
icon = QIcon()
|
138
|
+
icon.addFile(action.icon_path, size=QSize(20, 20))
|
139
|
+
sub_action.setIcon(icon)
|
140
|
+
sub_action.setCheckable(action.checkable)
|
141
|
+
menu.addAction(sub_action)
|
142
|
+
self.widgets[action_id] = sub_action
|
143
|
+
button.setMenu(menu)
|
144
|
+
toolbar.addWidget(button)
|
145
|
+
|
146
|
+
|
101
147
|
class ModularToolBar(QToolBar):
|
102
148
|
"""Modular toolbar with optional automatic initialization.
|
103
149
|
Args:
|
@@ -108,7 +154,11 @@ class ModularToolBar(QToolBar):
|
|
108
154
|
"""
|
109
155
|
|
110
156
|
def __init__(
|
111
|
-
self,
|
157
|
+
self,
|
158
|
+
parent=None,
|
159
|
+
actions: dict | None = None,
|
160
|
+
target_widget=None,
|
161
|
+
color: str = "rgba(255, 255, 255, 0)",
|
112
162
|
):
|
113
163
|
super().__init__(parent)
|
114
164
|
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2
2
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
3
|
+
import os
|
3
4
|
|
4
5
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
5
6
|
from qtpy.QtGui import QIcon
|
6
7
|
|
8
|
+
import bec_widgets
|
7
9
|
from bec_widgets.widgets.bec_queue.bec_queue import BECQueue
|
8
10
|
|
9
11
|
DOM_XML = """
|
@@ -13,6 +15,8 @@ DOM_XML = """
|
|
13
15
|
</ui>
|
14
16
|
"""
|
15
17
|
|
18
|
+
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
19
|
+
|
16
20
|
|
17
21
|
class BECQueuePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
18
22
|
def __init__(self):
|
@@ -27,10 +31,11 @@ class BECQueuePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
27
31
|
return DOM_XML
|
28
32
|
|
29
33
|
def group(self):
|
30
|
-
return ""
|
34
|
+
return "BEC Services"
|
31
35
|
|
32
36
|
def icon(self):
|
33
|
-
|
37
|
+
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "device_line_edit.png")
|
38
|
+
return QIcon(icon_path)
|
34
39
|
|
35
40
|
def includeFile(self):
|
36
41
|
return "bec_queue"
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2
2
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
3
|
+
import os
|
3
4
|
|
4
5
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
5
6
|
from qtpy.QtGui import QIcon
|
6
7
|
|
8
|
+
import bec_widgets
|
7
9
|
from bec_widgets.widgets.bec_status_box.bec_status_box import BECStatusBox
|
8
10
|
|
9
11
|
DOM_XML = """
|
@@ -13,6 +15,8 @@ DOM_XML = """
|
|
13
15
|
</ui>
|
14
16
|
"""
|
15
17
|
|
18
|
+
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
19
|
+
|
16
20
|
|
17
21
|
class BECStatusBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
18
22
|
def __init__(self):
|
@@ -27,10 +31,11 @@ class BECStatusBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
27
31
|
return DOM_XML
|
28
32
|
|
29
33
|
def group(self):
|
30
|
-
return ""
|
34
|
+
return "BEC Services"
|
31
35
|
|
32
36
|
def icon(self):
|
33
|
-
|
37
|
+
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "status.png")
|
38
|
+
return QIcon(icon_path)
|
34
39
|
|
35
40
|
def includeFile(self):
|
36
41
|
return "bec_status_box"
|
@@ -2,24 +2,30 @@
|
|
2
2
|
The widget is bound to be used with the BECStatusBox widget."""
|
3
3
|
|
4
4
|
import enum
|
5
|
+
import os
|
5
6
|
from datetime import datetime
|
6
7
|
|
7
8
|
from bec_lib.utils.import_utils import lazy_import_from
|
8
9
|
from qtpy.QtCore import Qt, Slot
|
9
|
-
from qtpy.
|
10
|
+
from qtpy.QtGui import QIcon
|
11
|
+
from qtpy.QtWidgets import QDialog, QHBoxLayout, QLabel, QVBoxLayout, QWidget
|
12
|
+
|
13
|
+
import bec_widgets
|
10
14
|
|
11
15
|
# TODO : Put normal imports back when Pydantic gets faster
|
12
16
|
BECStatus = lazy_import_from("bec_lib.messages", ("BECStatus",))
|
13
17
|
|
18
|
+
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
19
|
+
|
14
20
|
|
15
21
|
class IconsEnum(enum.Enum):
|
16
22
|
"""Enum class for icons in the status item widget."""
|
17
23
|
|
18
|
-
RUNNING = "
|
19
|
-
BUSY = "
|
20
|
-
IDLE = "
|
21
|
-
ERROR = "
|
22
|
-
NOTCONNECTED = "
|
24
|
+
RUNNING = os.path.join(MODULE_PATH, "assets", "status_icons", "running.svg")
|
25
|
+
BUSY = os.path.join(MODULE_PATH, "assets", "status_icons", "refresh.svg")
|
26
|
+
IDLE = os.path.join(MODULE_PATH, "assets", "status_icons", "warning.svg")
|
27
|
+
ERROR = os.path.join(MODULE_PATH, "assets", "status_icons", "error.svg")
|
28
|
+
NOTCONNECTED = os.path.join(MODULE_PATH, "assets", "status_icons", "not_connected.svg")
|
23
29
|
|
24
30
|
|
25
31
|
class StatusItem(QWidget):
|
@@ -91,8 +97,8 @@ class StatusItem(QWidget):
|
|
91
97
|
|
92
98
|
def set_status(self) -> None:
|
93
99
|
"""Set the status icon for the status item widget."""
|
94
|
-
|
95
|
-
icon =
|
100
|
+
icon_path = IconsEnum[self.config.status].value
|
101
|
+
icon = QIcon(icon_path)
|
96
102
|
self._icon.setPixmap(icon.pixmap(*self.icon_size))
|
97
103
|
self._icon.setAlignment(Qt.AlignmentFlag.AlignRight)
|
98
104
|
|
@@ -3,6 +3,7 @@ import os
|
|
3
3
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
4
4
|
from qtpy.QtGui import QIcon
|
5
5
|
|
6
|
+
import bec_widgets
|
6
7
|
from bec_widgets.widgets.color_button.color_button import ColorButton
|
7
8
|
|
8
9
|
DOM_XML = """
|
@@ -11,6 +12,7 @@ DOM_XML = """
|
|
11
12
|
</widget>
|
12
13
|
</ui>
|
13
14
|
"""
|
15
|
+
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
14
16
|
|
15
17
|
|
16
18
|
class ColorButtonPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
@@ -29,8 +31,7 @@ class ColorButtonPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
29
31
|
return "BEC Buttons"
|
30
32
|
|
31
33
|
def icon(self):
|
32
|
-
|
33
|
-
icon_path = os.path.join(current_path, "assets", "color_button.png")
|
34
|
+
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "color_button.png")
|
34
35
|
return QIcon(icon_path)
|
35
36
|
|
36
37
|
def includeFile(self):
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2
2
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
3
|
+
import os
|
3
4
|
|
4
5
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
5
6
|
from qtpy.QtGui import QIcon
|
6
7
|
|
8
|
+
import bec_widgets
|
7
9
|
from bec_widgets.widgets.device_box.device_box import DeviceBox
|
8
10
|
|
9
11
|
DOM_XML = """
|
@@ -13,6 +15,8 @@ DOM_XML = """
|
|
13
15
|
</ui>
|
14
16
|
"""
|
15
17
|
|
18
|
+
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
19
|
+
|
16
20
|
|
17
21
|
class DeviceBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
18
22
|
def __init__(self):
|
@@ -30,7 +34,8 @@ class DeviceBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
30
34
|
return "Device Control"
|
31
35
|
|
32
36
|
def icon(self):
|
33
|
-
|
37
|
+
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "device_box.png")
|
38
|
+
return QIcon(icon_path)
|
34
39
|
|
35
40
|
def includeFile(self):
|
36
41
|
return "device_box"
|
bec_widgets/widgets/device_combobox/{device_combobox_plugin.py → device_combo_box_plugin.py}
RENAMED
@@ -5,6 +5,7 @@ import os
|
|
5
5
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
6
6
|
from qtpy.QtGui import QIcon
|
7
7
|
|
8
|
+
import bec_widgets
|
8
9
|
from bec_widgets.widgets.device_combobox.device_combobox import DeviceComboBox
|
9
10
|
|
10
11
|
DOM_XML = """
|
@@ -14,6 +15,8 @@ DOM_XML = """
|
|
14
15
|
</ui>
|
15
16
|
"""
|
16
17
|
|
18
|
+
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
19
|
+
|
17
20
|
|
18
21
|
class DeviceComboBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
19
22
|
def __init__(self):
|
@@ -28,11 +31,10 @@ class DeviceComboBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
28
31
|
return DOM_XML
|
29
32
|
|
30
33
|
def group(self):
|
31
|
-
return "
|
34
|
+
return "Device Control"
|
32
35
|
|
33
36
|
def icon(self):
|
34
|
-
|
35
|
-
icon_path = os.path.join(current_path, "assets", "device_combobox_icon.png")
|
37
|
+
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "device_combo_box.png")
|
36
38
|
return QIcon(icon_path)
|
37
39
|
|
38
40
|
def includeFile(self):
|
bec_widgets/widgets/device_combobox/{register_device_combobox.py → register_device_combo_box.py}
RENAMED
@@ -6,7 +6,7 @@ def main(): # pragma: no cover
|
|
6
6
|
return
|
7
7
|
from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection
|
8
8
|
|
9
|
-
from bec_widgets.widgets.device_combobox.
|
9
|
+
from bec_widgets.widgets.device_combobox.device_combo_box_plugin import DeviceComboBoxPlugin
|
10
10
|
|
11
11
|
QPyDesignerCustomWidgetCollection.addCustomWidget(DeviceComboBoxPlugin())
|
12
12
|
|
@@ -5,6 +5,7 @@ import os
|
|
5
5
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
6
6
|
from qtpy.QtGui import QIcon
|
7
7
|
|
8
|
+
import bec_widgets
|
8
9
|
from bec_widgets.widgets.device_line_edit.device_line_edit import DeviceLineEdit
|
9
10
|
|
10
11
|
DOM_XML = """
|
@@ -14,6 +15,8 @@ DOM_XML = """
|
|
14
15
|
</ui>
|
15
16
|
"""
|
16
17
|
|
18
|
+
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
19
|
+
|
17
20
|
|
18
21
|
class DeviceLineEditPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
19
22
|
def __init__(self):
|
@@ -28,11 +31,10 @@ class DeviceLineEditPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
28
31
|
return DOM_XML
|
29
32
|
|
30
33
|
def group(self):
|
31
|
-
return "
|
34
|
+
return "Device Control"
|
32
35
|
|
33
36
|
def icon(self):
|
34
|
-
|
35
|
-
icon_path = os.path.join(current_path, "assets", "line_edit_icon.png")
|
37
|
+
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "device_line_edit.png")
|
36
38
|
return QIcon(icon_path)
|
37
39
|
|
38
40
|
def includeFile(self):
|
bec_widgets/widgets/dock/dock.py
CHANGED
@@ -46,7 +46,7 @@ class BECDock(BECWidget, Dock):
|
|
46
46
|
def __init__(
|
47
47
|
self,
|
48
48
|
parent: QWidget | None = None,
|
49
|
-
parent_dock_area:
|
49
|
+
parent_dock_area: QWidget | None = None,
|
50
50
|
config: DockConfig | None = None,
|
51
51
|
name: str | None = None,
|
52
52
|
client=None,
|
@@ -64,6 +64,8 @@ class BECDock(BECWidget, Dock):
|
|
64
64
|
super().__init__(client=client, config=config, gui_id=gui_id)
|
65
65
|
Dock.__init__(self, name=name, **kwargs)
|
66
66
|
|
67
|
+
self.parent_dock_area = parent_dock_area
|
68
|
+
|
67
69
|
# Layout Manager
|
68
70
|
self.layout_manager = GridLayoutManager(self.layout)
|
69
71
|
|
@@ -230,7 +232,7 @@ class BECDock(BECWidget, Dock):
|
|
230
232
|
Remove the dock from the parent dock area.
|
231
233
|
"""
|
232
234
|
# self.cleanup()
|
233
|
-
self.
|
235
|
+
self.parent_dock_area.remove_dock(self.name())
|
234
236
|
|
235
237
|
def cleanup(self):
|
236
238
|
"""
|
@@ -249,3 +251,4 @@ class BECDock(BECWidget, Dock):
|
|
249
251
|
"""
|
250
252
|
self.cleanup()
|
251
253
|
super().close()
|
254
|
+
self.parent_dock_area.dock_area.docks.pop(self.name(), None)
|