bec-widgets 0.87.0__py3-none-any.whl → 0.87.1__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 +18 -18
- PKG-INFO +1 -1
- bec_widgets/examples/jupyter_console/jupyter_console_window.py +1 -2
- bec_widgets/utils/bec_connector.py +19 -18
- bec_widgets/utils/bec_widget.py +19 -4
- bec_widgets/widgets/base_classes/device_input_base.py +3 -5
- bec_widgets/widgets/bec_queue/bec_queue.py +3 -2
- bec_widgets/widgets/bec_status_box/bec_status_box.py +2 -11
- bec_widgets/widgets/device_box/device_box.py +2 -2
- bec_widgets/widgets/device_combobox/device_combobox.py +1 -8
- bec_widgets/widgets/device_line_edit/device_line_edit.py +2 -9
- bec_widgets/widgets/dock/dock.py +8 -6
- bec_widgets/widgets/dock/dock_area.py +4 -2
- bec_widgets/widgets/figure/figure.py +4 -8
- bec_widgets/widgets/figure/plots/image/image.py +1 -4
- bec_widgets/widgets/figure/plots/motor_map/motor_map.py +0 -1
- bec_widgets/widgets/figure/plots/plot_base.py +0 -5
- bec_widgets/widgets/figure/plots/waveform/waveform.py +1 -3
- bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +1 -1
- bec_widgets/widgets/jupyter_console/jupyter_console.py +6 -0
- bec_widgets/widgets/motor_map/motor_map_widget.py +2 -6
- bec_widgets/widgets/ring_progress_bar/ring.py +0 -4
- bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +8 -8
- bec_widgets/widgets/scan_control/scan_control.py +2 -6
- bec_widgets/widgets/stop_button/stop_button.py +2 -2
- bec_widgets/widgets/text_box/text_box.py +3 -2
- bec_widgets/widgets/website/website.py +2 -2
- {bec_widgets-0.87.0.dist-info → bec_widgets-0.87.1.dist-info}/METADATA +1 -1
- {bec_widgets-0.87.0.dist-info → bec_widgets-0.87.1.dist-info}/RECORD +34 -34
- pyproject.toml +1 -1
- tests/unit_tests/test_device_input_base.py +10 -4
- {bec_widgets-0.87.0.dist-info → bec_widgets-0.87.1.dist-info}/WHEEL +0 -0
- {bec_widgets-0.87.0.dist-info → bec_widgets-0.87.1.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.87.0.dist-info → bec_widgets-0.87.1.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.87.1 (2024-07-18)
|
4
|
+
|
5
|
+
### Fix
|
6
|
+
|
7
|
+
* fix(dock): added hasattr to cleanup method for widgets ([`d75c55b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d75c55b2b1ccf156fb789c7813f1c5bdf256f860))
|
8
|
+
|
9
|
+
* fix: add missing close() call, ensure jupyter console client.shutdown() is called in closeEvent ([`e52ee26`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e52ee2604cb35096f1bd833ca9516d8a34197d35))
|
10
|
+
|
11
|
+
* fix: BECWidget checks if it is a widget, and implements closeEvent and cleanup ([`d64758f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d64758f268cad69e6a17bd52dc9913a6367d3cde))
|
12
|
+
|
13
|
+
* fix: add exit handlers for BECConnection objects ([`6202d22`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6202d224fe85c103a4c33bd8c255f18cfd027303))
|
14
|
+
|
15
|
+
### Refactor
|
16
|
+
|
17
|
+
* refactor: BECWidget is a mixin based on BECConnector, for each QWidget in BEC
|
18
|
+
|
19
|
+
Handles closeEvent() and RPC registering/unregistering ([`c7feb69`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c7feb6952d590b569f7b0cba3b019a9af0ce0c93))
|
20
|
+
|
3
21
|
## v0.87.0 (2024-07-17)
|
4
22
|
|
5
23
|
### Feature
|
@@ -118,12 +136,6 @@
|
|
118
136
|
|
119
137
|
* fix(motor_map): bug where motors without limits were selected ([`c78cd89`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c78cd898f203f950d7cb589eb5609feaa88062cf))
|
120
138
|
|
121
|
-
### Refactor
|
122
|
-
|
123
|
-
* refactor(setting_dialog): moved to qt_utils ([`3826bb3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3826bb3d9e870e85709b5b20ef09a4d22641280c))
|
124
|
-
|
125
|
-
* refactor(toolbar): toolbar moved from widgets to qt_utils ([`7ffc06f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7ffc06f3c7ddd86a1681408a75221b9bbadb236b))
|
126
|
-
|
127
139
|
### Test
|
128
140
|
|
129
141
|
* test(setting_dialog): tests added ([`74a249b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/74a249bd065d01006cb532bfff2a9bfedb34b592))
|
@@ -131,15 +143,3 @@
|
|
131
143
|
### Unknown
|
132
144
|
|
133
145
|
* tests(motor_map_widget): tests added ([`734f4c7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/734f4c77507a1edafd477d81b5f7401d8e759be2))
|
134
|
-
|
135
|
-
* feat(settings_dialog):apply button ([`2020953`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2020953b933b6fcad61ecc770588d39518c26fdd))
|
136
|
-
|
137
|
-
## v0.82.0 (2024-07-07)
|
138
|
-
|
139
|
-
### Feature
|
140
|
-
|
141
|
-
* feat(toggle): added angular component-like toggle ([`b9bff38`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b9bff38b64b86f06b3bc047922ef9df0c7d32e71))
|
142
|
-
|
143
|
-
### Refactor
|
144
|
-
|
145
|
-
* refactor(device_input): DeviceComboBox and DeviceLineEdit moved to top layer of widgets ([`f048629`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f04862933f049030554086adef3ec9e1aebd3eda))
|
PKG-INFO
CHANGED
@@ -175,12 +175,11 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
|
|
175
175
|
|
176
176
|
def closeEvent(self, event):
|
177
177
|
"""Override to handle things when main window is closed."""
|
178
|
-
self.dock.clear_all()
|
179
178
|
self.dock.cleanup()
|
180
179
|
self.dock.close()
|
181
|
-
self.figure.clear_all()
|
182
180
|
self.figure.cleanup()
|
183
181
|
self.figure.close()
|
182
|
+
self.console.close()
|
184
183
|
|
185
184
|
super().closeEvent(event)
|
186
185
|
|
@@ -11,10 +11,10 @@ from bec_lib.utils.import_utils import lazy_import_from
|
|
11
11
|
from pydantic import BaseModel, Field, field_validator
|
12
12
|
from qtpy.QtCore import QObject, QRunnable, QThreadPool, Signal
|
13
13
|
from qtpy.QtCore import Slot as pyqtSlot
|
14
|
+
from qtpy.QtWidgets import QApplication
|
14
15
|
|
15
16
|
from bec_widgets.cli.rpc_register import RPCRegister
|
16
17
|
from bec_widgets.qt_utils.error_popups import ErrorPopupUtility
|
17
|
-
from bec_widgets.utils.bec_widget import BECWidget
|
18
18
|
from bec_widgets.utils.yaml_dialog import load_yaml, load_yaml_gui, save_yaml, save_yaml_gui
|
19
19
|
|
20
20
|
BECDispatcher = lazy_import_from("bec_widgets.utils.bec_dispatcher", ("BECDispatcher",))
|
@@ -65,16 +65,30 @@ class Worker(QRunnable):
|
|
65
65
|
self.signals.completed.emit()
|
66
66
|
|
67
67
|
|
68
|
-
class BECConnector
|
69
|
-
"""Connection mixin class
|
68
|
+
class BECConnector:
|
69
|
+
"""Connection mixin class to handle BEC client and device manager"""
|
70
70
|
|
71
71
|
USER_ACCESS = ["_config_dict", "_get_all_rpc"]
|
72
|
+
EXIT_HANDLERS = {}
|
72
73
|
|
73
74
|
def __init__(self, client=None, config: ConnectionConfig = None, gui_id: str = None):
|
74
75
|
# BEC related connections
|
75
76
|
self.bec_dispatcher = BECDispatcher(client=client)
|
76
77
|
self.client = self.bec_dispatcher.client if client is None else client
|
77
78
|
|
79
|
+
if not self.client in BECConnector.EXIT_HANDLERS:
|
80
|
+
# register function to clean connections at exit;
|
81
|
+
# the function depends on BECClient, and BECDispatcher
|
82
|
+
@pyqtSlot()
|
83
|
+
def terminate(client=self.client, dispatcher=self.bec_dispatcher):
|
84
|
+
print("Disconnecting", repr(dispatcher))
|
85
|
+
dispatcher.disconnect_all()
|
86
|
+
print("Shutting down BEC Client", repr(client))
|
87
|
+
client.shutdown()
|
88
|
+
|
89
|
+
BECConnector.EXIT_HANDLERS[self.client] = terminate
|
90
|
+
QApplication.instance().aboutToQuit.connect(terminate)
|
91
|
+
|
78
92
|
if config:
|
79
93
|
self.config = config
|
80
94
|
self.config.widget_class = self.__class__.__name__
|
@@ -92,6 +106,8 @@ class BECConnector(BECWidget):
|
|
92
106
|
self.gui_id = self.config.gui_id
|
93
107
|
|
94
108
|
# register widget to rpc register
|
109
|
+
# be careful: when registering, and the object is not a BECWidget,
|
110
|
+
# cleanup has to called manually since there is no 'closeEvent'
|
95
111
|
self.rpc_register = RPCRegister()
|
96
112
|
self.rpc_register.add_rpc(self)
|
97
113
|
|
@@ -284,18 +300,3 @@ class BECConnector(BECWidget):
|
|
284
300
|
return self.config.model_dump()
|
285
301
|
else:
|
286
302
|
return self.config
|
287
|
-
|
288
|
-
def cleanup(self):
|
289
|
-
"""Cleanup the widget."""
|
290
|
-
self.rpc_register.remove_rpc(self)
|
291
|
-
all_connections = self.rpc_register.list_all_connections()
|
292
|
-
if len(all_connections) == 0:
|
293
|
-
print("No more connections. Shutting down GUI BEC client.")
|
294
|
-
self.bec_dispatcher.disconnect_all()
|
295
|
-
self.client.shutdown()
|
296
|
-
if hasattr(super(), "cleanup"):
|
297
|
-
super().cleanup()
|
298
|
-
|
299
|
-
# def closeEvent(self, event):
|
300
|
-
# self.cleanup()
|
301
|
-
# super().closeEvent(event)
|
bec_widgets/utils/bec_widget.py
CHANGED
@@ -1,8 +1,23 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
from qtpy.QtWidgets import QWidget
|
2
|
+
|
3
|
+
from bec_widgets.utils.bec_connector import BECConnector, ConnectionConfig
|
4
|
+
|
5
|
+
|
6
|
+
class BECWidget(BECConnector):
|
7
|
+
"""Mixin class for all BEC widgets, to handle cleanup"""
|
8
|
+
|
9
|
+
def __init__(self, client=None, config: ConnectionConfig = None, gui_id: str = None):
|
10
|
+
if not isinstance(self, QWidget):
|
11
|
+
raise RuntimeError(f"{repr(self)} is not a subclass of QWidget")
|
12
|
+
super().__init__(client, config, gui_id)
|
13
|
+
|
14
|
+
def cleanup(self):
|
15
|
+
"""Cleanup the widget."""
|
16
|
+
pass
|
3
17
|
|
4
18
|
def closeEvent(self, event):
|
5
|
-
|
19
|
+
self.rpc_register.remove_rpc(self)
|
20
|
+
try:
|
6
21
|
self.cleanup()
|
7
|
-
|
22
|
+
finally:
|
8
23
|
super().closeEvent(event)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
-
from bec_widgets.utils import
|
3
|
+
from bec_widgets.utils import ConnectionConfig
|
4
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
4
5
|
|
5
6
|
|
6
7
|
class DeviceInputConfig(ConnectionConfig):
|
@@ -9,7 +10,7 @@ class DeviceInputConfig(ConnectionConfig):
|
|
9
10
|
arg_name: str | None = None
|
10
11
|
|
11
12
|
|
12
|
-
class DeviceInputBase(
|
13
|
+
class DeviceInputBase(BECWidget):
|
13
14
|
"""
|
14
15
|
Mixin class for device input widgets. This class provides methods to get the device list and device object based
|
15
16
|
on the current text of the widget.
|
@@ -120,6 +121,3 @@ class DeviceInputBase(BECConnector):
|
|
120
121
|
"""
|
121
122
|
if device not in self.get_device_list(self.config.device_filter):
|
122
123
|
raise ValueError(f"Device {device} is not valid.")
|
123
|
-
|
124
|
-
def cleanup(self):
|
125
|
-
super().cleanup()
|
@@ -2,10 +2,11 @@ from bec_lib.endpoints import MessageEndpoints
|
|
2
2
|
from qtpy.QtCore import Qt, Slot
|
3
3
|
from qtpy.QtWidgets import QHeaderView, QTableWidget, QTableWidgetItem, QWidget
|
4
4
|
|
5
|
-
from bec_widgets.utils.bec_connector import
|
5
|
+
from bec_widgets.utils.bec_connector import ConnectionConfig
|
6
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
6
7
|
|
7
8
|
|
8
|
-
class BECQueue(
|
9
|
+
class BECQueue(BECWidget, QTableWidget):
|
9
10
|
"""
|
10
11
|
Widget to display the BEC queue.
|
11
12
|
"""
|
@@ -13,7 +13,7 @@ from bec_lib.utils.import_utils import lazy_import_from
|
|
13
13
|
from qtpy.QtCore import QObject, QTimer, Signal, Slot
|
14
14
|
from qtpy.QtWidgets import QHBoxLayout, QTreeWidget, QTreeWidgetItem, QWidget
|
15
15
|
|
16
|
-
from bec_widgets.utils.
|
16
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
17
17
|
from bec_widgets.utils.colors import apply_theme
|
18
18
|
from bec_widgets.widgets.bec_status_box.status_item import StatusItem
|
19
19
|
|
@@ -57,7 +57,7 @@ class BECServiceStatusMixin(QObject):
|
|
57
57
|
self.services_update.emit(self.client._services_info, self.client._services_metric)
|
58
58
|
|
59
59
|
|
60
|
-
class BECStatusBox(
|
60
|
+
class BECStatusBox(BECWidget, QWidget):
|
61
61
|
"""An autonomous widget to display the status of BEC services.
|
62
62
|
|
63
63
|
Args:
|
@@ -290,15 +290,6 @@ class BECStatusBox(BECConnector, QWidget):
|
|
290
290
|
if objects["item"] == item:
|
291
291
|
objects["widget"].show_popup()
|
292
292
|
|
293
|
-
def closeEvent(self, event):
|
294
|
-
"""Upon closing the widget, clean up the BECStatusBox and the QWidget.
|
295
|
-
|
296
|
-
Args:
|
297
|
-
event: The close event.
|
298
|
-
"""
|
299
|
-
super().cleanup()
|
300
|
-
super().closeEvent(event)
|
301
|
-
|
302
293
|
|
303
294
|
def main():
|
304
295
|
"""Main method to run the BECStatusBox widget."""
|
@@ -8,11 +8,11 @@ from qtpy.QtGui import QDoubleValidator
|
|
8
8
|
from qtpy.QtWidgets import QDoubleSpinBox, QVBoxLayout, QWidget
|
9
9
|
|
10
10
|
from bec_widgets.utils import UILoader
|
11
|
-
from bec_widgets.utils.
|
11
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
12
12
|
from bec_widgets.utils.colors import apply_theme
|
13
13
|
|
14
14
|
|
15
|
-
class DeviceBox(
|
15
|
+
class DeviceBox(BECWidget, QWidget):
|
16
16
|
device_changed = Signal(str, str)
|
17
17
|
|
18
18
|
def __init__(self, parent=None, device=None, *args, **kwargs):
|
@@ -2,6 +2,7 @@ from typing import TYPE_CHECKING
|
|
2
2
|
|
3
3
|
from qtpy.QtWidgets import QComboBox
|
4
4
|
|
5
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
5
6
|
from bec_widgets.widgets.base_classes.device_input_base import DeviceInputBase, DeviceInputConfig
|
6
7
|
|
7
8
|
if TYPE_CHECKING:
|
@@ -82,11 +83,3 @@ class DeviceComboBox(DeviceInputBase, QComboBox):
|
|
82
83
|
if device_obj is None:
|
83
84
|
raise ValueError(f"Device {device_name} is not found.")
|
84
85
|
return device_obj
|
85
|
-
|
86
|
-
def cleanup(self):
|
87
|
-
"""Cleanup the widget."""
|
88
|
-
super().cleanup()
|
89
|
-
|
90
|
-
def closeEvent(self, event):
|
91
|
-
super().cleanup()
|
92
|
-
return QComboBox.closeEvent(self, event)
|
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING
|
|
3
3
|
from qtpy.QtCore import QSize
|
4
4
|
from qtpy.QtWidgets import QCompleter, QLineEdit, QSizePolicy
|
5
5
|
|
6
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
6
7
|
from bec_widgets.widgets.base_classes.device_input_base import DeviceInputBase, DeviceInputConfig
|
7
8
|
|
8
9
|
if TYPE_CHECKING:
|
@@ -33,8 +34,8 @@ class DeviceLineEdit(DeviceInputBase, QLineEdit):
|
|
33
34
|
default: str | None = None,
|
34
35
|
arg_name: str | None = None,
|
35
36
|
):
|
37
|
+
super().__init__(client=client, config=config, gui_id=gui_id)
|
36
38
|
QLineEdit.__init__(self, parent=parent)
|
37
|
-
DeviceInputBase.__init__(self, client=client, config=config, gui_id=gui_id)
|
38
39
|
|
39
40
|
self.completer = QCompleter(self)
|
40
41
|
self.setCompleter(self.completer)
|
@@ -94,11 +95,3 @@ class DeviceLineEdit(DeviceInputBase, QLineEdit):
|
|
94
95
|
if device_obj is None:
|
95
96
|
raise ValueError(f"Device {device_name} is not found.")
|
96
97
|
return device_obj
|
97
|
-
|
98
|
-
def cleanup(self):
|
99
|
-
"""Cleanup the widget."""
|
100
|
-
super().cleanup()
|
101
|
-
|
102
|
-
def closeEvent(self, event):
|
103
|
-
super().cleanup()
|
104
|
-
return QLineEdit.closeEvent(self, event)
|
bec_widgets/widgets/dock/dock.py
CHANGED
@@ -6,7 +6,8 @@ from pydantic import Field
|
|
6
6
|
from pyqtgraph.dockarea import Dock
|
7
7
|
|
8
8
|
from bec_widgets.cli.rpc_wigdet_handler import widget_handler
|
9
|
-
from bec_widgets.utils import
|
9
|
+
from bec_widgets.utils import ConnectionConfig, GridLayoutManager
|
10
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
10
11
|
|
11
12
|
if TYPE_CHECKING:
|
12
13
|
from qtpy.QtWidgets import QWidget
|
@@ -24,7 +25,7 @@ class DockConfig(ConnectionConfig):
|
|
24
25
|
)
|
25
26
|
|
26
27
|
|
27
|
-
class BECDock(
|
28
|
+
class BECDock(BECWidget, Dock):
|
28
29
|
USER_ACCESS = [
|
29
30
|
"_config_dict",
|
30
31
|
"_rpc_id",
|
@@ -91,7 +92,7 @@ class BECDock(BECConnector, Dock):
|
|
91
92
|
super().float()
|
92
93
|
|
93
94
|
@property
|
94
|
-
def widget_list(self) -> list[
|
95
|
+
def widget_list(self) -> list[BECWidget]:
|
95
96
|
"""
|
96
97
|
Get the widgets in the dock.
|
97
98
|
|
@@ -101,7 +102,7 @@ class BECDock(BECConnector, Dock):
|
|
101
102
|
return self.widgets
|
102
103
|
|
103
104
|
@widget_list.setter
|
104
|
-
def widget_list(self, value: list[
|
105
|
+
def widget_list(self, value: list[BECWidget]):
|
105
106
|
self.widgets = value
|
106
107
|
|
107
108
|
def hide_title_bar(self):
|
@@ -153,13 +154,13 @@ class BECDock(BECConnector, Dock):
|
|
153
154
|
|
154
155
|
def add_widget(
|
155
156
|
self,
|
156
|
-
widget:
|
157
|
+
widget: BECWidget | str,
|
157
158
|
row=None,
|
158
159
|
col=0,
|
159
160
|
rowspan=1,
|
160
161
|
colspan=1,
|
161
162
|
shift: Literal["down", "up", "left", "right"] = "down",
|
162
|
-
) ->
|
163
|
+
) -> BECWidget:
|
163
164
|
"""
|
164
165
|
Add a widget to the dock.
|
165
166
|
|
@@ -238,6 +239,7 @@ class BECDock(BECConnector, Dock):
|
|
238
239
|
for widget in self.widgets:
|
239
240
|
if hasattr(widget, "cleanup"):
|
240
241
|
widget.cleanup()
|
242
|
+
self.widgets.clear()
|
241
243
|
super().cleanup()
|
242
244
|
|
243
245
|
def close(self):
|
@@ -9,7 +9,8 @@ from qtpy.QtCore import Qt
|
|
9
9
|
from qtpy.QtGui import QPainter, QPaintEvent
|
10
10
|
from qtpy.QtWidgets import QWidget
|
11
11
|
|
12
|
-
from bec_widgets.utils import
|
12
|
+
from bec_widgets.utils import ConnectionConfig, WidgetContainerUtils
|
13
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
13
14
|
|
14
15
|
from .dock import BECDock, DockConfig
|
15
16
|
|
@@ -21,7 +22,7 @@ class DockAreaConfig(ConnectionConfig):
|
|
21
22
|
)
|
22
23
|
|
23
24
|
|
24
|
-
class BECDockArea(
|
25
|
+
class BECDockArea(BECWidget, DockArea):
|
25
26
|
USER_ACCESS = [
|
26
27
|
"_config_dict",
|
27
28
|
"panels",
|
@@ -227,6 +228,7 @@ class BECDockArea(BECConnector, DockArea):
|
|
227
228
|
self.attach_all()
|
228
229
|
for dock in dict(self.docks).values():
|
229
230
|
dock.remove()
|
231
|
+
self.docks.clear()
|
230
232
|
|
231
233
|
def cleanup(self):
|
232
234
|
"""
|
@@ -12,7 +12,8 @@ from qtpy.QtCore import Signal as pyqtSignal
|
|
12
12
|
from qtpy.QtWidgets import QWidget
|
13
13
|
from typeguard import typechecked
|
14
14
|
|
15
|
-
from bec_widgets.utils import
|
15
|
+
from bec_widgets.utils import ConnectionConfig, WidgetContainerUtils
|
16
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
16
17
|
from bec_widgets.utils.colors import apply_theme
|
17
18
|
from bec_widgets.widgets.figure.plots.image.image import BECImageShow, ImageConfig
|
18
19
|
from bec_widgets.widgets.figure.plots.motor_map.motor_map import BECMotorMap, MotorMapConfig
|
@@ -108,7 +109,7 @@ class WidgetHandler:
|
|
108
109
|
return widget
|
109
110
|
|
110
111
|
|
111
|
-
class BECFigure(
|
112
|
+
class BECFigure(BECWidget, pg.GraphicsLayoutWidget):
|
112
113
|
USER_ACCESS = [
|
113
114
|
"_rpc_id",
|
114
115
|
"_config_dict",
|
@@ -728,14 +729,9 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
|
|
728
729
|
"""Clear all widgets from the figure and reset to default state"""
|
729
730
|
for widget in list(self._widgets.values()):
|
730
731
|
widget.remove()
|
731
|
-
|
732
|
-
self._widgets = defaultdict(dict)
|
732
|
+
self._widgets.clear()
|
733
733
|
self.grid = []
|
734
734
|
theme = self.config.theme
|
735
735
|
self.config = FigureConfig(
|
736
736
|
widget_class=self.__class__.__name__, gui_id=self.gui_id, theme=theme
|
737
737
|
)
|
738
|
-
|
739
|
-
# def cleanup(self):
|
740
|
-
# self.clear_all()
|
741
|
-
# super().cleanup()
|
@@ -296,9 +296,4 @@ class BECPlotBase(BECConnector, pg.GraphicsLayout):
|
|
296
296
|
def remove(self):
|
297
297
|
"""Remove the plot widget from the figure."""
|
298
298
|
if self.figure is not None:
|
299
|
-
self.cleanup()
|
300
299
|
self.figure.remove(widget_id=self.gui_id)
|
301
|
-
|
302
|
-
def cleanup(self):
|
303
|
-
"""Cleanup the plot widget."""
|
304
|
-
super().cleanup()
|
@@ -10,6 +10,7 @@ class BECJupyterConsole(RichJupyterWidget): # pragma: no cover:
|
|
10
10
|
super().__init__()
|
11
11
|
|
12
12
|
self.inprocess = None
|
13
|
+
self.client = None
|
13
14
|
|
14
15
|
self.kernel_manager, self.kernel_client = self._init_kernel(inprocess=inprocess)
|
15
16
|
self.set_default_style("linux")
|
@@ -60,6 +61,11 @@ class BECJupyterConsole(RichJupyterWidget): # pragma: no cover:
|
|
60
61
|
self.kernel_client.stop_channels()
|
61
62
|
self.kernel_manager.shutdown_kernel()
|
62
63
|
|
64
|
+
def closeEvent(self, event):
|
65
|
+
self.shutdown_kernel()
|
66
|
+
if self.client:
|
67
|
+
self.client.shutdown()
|
68
|
+
|
63
69
|
|
64
70
|
if __name__ == "__main__": # pragma: no cover
|
65
71
|
import sys
|
@@ -6,7 +6,7 @@ from qtpy.QtWidgets import QVBoxLayout, QWidget
|
|
6
6
|
|
7
7
|
from bec_widgets.qt_utils.settings_dialog import SettingsDialog
|
8
8
|
from bec_widgets.qt_utils.toolbar import ModularToolBar
|
9
|
-
from bec_widgets.utils import
|
9
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
10
10
|
from bec_widgets.widgets.figure import BECFigure
|
11
11
|
from bec_widgets.widgets.figure.plots.motor_map.motor_map import MotorMapConfig
|
12
12
|
from bec_widgets.widgets.motor_map.motor_map_dialog.motor_map_settings import MotorMapSettings
|
@@ -18,7 +18,7 @@ from bec_widgets.widgets.motor_map.motor_map_dialog.motor_map_toolbar import (
|
|
18
18
|
)
|
19
19
|
|
20
20
|
|
21
|
-
class BECMotorMapWidget(
|
21
|
+
class BECMotorMapWidget(BECWidget, QWidget):
|
22
22
|
USER_ACCESS = [
|
23
23
|
"change_motors",
|
24
24
|
"set_max_points",
|
@@ -208,10 +208,6 @@ class BECMotorMapWidget(BECConnector, QWidget):
|
|
208
208
|
self.toolbar.widgets["motor_y"].device_combobox.cleanup()
|
209
209
|
return super().cleanup()
|
210
210
|
|
211
|
-
def closeEvent(self, event):
|
212
|
-
self.cleanup()
|
213
|
-
QWidget().closeEvent(event)
|
214
|
-
|
215
211
|
|
216
212
|
def main(): # pragma: no cover
|
217
213
|
from qtpy.QtWidgets import QApplication
|
@@ -10,7 +10,8 @@ from qtpy import QtCore, QtGui
|
|
10
10
|
from qtpy.QtCore import QSize, Slot
|
11
11
|
from qtpy.QtWidgets import QSizePolicy, QWidget
|
12
12
|
|
13
|
-
from bec_widgets.utils import
|
13
|
+
from bec_widgets.utils import Colors, ConnectionConfig, EntryValidator
|
14
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
14
15
|
from bec_widgets.widgets.ring_progress_bar.ring import Ring, RingConfig
|
15
16
|
|
16
17
|
|
@@ -66,7 +67,7 @@ class RingProgressBarConfig(ConnectionConfig):
|
|
66
67
|
_validate_colormap = field_validator("color_map")(Colors.validate_color_map)
|
67
68
|
|
68
69
|
|
69
|
-
class RingProgressBar(
|
70
|
+
class RingProgressBar(BECWidget, QWidget):
|
70
71
|
USER_ACCESS = [
|
71
72
|
"_get_all_rpc",
|
72
73
|
"_rpc_id",
|
@@ -208,7 +209,7 @@ class RingProgressBar(BECConnector, QWidget):
|
|
208
209
|
index(int): Index of the progress bar to remove.
|
209
210
|
"""
|
210
211
|
ring = self._find_ring_by_index(index)
|
211
|
-
ring.
|
212
|
+
ring.reset_connection()
|
212
213
|
self._rings.remove(ring)
|
213
214
|
self.config.rings.remove(ring.config)
|
214
215
|
self.config.num_bars -= 1
|
@@ -622,9 +623,8 @@ class RingProgressBar(BECConnector, QWidget):
|
|
622
623
|
|
623
624
|
def clear_all(self):
|
624
625
|
for ring in self._rings:
|
625
|
-
ring.
|
626
|
-
|
627
|
-
self._rings = []
|
626
|
+
ring.reset_connection()
|
627
|
+
self._rings.clear()
|
628
628
|
self.update()
|
629
629
|
self.initialize_bars()
|
630
630
|
|
@@ -633,6 +633,6 @@ class RingProgressBar(BECConnector, QWidget):
|
|
633
633
|
self.on_scan_queue_status, MessageEndpoints.scan_queue_status()
|
634
634
|
)
|
635
635
|
for ring in self._rings:
|
636
|
-
ring.
|
637
|
-
|
636
|
+
ring.reset_connection()
|
637
|
+
self._rings.clear()
|
638
638
|
super().cleanup()
|
@@ -10,13 +10,13 @@ from qtpy.QtWidgets import (
|
|
10
10
|
QWidget,
|
11
11
|
)
|
12
12
|
|
13
|
-
from bec_widgets.utils import
|
13
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
14
14
|
from bec_widgets.utils.colors import apply_theme
|
15
15
|
from bec_widgets.widgets.scan_control.scan_group_box import ScanGroupBox
|
16
16
|
from bec_widgets.widgets.stop_button.stop_button import StopButton
|
17
17
|
|
18
18
|
|
19
|
-
class ScanControl(
|
19
|
+
class ScanControl(BECWidget, QWidget):
|
20
20
|
|
21
21
|
def __init__(
|
22
22
|
self, parent=None, client=None, gui_id: str | None = None, allowed_scans: list | None = None
|
@@ -196,10 +196,6 @@ class ScanControl(BECConnector, QWidget):
|
|
196
196
|
widget.cleanup()
|
197
197
|
super().cleanup()
|
198
198
|
|
199
|
-
def closeEvent(self, event):
|
200
|
-
self.cleanup()
|
201
|
-
return QWidget.closeEvent(self, event)
|
202
|
-
|
203
199
|
|
204
200
|
# Application example
|
205
201
|
if __name__ == "__main__": # pragma: no cover
|
@@ -1,10 +1,10 @@
|
|
1
1
|
from qtpy.QtCore import Slot
|
2
2
|
from qtpy.QtWidgets import QPushButton
|
3
3
|
|
4
|
-
from bec_widgets.utils import
|
4
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
5
5
|
|
6
6
|
|
7
|
-
class StopButton(
|
7
|
+
class StopButton(BECWidget, QPushButton):
|
8
8
|
"""A button that stops the current scan."""
|
9
9
|
|
10
10
|
def __init__(self, parent=None, client=None, config=None, gui_id=None):
|
@@ -3,7 +3,8 @@ import re
|
|
3
3
|
from pydantic import Field, field_validator
|
4
4
|
from qtpy.QtWidgets import QTextEdit
|
5
5
|
|
6
|
-
from bec_widgets.utils.bec_connector import
|
6
|
+
from bec_widgets.utils.bec_connector import ConnectionConfig
|
7
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
7
8
|
from bec_widgets.utils.colors import Colors
|
8
9
|
|
9
10
|
|
@@ -27,7 +28,7 @@ class TextBoxConfig(ConnectionConfig):
|
|
27
28
|
_validate_background_color = field_validator("background_color")(Colors.validate_color)
|
28
29
|
|
29
30
|
|
30
|
-
class TextBox(
|
31
|
+
class TextBox(BECWidget, QTextEdit):
|
31
32
|
|
32
33
|
USER_ACCESS = ["set_color", "set_text", "set_font_size"]
|
33
34
|
|
@@ -2,7 +2,7 @@ from qtpy.QtCore import QUrl, qInstallMessageHandler
|
|
2
2
|
from qtpy.QtWebEngineWidgets import QWebEngineView
|
3
3
|
from qtpy.QtWidgets import QApplication
|
4
4
|
|
5
|
-
from bec_widgets.utils import
|
5
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
6
6
|
|
7
7
|
|
8
8
|
def suppress_qt_messages(type_, context, msg):
|
@@ -14,7 +14,7 @@ def suppress_qt_messages(type_, context, msg):
|
|
14
14
|
qInstallMessageHandler(suppress_qt_messages)
|
15
15
|
|
16
16
|
|
17
|
-
class WebsiteWidget(
|
17
|
+
class WebsiteWidget(BECWidget, QWebEngineView):
|
18
18
|
"""
|
19
19
|
A simple widget to display a website
|
20
20
|
"""
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=zvb4A6QI5lQTsdfI5nPPL-tUNfcrz__SQjxW03QZ5Ek,8204
|
3
3
|
.pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=DHDSoGZOCoZjI-CEp37DLRfeLqF_bTk0Yv7-iwOMO7w,7594
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=uf6VZhm8oYlix039uTAh7h25FVrbcp-7tyKsdhkzBWQ,1308
|
8
8
|
README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=yigjcoxWR_c6n-pJRnrcIkOqYVZO4Shu2aX6jvEGwOo,2357
|
10
10
|
.git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
|
11
11
|
.gitlab/issue_templates/bug_report_template.md,sha256=gAuyEwl7XlnebBrkiJ9AqffSNOywmr8vygUFWKTuQeI,386
|
12
12
|
.gitlab/issue_templates/documentation_update_template.md,sha256=FHLdb3TS_D9aL4CYZCjyXSulbaW5mrN2CmwTaeLPbNw,860
|
@@ -25,7 +25,7 @@ bec_widgets/cli/rpc_wigdet_handler.py,sha256=6kQng2DyS6rhLJqSJ7xa0kdgSxp-35A2upc
|
|
25
25
|
bec_widgets/cli/server.py,sha256=FZkqsjUHIkCUFMKUFm7ls_eslXvhIFzLpINEYxeWP5s,7722
|
26
26
|
bec_widgets/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
27
|
bec_widgets/examples/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
|
-
bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=
|
28
|
+
bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=MgIw-2l6vxOjN5qR-jOkWaWsaqi-SRFoIxI52Wt9cXg,6605
|
29
29
|
bec_widgets/examples/plugin_example_pyside/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
30
|
bec_widgets/examples/plugin_example_pyside/main.py,sha256=xdC6RWSRt1rW8Prj0CsDeCPct6-_j3__oJmdgogB5PI,505
|
31
31
|
bec_widgets/examples/plugin_example_pyside/registertictactoe.py,sha256=VNFkHc5Sc30lRKzOFJbhArCHGkp_wRxOeJjZbmaAHRU,448
|
@@ -38,11 +38,11 @@ bec_widgets/qt_utils/error_popups.py,sha256=WAN3Qtccy9Yww29kZ3HbLt9VyipgrIamJ6y4
|
|
38
38
|
bec_widgets/qt_utils/settings_dialog.py,sha256=rR_Zk4RGTnI4dz5OEzCc13lVpxlOKuwOf4_7wqXSbRw,3373
|
39
39
|
bec_widgets/qt_utils/toolbar.py,sha256=yzxCmZ7c00B2JD1TkUpPeQgM_-v7zuTYe38Qkw_yvrc,2430
|
40
40
|
bec_widgets/utils/__init__.py,sha256=1930ji1Jj6dVuY81Wd2kYBhHYNV-2R0bN_L4o9zBj1U,533
|
41
|
-
bec_widgets/utils/bec_connector.py,sha256=
|
41
|
+
bec_widgets/utils/bec_connector.py,sha256=UK0GIWgcC_JTwgKCOmmuXnQvSwD3wiPsJQw6NBW3p74,9961
|
42
42
|
bec_widgets/utils/bec_designer.py,sha256=ak3G8FdojUPjVBBwdPXw7tN5P2Uxr-SSoQt394jXeAA,4308
|
43
43
|
bec_widgets/utils/bec_dispatcher.py,sha256=fhI7_X0kSZCtXyR55Qn-w7BfNdk2Roc1Tyx0bx3bjoE,6195
|
44
44
|
bec_widgets/utils/bec_table.py,sha256=nA2b8ukSeUfquFMAxGrUVOqdrzMoDYD6O_4EYbOG2zk,717
|
45
|
-
bec_widgets/utils/bec_widget.py,sha256=
|
45
|
+
bec_widgets/utils/bec_widget.py,sha256=Bo2v1aP7rgSAQajW8GBJbI3iovTn_hGCsmeFMo7bT10,707
|
46
46
|
bec_widgets/utils/colors.py,sha256=RAGaA4jdvsFSxGlbhSBYL5mdlwS-9rq45tJM7U-7xXs,10587
|
47
47
|
bec_widgets/utils/container_utils.py,sha256=m3VUyAYmSWkEwApP9tBvKxPYVtc2kHw4toxIpMryJy4,1495
|
48
48
|
bec_widgets/utils/crosshair.py,sha256=SubY4FQCI6vUKsmMYGKHR7uYdGQJ6vhoYLuC1XlKS9I,9626
|
@@ -61,14 +61,14 @@ bec_widgets/utils/plugin_templates/plugin.template,sha256=JHkUvYegesW-xEhZuY4FQV
|
|
61
61
|
bec_widgets/utils/plugin_templates/register.template,sha256=XyL3OZPT_FTArLAM8tHd5qMqv2ZuAbJAZLsNNnHcagU,417
|
62
62
|
bec_widgets/widgets/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
63
63
|
bec_widgets/widgets/base_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
64
|
-
bec_widgets/widgets/base_classes/device_input_base.py,sha256=
|
64
|
+
bec_widgets/widgets/base_classes/device_input_base.py,sha256=thCOHOa9Z0b3-vlNFWK6PT_DdPTANnfj0_DLES_K-eE,3902
|
65
65
|
bec_widgets/widgets/bec_queue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
66
|
-
bec_widgets/widgets/bec_queue/bec_queue.py,sha256=
|
66
|
+
bec_widgets/widgets/bec_queue/bec_queue.py,sha256=n3WMmHvKt4VB2dOud6EIiTYlXpnNUUHh1dXgvR7lYyc,3585
|
67
67
|
bec_widgets/widgets/bec_queue/bec_queue.pyproject,sha256=VhoNmAv1DQUl9dg7dELyf5i4pZ5k65N3GnqOYiSwbQo,27
|
68
68
|
bec_widgets/widgets/bec_queue/bec_queue_plugin.py,sha256=hDJm8Zd_GIDw2R8VYn4ytwrHVCmJUjC9dGDMae2omU0,1175
|
69
69
|
bec_widgets/widgets/bec_queue/register_bec_queue.py,sha256=XnwtUSa1asK1b80knKWodcyX9qJy4DnKsQL_FoDfZy4,463
|
70
70
|
bec_widgets/widgets/bec_status_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
71
|
-
bec_widgets/widgets/bec_status_box/bec_status_box.py,sha256=
|
71
|
+
bec_widgets/widgets/bec_status_box/bec_status_box.py,sha256=3oWNoP7HJaJ-qNeMersoL2dbLcYaLW-PX-7r-d8LK80,12798
|
72
72
|
bec_widgets/widgets/bec_status_box/bec_status_box.pyproject,sha256=JWtx3Csfn2h7ODtk10HtyBNLf6tFIqyU6g04rMWOO1U,32
|
73
73
|
bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py,sha256=CNFIETpkORLQ9J3l91jefiRLJs5Ru3nsWIPoUwaRbB0,1242
|
74
74
|
bec_widgets/widgets/bec_status_box/register_bec_status_box.py,sha256=EiQITnkNw7IU7hE776wAeXro97eZd9XlsB9essgCebE,481
|
@@ -87,47 +87,47 @@ bec_widgets/widgets/color_map_selector/register_color_map_selector.py,sha256=crZ
|
|
87
87
|
bec_widgets/widgets/color_map_selector/assets/color_map_selector_icon.png,sha256=o8zRmMvXhGhMyBklH_Vfjn-jpDL4Nw03fLqDk_wx_JI,11975
|
88
88
|
bec_widgets/widgets/console/console.py,sha256=IW1OerycmS-cm8CKGFig44Qye8mxsmVcKvLHAc3lXco,17845
|
89
89
|
bec_widgets/widgets/device_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
90
|
-
bec_widgets/widgets/device_box/device_box.py,sha256=
|
90
|
+
bec_widgets/widgets/device_box/device_box.py,sha256=2hWCbDaBvYnWK4-HDqeYetzb5KR4DBk7UPQJMLhT4w0,6929
|
91
91
|
bec_widgets/widgets/device_box/device_box.pyproject,sha256=jtwvhaySJRdnuV99mEZT3htmWKVLphFeetEW4al7s-o,28
|
92
92
|
bec_widgets/widgets/device_box/device_box.ui,sha256=z7j60J4ZKYjH9eyHl6FnZ_Z8lkdq1LQftxveSZQ6g_w,4865
|
93
93
|
bec_widgets/widgets/device_box/device_box_plugin.py,sha256=n7l3OIKqtQGsL86ygDekb0wb4bBySJXMUo58eTtKIdQ,1212
|
94
94
|
bec_widgets/widgets/device_box/register_device_box.py,sha256=K7Hx4FIQDXasejaw6njwkFkkkwk63Smm6pHoOEdLWPw,467
|
95
95
|
bec_widgets/widgets/device_combobox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
96
|
-
bec_widgets/widgets/device_combobox/device_combobox.py,sha256=
|
96
|
+
bec_widgets/widgets/device_combobox/device_combobox.py,sha256=9tuutN5yp0Kv6Jl6QPKO3OcMI1HBYSZhD2mlNI8rH4s,2682
|
97
97
|
bec_widgets/widgets/device_combobox/device_combobox.pyproject,sha256=wI2eXR5ky_IM9-BCHJnH_9CEqYcZwIuLcgitSEr8OJU,40
|
98
98
|
bec_widgets/widgets/device_combobox/device_combobox_plugin.py,sha256=CQszPKVXoa4wRxucQjVIqblP5rtGvwWn8FZOR_OE_-o,1406
|
99
99
|
bec_widgets/widgets/device_combobox/register_device_combobox.py,sha256=xzz2qM82cgFIrj77c9zyUpJ-1QHZRMrLkyeq8uGNsmE,487
|
100
100
|
bec_widgets/widgets/device_combobox/assets/device_combobox_icon.png,sha256=ydC7WZmoU-UjjIOGFuUIDjQ30p4L66si2emHawc_inU,2592
|
101
101
|
bec_widgets/widgets/device_line_edit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
102
|
-
bec_widgets/widgets/device_line_edit/device_line_edit.py,sha256=
|
102
|
+
bec_widgets/widgets/device_line_edit/device_line_edit.py,sha256=iKK2NrVu4okWP8kxPU5whmo_y5VHtrD7Fd_q3ZgXN1Y,3221
|
103
103
|
bec_widgets/widgets/device_line_edit/device_line_edit.pyproject,sha256=tqAYXRbxsHR41MwqmAxvfq1CFeZ1IRv84whUG67HjjE,41
|
104
104
|
bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py,sha256=7aJR2jsEdbq2UuH9p-7lqKzndkrtY4ZcqnNLIVc7rzk,1423
|
105
105
|
bec_widgets/widgets/device_line_edit/register_device_line_edit.py,sha256=8gEPnC8djYCw-idoZAENNB3bPOxM6pbzEp9A366EAGg,489
|
106
106
|
bec_widgets/widgets/device_line_edit/assets/line_edit_icon.png,sha256=nxVykqQY4kgMJP7GELzv6N_dghqIzBJb2MWqxs4B-Ug,3391
|
107
107
|
bec_widgets/widgets/dock/__init__.py,sha256=B7foHt02gnhM7mFksa7GJVwT7n0j_JvYDCt6wc6XR5g,61
|
108
|
-
bec_widgets/widgets/dock/dock.py,sha256=
|
109
|
-
bec_widgets/widgets/dock/dock_area.py,sha256=
|
108
|
+
bec_widgets/widgets/dock/dock.py,sha256=2KJCLGIqmuMBOYVZCfJMFfYW3IXsIO0SuyebI_ktZKg,7648
|
109
|
+
bec_widgets/widgets/dock/dock_area.py,sha256=Sv4SEntiJ67VNnup5XfZpBIIHBxyuRvYZigUXKf9E3E,7974
|
110
110
|
bec_widgets/widgets/figure/__init__.py,sha256=3hGx_KOV7QHCYAV06aNuUgKq4QIYCjUTad-DrwkUaBM,44
|
111
|
-
bec_widgets/widgets/figure/figure.py,sha256=
|
111
|
+
bec_widgets/widgets/figure/figure.py,sha256=hQFru88kvzW-MWSrcdrfglwaOXDxUAPaMSQxr4G1w2E,28438
|
112
112
|
bec_widgets/widgets/figure/plots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
113
113
|
bec_widgets/widgets/figure/plots/axis_settings.py,sha256=CCvJwo1RjpnLJG9TmGqf9fyPpUNyLT8k7pPEnqVuaGM,2281
|
114
114
|
bec_widgets/widgets/figure/plots/axis_settings.ui,sha256=zMKZK6lH_3KJGO4RA_paXAH7UzZJ4Snlil3MK4pK3L8,11589
|
115
|
-
bec_widgets/widgets/figure/plots/plot_base.py,sha256=
|
115
|
+
bec_widgets/widgets/figure/plots/plot_base.py,sha256=TmXUO4445xjl-jwJh3t0FoFp01yThEg7eTRdPnwdrOw,10304
|
116
116
|
bec_widgets/widgets/figure/plots/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
117
|
-
bec_widgets/widgets/figure/plots/image/image.py,sha256=
|
117
|
+
bec_widgets/widgets/figure/plots/image/image.py,sha256=xJJsfKJL7wBv_3U4-aT5ApX84t4-_8LLGARepQEnI2U,21276
|
118
118
|
bec_widgets/widgets/figure/plots/image/image_item.py,sha256=TyarahdWEn0jgalj5fqSAmcznXSbENkqHrrlL2GVdU4,10558
|
119
119
|
bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=GeTtWjbldy6VejMwPGQgM-o3d6bmLglCjdoktu19xfA,5262
|
120
120
|
bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
121
|
-
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=
|
121
|
+
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=ZOF5-ZT61kHR_yXJVFSm76bObd_2Fe4kxycO3Lbh6_Q,18184
|
122
122
|
bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
123
|
-
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=
|
124
|
-
bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=
|
123
|
+
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=CdhkIpJyy70L_PjuQ7GWLwWIFg0QkQkvn1AIgIZWiT4,52308
|
124
|
+
bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=1E0ytu_K_d-LohRWe3osz2vzh_rzk0SaujFHfzca4zM,8456
|
125
125
|
bec_widgets/widgets/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
126
|
-
bec_widgets/widgets/jupyter_console/jupyter_console.py,sha256=
|
126
|
+
bec_widgets/widgets/jupyter_console/jupyter_console.py,sha256=mBKM89H6SuHuFy1lQg1n8s1gQiN5QEkZf0xua8aPDns,2402
|
127
127
|
bec_widgets/widgets/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
128
128
|
bec_widgets/widgets/motor_map/bec_motor_map_widget.pyproject,sha256=NAI8s5gRKz80ED4KY7OgD2OgSH5HEsjt2ux2BYp66yg,63
|
129
129
|
bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py,sha256=PIfDE78Zqvsu7-xwoh9DdYkH8a7eOUFSaEl0bNrHYHc,1292
|
130
|
-
bec_widgets/widgets/motor_map/motor_map_widget.py,sha256=
|
130
|
+
bec_widgets/widgets/motor_map/motor_map_widget.py,sha256=m-cMo8h5WzLgr64AN5f5eYxaQf7oF1NiE4omPW2T5Go,7155
|
131
131
|
bec_widgets/widgets/motor_map/register_bec_motor_map_widget.py,sha256=qRG8PtWGjso0pWbvj_DXKnbUfmQzfGqPSrnAozXfM7o,492
|
132
132
|
bec_widgets/widgets/motor_map/assets/connection.svg,sha256=czIb1BnshmxJnER8ssU3WcLENrFSIUfMwberajWOGAk,341
|
133
133
|
bec_widgets/widgets/motor_map/assets/history.svg,sha256=bd6p5saxRiNRpd5OsSwIOvRWvel0WFEHul9zw4y9vH0,392
|
@@ -142,10 +142,10 @@ bec_widgets/widgets/position_indicator/position_indicator.pyproject,sha256=s0JEf
|
|
142
142
|
bec_widgets/widgets/position_indicator/position_indicator_plugin.py,sha256=h9EQU4t6KdKVAZh5ILalpl1K8b7JMHf-2AFYREej2-w,1241
|
143
143
|
bec_widgets/widgets/position_indicator/register_position_indicator.py,sha256=OZNiMgM_80TPSAXK_0hXAkne4vUh8DGvh_OdpOiMpwI,516
|
144
144
|
bec_widgets/widgets/ring_progress_bar/__init__.py,sha256=_uoJKnDM2YAeUBfwc5WLbIHSJj7zm_FAurSKP3WRaCw,47
|
145
|
-
bec_widgets/widgets/ring_progress_bar/ring.py,sha256=
|
146
|
-
bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py,sha256=
|
145
|
+
bec_widgets/widgets/ring_progress_bar/ring.py,sha256=2pdEzETaJpvx4Dzyosq2YhnvDOEUvFnj_f9GfFKpG5Q,11159
|
146
|
+
bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py,sha256=F7z6BbY7BYSKivpCus6T8pXIwzqHOsDlaIV5fGRIboQ,24119
|
147
147
|
bec_widgets/widgets/scan_control/__init__.py,sha256=IOfHl15vxb_uC6KN62-PeUzbBha_vQyqkkXbJ2HU674,38
|
148
|
-
bec_widgets/widgets/scan_control/scan_control.py,sha256=
|
148
|
+
bec_widgets/widgets/scan_control/scan_control.py,sha256=YT3Vvy27_FY3UY7IXvy87o9ZB_syauuEKzkJFOpbP4s,7610
|
149
149
|
bec_widgets/widgets/scan_control/scan_group_box.py,sha256=wrrJLfI0apfll0NKpqM8ymlbl5NaqA9cKNgyfVdYR00,7420
|
150
150
|
bec_widgets/widgets/spinner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
151
151
|
bec_widgets/widgets/spinner/register_spinner_widget.py,sha256=_zCPjLh4M7NTSHP1Atdn6yu33zJ3LJkcBy3KOJ5eSVY,476
|
@@ -154,12 +154,12 @@ bec_widgets/widgets/spinner/spinner_widget.pyproject,sha256=zzLajGB3DTgVnrSqMey2
|
|
154
154
|
bec_widgets/widgets/spinner/spinner_widget_plugin.py,sha256=ZcG1QIwpbriapM5ZrR4gQ-WA2a7ARhsstk8EIY-OGTU,1187
|
155
155
|
bec_widgets/widgets/stop_button/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
156
156
|
bec_widgets/widgets/stop_button/register_stop_button.py,sha256=U7r3fEOH-uPhAQI-nTituHXDDXDWR4JQZ7_vD6b_dfM,471
|
157
|
-
bec_widgets/widgets/stop_button/stop_button.py,sha256=
|
157
|
+
bec_widgets/widgets/stop_button/stop_button.py,sha256=_2vNytWjf-pKqyv5wT8j5NSA_4z9Zyk4aBnkEvU8_dA,798
|
158
158
|
bec_widgets/widgets/stop_button/stop_button.pyproject,sha256=Cc_xbv-zfzNVpsdg_1QyzuTlrJaM9_BkIjes70umrx0,29
|
159
159
|
bec_widgets/widgets/stop_button/stop_button_plugin.py,sha256=-90MqPp1cFumsrHGaFgc_nahdCoew98M5bS1oqSRhDk,1346
|
160
160
|
bec_widgets/widgets/stop_button/assets/stop.png,sha256=9nGdvR-qwOz1YP4xYoBjmDnnj9ns2cLLhfvTz9amyKc,8424
|
161
161
|
bec_widgets/widgets/text_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
162
|
-
bec_widgets/widgets/text_box/text_box.py,sha256=
|
162
|
+
bec_widgets/widgets/text_box/text_box.py,sha256=3OWC6L3CWsH_uh8X11WnifYjhO8ruDe2FWFhE8cn5lY,4274
|
163
163
|
bec_widgets/widgets/toggle/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
164
164
|
bec_widgets/widgets/toggle/register_toggle_switch.py,sha256=8pVtkeEeiDOjV4OPoZq1I30F9JDzl4nQE7e7xoWyWBs,472
|
165
165
|
bec_widgets/widgets/toggle/toggle.py,sha256=JzCGYoyHBrlBWCoyL94QX4zSLyEwWbCNHMegjlnSy2E,4442
|
@@ -168,7 +168,7 @@ bec_widgets/widgets/toggle/toggle_switch_plugin.py,sha256=8e8JjUx6T5CIx7ixWLwVdT
|
|
168
168
|
bec_widgets/widgets/vscode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
169
169
|
bec_widgets/widgets/vscode/vscode.py,sha256=yV1D9PK2IYomq9yYfwqUOrZGIeBwMnNuBfXxBc2M8Qc,2231
|
170
170
|
bec_widgets/widgets/website/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
171
|
-
bec_widgets/widgets/website/website.py,sha256
|
171
|
+
bec_widgets/widgets/website/website.py,sha256=FmhVaasAU3ZSdKP-HHSnJHFbG8lIsNAPH9pZq55fhic,1731
|
172
172
|
docs/Makefile,sha256=i2WHuFlgfyAPEW4ssEP8NY4cOibDJrVjvzSEU8_Ggwc,634
|
173
173
|
docs/conf.py,sha256=HxLxupNGu0Smhwn57g1kFdjZzFuaWVREgRJKhT1zi2k,2464
|
174
174
|
docs/index.md,sha256=8ZCgaLIbJsYvt-jwi--QxsNwnK4-k3rejIeOOLclG40,1101
|
@@ -244,7 +244,7 @@ tests/unit_tests/test_color_map_selector.py,sha256=NVnKrz5kFUKgljm7HslIpMII-IpzP
|
|
244
244
|
tests/unit_tests/test_color_validation.py,sha256=xbFbtFDia36XLgaNrX2IwvAX3IDC_Odpj5BGoJSgiIE,2389
|
245
245
|
tests/unit_tests/test_crosshair.py,sha256=3OMAJ2ZaISYXMOtkXf1rPdy94vCr8njeLi6uHblBL9Q,5045
|
246
246
|
tests/unit_tests/test_device_box.py,sha256=q9IVFpt1NF3TBF0Jhk-I-LRiuvvHG3FGUalw4jEYwVo,3431
|
247
|
-
tests/unit_tests/test_device_input_base.py,sha256=
|
247
|
+
tests/unit_tests/test_device_input_base.py,sha256=Unw-CdRwXYdHBKRDWOEYoenLBjtFktbrzpjUx3lFIkM,2601
|
248
248
|
tests/unit_tests/test_device_input_widgets.py,sha256=39MtgF-Q67UWz6qapyYP4ukDEUOD81iEJ_jhATyG7dM,5889
|
249
249
|
tests/unit_tests/test_error_utils.py,sha256=LQOxz29WCGOe0qwFkaPDixjUmdnF3qeAGxD4A3t9IKg,2108
|
250
250
|
tests/unit_tests/test_generate_cli_client.py,sha256=ng-eV5iF7Dhm-6YpxYo99CMY0KgqoaZBQNkMeKULDBU,3355
|
@@ -273,8 +273,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
273
273
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
274
274
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
275
275
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
276
|
-
bec_widgets-0.87.
|
277
|
-
bec_widgets-0.87.
|
278
|
-
bec_widgets-0.87.
|
279
|
-
bec_widgets-0.87.
|
280
|
-
bec_widgets-0.87.
|
276
|
+
bec_widgets-0.87.1.dist-info/METADATA,sha256=uf6VZhm8oYlix039uTAh7h25FVrbcp-7tyKsdhkzBWQ,1308
|
277
|
+
bec_widgets-0.87.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
278
|
+
bec_widgets-0.87.1.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
|
279
|
+
bec_widgets-0.87.1.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
280
|
+
bec_widgets-0.87.1.dist-info/RECORD,,
|
pyproject.toml
CHANGED
@@ -1,13 +1,19 @@
|
|
1
1
|
import pytest
|
2
|
+
from qtpy.QtWidgets import QWidget
|
2
3
|
|
3
4
|
from bec_widgets.widgets.base_classes.device_input_base import DeviceInputBase
|
4
5
|
|
5
6
|
from .client_mocks import mocked_client
|
6
7
|
|
7
8
|
|
9
|
+
# DeviceInputBase is meant to be mixed in a QWidget
|
10
|
+
class DeviceInputWidget(DeviceInputBase, QWidget):
|
11
|
+
pass
|
12
|
+
|
13
|
+
|
8
14
|
@pytest.fixture
|
9
15
|
def device_input_base(mocked_client):
|
10
|
-
widget =
|
16
|
+
widget = DeviceInputWidget(client=mocked_client)
|
11
17
|
yield widget
|
12
18
|
|
13
19
|
|
@@ -15,7 +21,7 @@ def test_device_input_base_init(device_input_base):
|
|
15
21
|
assert device_input_base is not None
|
16
22
|
assert device_input_base.client is not None
|
17
23
|
assert isinstance(device_input_base, DeviceInputBase)
|
18
|
-
assert device_input_base.config.widget_class == "
|
24
|
+
assert device_input_base.config.widget_class == "DeviceInputWidget"
|
19
25
|
assert device_input_base.config.device_filter is None
|
20
26
|
assert device_input_base.config.default is None
|
21
27
|
assert device_input_base.devices == []
|
@@ -23,12 +29,12 @@ def test_device_input_base_init(device_input_base):
|
|
23
29
|
|
24
30
|
def test_device_input_base_init_with_config(mocked_client):
|
25
31
|
config = {
|
26
|
-
"widget_class": "
|
32
|
+
"widget_class": "DeviceInputWidget",
|
27
33
|
"gui_id": "test_gui_id",
|
28
34
|
"device_filter": "FakePositioner",
|
29
35
|
"default": "samx",
|
30
36
|
}
|
31
|
-
widget =
|
37
|
+
widget = DeviceInputWidget(client=mocked_client, config=config)
|
32
38
|
assert widget.config.gui_id == "test_gui_id"
|
33
39
|
assert widget.config.device_filter == "FakePositioner"
|
34
40
|
assert widget.config.default == "samx"
|
File without changes
|
File without changes
|
File without changes
|