bec-widgets 0.86.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 +30 -26
- PKG-INFO +1 -1
- bec_widgets/examples/jupyter_console/jupyter_console_window.py +1 -2
- bec_widgets/qt_utils/error_popups.py +225 -0
- bec_widgets/utils/bec_connector.py +23 -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.86.0.dist-info → bec_widgets-0.87.1.dist-info}/METADATA +1 -1
- {bec_widgets-0.86.0.dist-info → bec_widgets-0.87.1.dist-info}/RECORD +36 -34
- pyproject.toml +1 -1
- tests/unit_tests/test_device_input_base.py +10 -4
- tests/unit_tests/test_error_utils.py +63 -0
- {bec_widgets-0.86.0.dist-info → bec_widgets-0.87.1.dist-info}/WHEEL +0 -0
- {bec_widgets-0.86.0.dist-info → bec_widgets-0.87.1.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.86.0.dist-info → bec_widgets-0.87.1.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,35 @@
|
|
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
|
+
|
21
|
+
## v0.87.0 (2024-07-17)
|
22
|
+
|
23
|
+
### Feature
|
24
|
+
|
25
|
+
* feat(qt_utils): added warning utility with simple API to setup warning message ([`787f749`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/787f74949bac27aaa51cbb43911919071481707c))
|
26
|
+
|
27
|
+
* feat(qt_utils): added error handle utility with popup messageBoxes ([`196ef7a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/196ef7afe11a1b5dcc536f8859dc3b6044ea628e))
|
28
|
+
|
29
|
+
### Unknown
|
30
|
+
|
31
|
+
* tests: add unit tests for error and warning message boxes ([`8f104cf`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8f104cf4024d3a4516e6aba5daa8fb78c85e2bfd))
|
32
|
+
|
3
33
|
## v0.86.0 (2024-07-17)
|
4
34
|
|
5
35
|
### Feature
|
@@ -106,12 +136,6 @@
|
|
106
136
|
|
107
137
|
* fix(motor_map): bug where motors without limits were selected ([`c78cd89`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c78cd898f203f950d7cb589eb5609feaa88062cf))
|
108
138
|
|
109
|
-
### Refactor
|
110
|
-
|
111
|
-
* refactor(setting_dialog): moved to qt_utils ([`3826bb3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3826bb3d9e870e85709b5b20ef09a4d22641280c))
|
112
|
-
|
113
|
-
* refactor(toolbar): toolbar moved from widgets to qt_utils ([`7ffc06f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7ffc06f3c7ddd86a1681408a75221b9bbadb236b))
|
114
|
-
|
115
139
|
### Test
|
116
140
|
|
117
141
|
* test(setting_dialog): tests added ([`74a249b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/74a249bd065d01006cb532bfff2a9bfedb34b592))
|
@@ -119,23 +143,3 @@
|
|
119
143
|
### Unknown
|
120
144
|
|
121
145
|
* tests(motor_map_widget): tests added ([`734f4c7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/734f4c77507a1edafd477d81b5f7401d8e759be2))
|
122
|
-
|
123
|
-
* feat(settings_dialog):apply button ([`2020953`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2020953b933b6fcad61ecc770588d39518c26fdd))
|
124
|
-
|
125
|
-
## v0.82.0 (2024-07-07)
|
126
|
-
|
127
|
-
### Feature
|
128
|
-
|
129
|
-
* feat(toggle): added angular component-like toggle ([`b9bff38`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b9bff38b64b86f06b3bc047922ef9df0c7d32e71))
|
130
|
-
|
131
|
-
### Refactor
|
132
|
-
|
133
|
-
* refactor(device_input): DeviceComboBox and DeviceLineEdit moved to top layer of widgets ([`f048629`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f04862933f049030554086adef3ec9e1aebd3eda))
|
134
|
-
|
135
|
-
* refactor(stop_button): moved to top layer, plugin added ([`f5b8375`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f5b8375fd36e3bb681de571da86a6c0bdb3cb6f0))
|
136
|
-
|
137
|
-
* refactor(motor_map_widget): removed restriction of only PySide6 for widget ([`db1cdf4`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/db1cdf42806fef6d7c6d2db83528f32df3f9751d))
|
138
|
-
|
139
|
-
* refactor(color_button): ColorButton moved to top level of widgets ([`fa1e86f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fa1e86ff07b25d2c47c73117b00765b8e2f25da4))
|
140
|
-
|
141
|
-
## v0.81.2 (2024-07-07)
|
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
|
|
@@ -0,0 +1,225 @@
|
|
1
|
+
import functools
|
2
|
+
import sys
|
3
|
+
import traceback
|
4
|
+
|
5
|
+
from qtpy.QtCore import QObject, Qt, Signal, Slot
|
6
|
+
from qtpy.QtWidgets import QApplication, QMessageBox, QPushButton, QVBoxLayout, QWidget
|
7
|
+
|
8
|
+
|
9
|
+
def SafeSlot(*slot_args, **slot_kwargs):
|
10
|
+
"""Function with args, acting like a decorator, applying "error_managed" decorator + Qt Slot
|
11
|
+
to the passed function, to display errors instead of potentially raising an exception
|
12
|
+
|
13
|
+
'popup_error' keyword argument can be passed with boolean value if a dialog should pop up,
|
14
|
+
otherwise error display is left to the original exception hook
|
15
|
+
"""
|
16
|
+
popup_error = bool(slot_kwargs.pop("popup_error", False))
|
17
|
+
|
18
|
+
def error_managed(method):
|
19
|
+
@Slot(*slot_args, **slot_kwargs)
|
20
|
+
@functools.wraps(method)
|
21
|
+
def wrapper(*args, **kwargs):
|
22
|
+
try:
|
23
|
+
return method(*args, **kwargs)
|
24
|
+
except Exception:
|
25
|
+
ErrorPopupUtility().custom_exception_hook(*sys.exc_info(), popup_error=popup_error)
|
26
|
+
|
27
|
+
return wrapper
|
28
|
+
|
29
|
+
return error_managed
|
30
|
+
|
31
|
+
|
32
|
+
class WarningPopupUtility(QObject):
|
33
|
+
"""
|
34
|
+
Utility class to show warning popups in the application.
|
35
|
+
"""
|
36
|
+
|
37
|
+
def __init__(self, parent=None):
|
38
|
+
super().__init__(parent)
|
39
|
+
|
40
|
+
@Slot(str, str, str, QWidget)
|
41
|
+
def show_warning_message(self, title, message, detailed_text, widget):
|
42
|
+
msg = QMessageBox(widget)
|
43
|
+
msg.setIcon(QMessageBox.Warning)
|
44
|
+
msg.setWindowTitle(title)
|
45
|
+
msg.setText(message)
|
46
|
+
msg.setStandardButtons(QMessageBox.Ok)
|
47
|
+
msg.setDetailedText(detailed_text)
|
48
|
+
msg.exec_()
|
49
|
+
|
50
|
+
def show_warning(self, title: str, message: str, detailed_text: str, widget: QWidget = None):
|
51
|
+
"""
|
52
|
+
Show a warning message with the given title, message, and detailed text.
|
53
|
+
|
54
|
+
Args:
|
55
|
+
title (str): The title of the warning message.
|
56
|
+
message (str): The main text of the warning message.
|
57
|
+
detailed_text (str): The detailed text to show when the user expands the message.
|
58
|
+
widget (QWidget): The parent widget for the message box.
|
59
|
+
"""
|
60
|
+
self.show_warning_message(title, message, detailed_text, widget)
|
61
|
+
|
62
|
+
|
63
|
+
class ErrorPopupUtility(QObject):
|
64
|
+
"""
|
65
|
+
Utility class to manage error popups in the application to show error messages to the users.
|
66
|
+
This class is singleton and the error popup can be enabled or disabled globally or attach to widget methods with decorator @error_managed.
|
67
|
+
"""
|
68
|
+
|
69
|
+
error_occurred = Signal(str, str, QWidget)
|
70
|
+
|
71
|
+
_instance = None
|
72
|
+
_initialized = False
|
73
|
+
|
74
|
+
def __new__(cls, *args, **kwargs):
|
75
|
+
if cls._instance is None:
|
76
|
+
cls._instance = super(ErrorPopupUtility, cls).__new__(cls)
|
77
|
+
cls._instance._initialized = False
|
78
|
+
return cls._instance
|
79
|
+
|
80
|
+
def __init__(self, parent=None):
|
81
|
+
if not self._initialized:
|
82
|
+
super().__init__(parent=parent)
|
83
|
+
self.error_occurred.connect(self.show_error_message)
|
84
|
+
self.enable_error_popup = False
|
85
|
+
self._initialized = True
|
86
|
+
sys.excepthook = self.custom_exception_hook
|
87
|
+
|
88
|
+
@Slot(str, str, QWidget)
|
89
|
+
def show_error_message(self, title, message, widget):
|
90
|
+
detailed_text = self.format_traceback(message)
|
91
|
+
error_message = self.parse_error_message(detailed_text)
|
92
|
+
|
93
|
+
msg = QMessageBox(widget)
|
94
|
+
msg.setIcon(QMessageBox.Critical)
|
95
|
+
msg.setWindowTitle(title)
|
96
|
+
msg.setText(error_message)
|
97
|
+
msg.setStandardButtons(QMessageBox.Ok)
|
98
|
+
msg.setDetailedText(detailed_text)
|
99
|
+
msg.setTextInteractionFlags(Qt.TextSelectableByMouse)
|
100
|
+
msg.setMinimumWidth(600)
|
101
|
+
msg.setMinimumHeight(400)
|
102
|
+
msg.exec_()
|
103
|
+
|
104
|
+
def format_traceback(self, traceback_message: str) -> str:
|
105
|
+
"""
|
106
|
+
Format the traceback message to be displayed in the error popup by adding indentation to each line.
|
107
|
+
|
108
|
+
Args:
|
109
|
+
traceback_message(str): The traceback message to be formatted.
|
110
|
+
|
111
|
+
Returns:
|
112
|
+
str: The formatted traceback message.
|
113
|
+
"""
|
114
|
+
formatted_lines = []
|
115
|
+
lines = traceback_message.split("\n")
|
116
|
+
for line in lines:
|
117
|
+
formatted_lines.append(" " + line) # Add indentation to each line
|
118
|
+
return "\n".join(formatted_lines)
|
119
|
+
|
120
|
+
def parse_error_message(self, traceback_message):
|
121
|
+
lines = traceback_message.split("\n")
|
122
|
+
error_message = "Error occurred. See details."
|
123
|
+
capture = False
|
124
|
+
captured_message = []
|
125
|
+
|
126
|
+
for line in lines:
|
127
|
+
if "raise" in line:
|
128
|
+
capture = True
|
129
|
+
continue
|
130
|
+
if capture:
|
131
|
+
if line.strip() and not line.startswith(" File "):
|
132
|
+
captured_message.append(line.strip())
|
133
|
+
else:
|
134
|
+
break
|
135
|
+
|
136
|
+
if captured_message:
|
137
|
+
error_message = " ".join(captured_message)
|
138
|
+
return error_message
|
139
|
+
|
140
|
+
def custom_exception_hook(self, exctype, value, tb, popup_error=False):
|
141
|
+
if popup_error or self.enable_error_popup:
|
142
|
+
error_message = traceback.format_exception(exctype, value, tb)
|
143
|
+
self.error_occurred.emit(
|
144
|
+
"Method error" if popup_error else "Application Error",
|
145
|
+
"".join(error_message),
|
146
|
+
self.parent(),
|
147
|
+
)
|
148
|
+
else:
|
149
|
+
sys.__excepthook__(exctype, value, tb) # Call the original excepthook
|
150
|
+
|
151
|
+
def enable_global_error_popups(self, state: bool):
|
152
|
+
"""
|
153
|
+
Enable or disable global error popups for all applications.
|
154
|
+
|
155
|
+
Args:
|
156
|
+
state(bool): True to enable error popups, False to disable error popups.
|
157
|
+
"""
|
158
|
+
self.enable_error_popup = bool(state)
|
159
|
+
|
160
|
+
@classmethod
|
161
|
+
def reset_singleton(cls):
|
162
|
+
"""
|
163
|
+
Reset the singleton instance.
|
164
|
+
"""
|
165
|
+
cls._instance = None
|
166
|
+
cls._initialized = False
|
167
|
+
|
168
|
+
|
169
|
+
class ExampleWidget(QWidget): # pragma: no cover
|
170
|
+
"""
|
171
|
+
Example widget to demonstrate error handling with the ErrorPopupUtility.
|
172
|
+
|
173
|
+
Warnings -> This example works properly only with PySide6, PyQt6 has a bug with the error handling.
|
174
|
+
"""
|
175
|
+
|
176
|
+
def __init__(self, parent=None):
|
177
|
+
super().__init__(parent=parent)
|
178
|
+
self.init_ui()
|
179
|
+
self.warning_utility = WarningPopupUtility(self)
|
180
|
+
|
181
|
+
def init_ui(self):
|
182
|
+
self.layout = QVBoxLayout(self)
|
183
|
+
|
184
|
+
# Button to trigger method with error handling
|
185
|
+
self.error_button = QPushButton("Trigger Handled Error", self)
|
186
|
+
self.error_button.clicked.connect(self.method_with_error_handling)
|
187
|
+
self.layout.addWidget(self.error_button)
|
188
|
+
|
189
|
+
# Button to trigger method without error handling
|
190
|
+
self.normal_button = QPushButton("Trigger Normal Error", self)
|
191
|
+
self.normal_button.clicked.connect(self.method_without_error_handling)
|
192
|
+
self.layout.addWidget(self.normal_button)
|
193
|
+
|
194
|
+
# Button to trigger warning popup
|
195
|
+
self.warning_button = QPushButton("Trigger Warning", self)
|
196
|
+
self.warning_button.clicked.connect(self.trigger_warning)
|
197
|
+
self.layout.addWidget(self.warning_button)
|
198
|
+
|
199
|
+
@SafeSlot(popup_error=True)
|
200
|
+
def method_with_error_handling(self):
|
201
|
+
"""This method raises an error and the exception is handled by the decorator."""
|
202
|
+
raise ValueError("This is a handled error.")
|
203
|
+
|
204
|
+
@SafeSlot()
|
205
|
+
def method_without_error_handling(self):
|
206
|
+
"""This method raises an error and the exception is not handled here."""
|
207
|
+
raise ValueError("This is an unhandled error.")
|
208
|
+
|
209
|
+
@SafeSlot()
|
210
|
+
def trigger_warning(self):
|
211
|
+
"""Trigger a warning using the WarningPopupUtility."""
|
212
|
+
self.warning_utility.show_warning(
|
213
|
+
title="Warning",
|
214
|
+
message="This is a warning message.",
|
215
|
+
detailed_text="This is the detailed text of the warning message.",
|
216
|
+
widget=self,
|
217
|
+
)
|
218
|
+
|
219
|
+
|
220
|
+
if __name__ == "__main__": # pragma: no cover
|
221
|
+
|
222
|
+
app = QApplication(sys.argv)
|
223
|
+
widget = ExampleWidget()
|
224
|
+
widget.show()
|
225
|
+
sys.exit(app.exec_())
|
@@ -11,9 +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
|
-
from bec_widgets.
|
17
|
+
from bec_widgets.qt_utils.error_popups import ErrorPopupUtility
|
17
18
|
from bec_widgets.utils.yaml_dialog import load_yaml, load_yaml_gui, save_yaml, save_yaml_gui
|
18
19
|
|
19
20
|
BECDispatcher = lazy_import_from("bec_widgets.utils.bec_dispatcher", ("BECDispatcher",))
|
@@ -64,16 +65,30 @@ class Worker(QRunnable):
|
|
64
65
|
self.signals.completed.emit()
|
65
66
|
|
66
67
|
|
67
|
-
class BECConnector
|
68
|
-
"""Connection mixin class
|
68
|
+
class BECConnector:
|
69
|
+
"""Connection mixin class to handle BEC client and device manager"""
|
69
70
|
|
70
71
|
USER_ACCESS = ["_config_dict", "_get_all_rpc"]
|
72
|
+
EXIT_HANDLERS = {}
|
71
73
|
|
72
74
|
def __init__(self, client=None, config: ConnectionConfig = None, gui_id: str = None):
|
73
75
|
# BEC related connections
|
74
76
|
self.bec_dispatcher = BECDispatcher(client=client)
|
75
77
|
self.client = self.bec_dispatcher.client if client is None else client
|
76
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
|
+
|
77
92
|
if config:
|
78
93
|
self.config = config
|
79
94
|
self.config.widget_class = self.__class__.__name__
|
@@ -91,9 +106,14 @@ class BECConnector(BECWidget):
|
|
91
106
|
self.gui_id = self.config.gui_id
|
92
107
|
|
93
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'
|
94
111
|
self.rpc_register = RPCRegister()
|
95
112
|
self.rpc_register.add_rpc(self)
|
96
113
|
|
114
|
+
# Error popups
|
115
|
+
self.error_utility = ErrorPopupUtility()
|
116
|
+
|
97
117
|
self._thread_pool = QThreadPool.globalInstance()
|
98
118
|
|
99
119
|
def submit_task(self, fn, *args, on_complete: pyqtSlot = None, **kwargs) -> Worker:
|
@@ -280,18 +300,3 @@ class BECConnector(BECWidget):
|
|
280
300
|
return self.config.model_dump()
|
281
301
|
else:
|
282
302
|
return self.config
|
283
|
-
|
284
|
-
def cleanup(self):
|
285
|
-
"""Cleanup the widget."""
|
286
|
-
self.rpc_register.remove_rpc(self)
|
287
|
-
all_connections = self.rpc_register.list_all_connections()
|
288
|
-
if len(all_connections) == 0:
|
289
|
-
print("No more connections. Shutting down GUI BEC client.")
|
290
|
-
self.bec_dispatcher.disconnect_all()
|
291
|
-
self.client.shutdown()
|
292
|
-
if hasattr(super(), "cleanup"):
|
293
|
-
super().cleanup()
|
294
|
-
|
295
|
-
# def closeEvent(self, event):
|
296
|
-
# self.cleanup()
|
297
|
-
# 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
|
@@ -34,14 +34,15 @@ bec_widgets/examples/plugin_example_pyside/tictactoe.py,sha256=s3rCurXloVcmMdzZi
|
|
34
34
|
bec_widgets/examples/plugin_example_pyside/tictactoeplugin.py,sha256=BBt3MD8oDLUMCCY3mioJa1QRR0WQdW6DuvVmK1Taovk,1734
|
35
35
|
bec_widgets/examples/plugin_example_pyside/tictactoetaskmenu.py,sha256=LNwplI6deUdKY6FOhUuWBanotxk9asF2G-6k7lFfA8Y,2301
|
36
36
|
bec_widgets/qt_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
|
+
bec_widgets/qt_utils/error_popups.py,sha256=WAN3Qtccy9Yww29kZ3HbLt9VyipgrIamJ6y4PhGTe3I,7983
|
37
38
|
bec_widgets/qt_utils/settings_dialog.py,sha256=rR_Zk4RGTnI4dz5OEzCc13lVpxlOKuwOf4_7wqXSbRw,3373
|
38
39
|
bec_widgets/qt_utils/toolbar.py,sha256=yzxCmZ7c00B2JD1TkUpPeQgM_-v7zuTYe38Qkw_yvrc,2430
|
39
40
|
bec_widgets/utils/__init__.py,sha256=1930ji1Jj6dVuY81Wd2kYBhHYNV-2R0bN_L4o9zBj1U,533
|
40
|
-
bec_widgets/utils/bec_connector.py,sha256=
|
41
|
+
bec_widgets/utils/bec_connector.py,sha256=UK0GIWgcC_JTwgKCOmmuXnQvSwD3wiPsJQw6NBW3p74,9961
|
41
42
|
bec_widgets/utils/bec_designer.py,sha256=ak3G8FdojUPjVBBwdPXw7tN5P2Uxr-SSoQt394jXeAA,4308
|
42
43
|
bec_widgets/utils/bec_dispatcher.py,sha256=fhI7_X0kSZCtXyR55Qn-w7BfNdk2Roc1Tyx0bx3bjoE,6195
|
43
44
|
bec_widgets/utils/bec_table.py,sha256=nA2b8ukSeUfquFMAxGrUVOqdrzMoDYD6O_4EYbOG2zk,717
|
44
|
-
bec_widgets/utils/bec_widget.py,sha256=
|
45
|
+
bec_widgets/utils/bec_widget.py,sha256=Bo2v1aP7rgSAQajW8GBJbI3iovTn_hGCsmeFMo7bT10,707
|
45
46
|
bec_widgets/utils/colors.py,sha256=RAGaA4jdvsFSxGlbhSBYL5mdlwS-9rq45tJM7U-7xXs,10587
|
46
47
|
bec_widgets/utils/container_utils.py,sha256=m3VUyAYmSWkEwApP9tBvKxPYVtc2kHw4toxIpMryJy4,1495
|
47
48
|
bec_widgets/utils/crosshair.py,sha256=SubY4FQCI6vUKsmMYGKHR7uYdGQJ6vhoYLuC1XlKS9I,9626
|
@@ -60,14 +61,14 @@ bec_widgets/utils/plugin_templates/plugin.template,sha256=JHkUvYegesW-xEhZuY4FQV
|
|
60
61
|
bec_widgets/utils/plugin_templates/register.template,sha256=XyL3OZPT_FTArLAM8tHd5qMqv2ZuAbJAZLsNNnHcagU,417
|
61
62
|
bec_widgets/widgets/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
62
63
|
bec_widgets/widgets/base_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
63
|
-
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
|
64
65
|
bec_widgets/widgets/bec_queue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
65
|
-
bec_widgets/widgets/bec_queue/bec_queue.py,sha256=
|
66
|
+
bec_widgets/widgets/bec_queue/bec_queue.py,sha256=n3WMmHvKt4VB2dOud6EIiTYlXpnNUUHh1dXgvR7lYyc,3585
|
66
67
|
bec_widgets/widgets/bec_queue/bec_queue.pyproject,sha256=VhoNmAv1DQUl9dg7dELyf5i4pZ5k65N3GnqOYiSwbQo,27
|
67
68
|
bec_widgets/widgets/bec_queue/bec_queue_plugin.py,sha256=hDJm8Zd_GIDw2R8VYn4ytwrHVCmJUjC9dGDMae2omU0,1175
|
68
69
|
bec_widgets/widgets/bec_queue/register_bec_queue.py,sha256=XnwtUSa1asK1b80knKWodcyX9qJy4DnKsQL_FoDfZy4,463
|
69
70
|
bec_widgets/widgets/bec_status_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
70
|
-
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
|
71
72
|
bec_widgets/widgets/bec_status_box/bec_status_box.pyproject,sha256=JWtx3Csfn2h7ODtk10HtyBNLf6tFIqyU6g04rMWOO1U,32
|
72
73
|
bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py,sha256=CNFIETpkORLQ9J3l91jefiRLJs5Ru3nsWIPoUwaRbB0,1242
|
73
74
|
bec_widgets/widgets/bec_status_box/register_bec_status_box.py,sha256=EiQITnkNw7IU7hE776wAeXro97eZd9XlsB9essgCebE,481
|
@@ -86,47 +87,47 @@ bec_widgets/widgets/color_map_selector/register_color_map_selector.py,sha256=crZ
|
|
86
87
|
bec_widgets/widgets/color_map_selector/assets/color_map_selector_icon.png,sha256=o8zRmMvXhGhMyBklH_Vfjn-jpDL4Nw03fLqDk_wx_JI,11975
|
87
88
|
bec_widgets/widgets/console/console.py,sha256=IW1OerycmS-cm8CKGFig44Qye8mxsmVcKvLHAc3lXco,17845
|
88
89
|
bec_widgets/widgets/device_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
89
|
-
bec_widgets/widgets/device_box/device_box.py,sha256=
|
90
|
+
bec_widgets/widgets/device_box/device_box.py,sha256=2hWCbDaBvYnWK4-HDqeYetzb5KR4DBk7UPQJMLhT4w0,6929
|
90
91
|
bec_widgets/widgets/device_box/device_box.pyproject,sha256=jtwvhaySJRdnuV99mEZT3htmWKVLphFeetEW4al7s-o,28
|
91
92
|
bec_widgets/widgets/device_box/device_box.ui,sha256=z7j60J4ZKYjH9eyHl6FnZ_Z8lkdq1LQftxveSZQ6g_w,4865
|
92
93
|
bec_widgets/widgets/device_box/device_box_plugin.py,sha256=n7l3OIKqtQGsL86ygDekb0wb4bBySJXMUo58eTtKIdQ,1212
|
93
94
|
bec_widgets/widgets/device_box/register_device_box.py,sha256=K7Hx4FIQDXasejaw6njwkFkkkwk63Smm6pHoOEdLWPw,467
|
94
95
|
bec_widgets/widgets/device_combobox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
95
|
-
bec_widgets/widgets/device_combobox/device_combobox.py,sha256=
|
96
|
+
bec_widgets/widgets/device_combobox/device_combobox.py,sha256=9tuutN5yp0Kv6Jl6QPKO3OcMI1HBYSZhD2mlNI8rH4s,2682
|
96
97
|
bec_widgets/widgets/device_combobox/device_combobox.pyproject,sha256=wI2eXR5ky_IM9-BCHJnH_9CEqYcZwIuLcgitSEr8OJU,40
|
97
98
|
bec_widgets/widgets/device_combobox/device_combobox_plugin.py,sha256=CQszPKVXoa4wRxucQjVIqblP5rtGvwWn8FZOR_OE_-o,1406
|
98
99
|
bec_widgets/widgets/device_combobox/register_device_combobox.py,sha256=xzz2qM82cgFIrj77c9zyUpJ-1QHZRMrLkyeq8uGNsmE,487
|
99
100
|
bec_widgets/widgets/device_combobox/assets/device_combobox_icon.png,sha256=ydC7WZmoU-UjjIOGFuUIDjQ30p4L66si2emHawc_inU,2592
|
100
101
|
bec_widgets/widgets/device_line_edit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
101
|
-
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
|
102
103
|
bec_widgets/widgets/device_line_edit/device_line_edit.pyproject,sha256=tqAYXRbxsHR41MwqmAxvfq1CFeZ1IRv84whUG67HjjE,41
|
103
104
|
bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py,sha256=7aJR2jsEdbq2UuH9p-7lqKzndkrtY4ZcqnNLIVc7rzk,1423
|
104
105
|
bec_widgets/widgets/device_line_edit/register_device_line_edit.py,sha256=8gEPnC8djYCw-idoZAENNB3bPOxM6pbzEp9A366EAGg,489
|
105
106
|
bec_widgets/widgets/device_line_edit/assets/line_edit_icon.png,sha256=nxVykqQY4kgMJP7GELzv6N_dghqIzBJb2MWqxs4B-Ug,3391
|
106
107
|
bec_widgets/widgets/dock/__init__.py,sha256=B7foHt02gnhM7mFksa7GJVwT7n0j_JvYDCt6wc6XR5g,61
|
107
|
-
bec_widgets/widgets/dock/dock.py,sha256=
|
108
|
-
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
|
109
110
|
bec_widgets/widgets/figure/__init__.py,sha256=3hGx_KOV7QHCYAV06aNuUgKq4QIYCjUTad-DrwkUaBM,44
|
110
|
-
bec_widgets/widgets/figure/figure.py,sha256=
|
111
|
+
bec_widgets/widgets/figure/figure.py,sha256=hQFru88kvzW-MWSrcdrfglwaOXDxUAPaMSQxr4G1w2E,28438
|
111
112
|
bec_widgets/widgets/figure/plots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
112
113
|
bec_widgets/widgets/figure/plots/axis_settings.py,sha256=CCvJwo1RjpnLJG9TmGqf9fyPpUNyLT8k7pPEnqVuaGM,2281
|
113
114
|
bec_widgets/widgets/figure/plots/axis_settings.ui,sha256=zMKZK6lH_3KJGO4RA_paXAH7UzZJ4Snlil3MK4pK3L8,11589
|
114
|
-
bec_widgets/widgets/figure/plots/plot_base.py,sha256=
|
115
|
+
bec_widgets/widgets/figure/plots/plot_base.py,sha256=TmXUO4445xjl-jwJh3t0FoFp01yThEg7eTRdPnwdrOw,10304
|
115
116
|
bec_widgets/widgets/figure/plots/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
|
-
bec_widgets/widgets/figure/plots/image/image.py,sha256=
|
117
|
+
bec_widgets/widgets/figure/plots/image/image.py,sha256=xJJsfKJL7wBv_3U4-aT5ApX84t4-_8LLGARepQEnI2U,21276
|
117
118
|
bec_widgets/widgets/figure/plots/image/image_item.py,sha256=TyarahdWEn0jgalj5fqSAmcznXSbENkqHrrlL2GVdU4,10558
|
118
119
|
bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=GeTtWjbldy6VejMwPGQgM-o3d6bmLglCjdoktu19xfA,5262
|
119
120
|
bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
120
|
-
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
|
121
122
|
bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
122
|
-
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=
|
123
|
-
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
|
124
125
|
bec_widgets/widgets/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
125
|
-
bec_widgets/widgets/jupyter_console/jupyter_console.py,sha256=
|
126
|
+
bec_widgets/widgets/jupyter_console/jupyter_console.py,sha256=mBKM89H6SuHuFy1lQg1n8s1gQiN5QEkZf0xua8aPDns,2402
|
126
127
|
bec_widgets/widgets/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
127
128
|
bec_widgets/widgets/motor_map/bec_motor_map_widget.pyproject,sha256=NAI8s5gRKz80ED4KY7OgD2OgSH5HEsjt2ux2BYp66yg,63
|
128
129
|
bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py,sha256=PIfDE78Zqvsu7-xwoh9DdYkH8a7eOUFSaEl0bNrHYHc,1292
|
129
|
-
bec_widgets/widgets/motor_map/motor_map_widget.py,sha256=
|
130
|
+
bec_widgets/widgets/motor_map/motor_map_widget.py,sha256=m-cMo8h5WzLgr64AN5f5eYxaQf7oF1NiE4omPW2T5Go,7155
|
130
131
|
bec_widgets/widgets/motor_map/register_bec_motor_map_widget.py,sha256=qRG8PtWGjso0pWbvj_DXKnbUfmQzfGqPSrnAozXfM7o,492
|
131
132
|
bec_widgets/widgets/motor_map/assets/connection.svg,sha256=czIb1BnshmxJnER8ssU3WcLENrFSIUfMwberajWOGAk,341
|
132
133
|
bec_widgets/widgets/motor_map/assets/history.svg,sha256=bd6p5saxRiNRpd5OsSwIOvRWvel0WFEHul9zw4y9vH0,392
|
@@ -141,10 +142,10 @@ bec_widgets/widgets/position_indicator/position_indicator.pyproject,sha256=s0JEf
|
|
141
142
|
bec_widgets/widgets/position_indicator/position_indicator_plugin.py,sha256=h9EQU4t6KdKVAZh5ILalpl1K8b7JMHf-2AFYREej2-w,1241
|
142
143
|
bec_widgets/widgets/position_indicator/register_position_indicator.py,sha256=OZNiMgM_80TPSAXK_0hXAkne4vUh8DGvh_OdpOiMpwI,516
|
143
144
|
bec_widgets/widgets/ring_progress_bar/__init__.py,sha256=_uoJKnDM2YAeUBfwc5WLbIHSJj7zm_FAurSKP3WRaCw,47
|
144
|
-
bec_widgets/widgets/ring_progress_bar/ring.py,sha256=
|
145
|
-
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
|
146
147
|
bec_widgets/widgets/scan_control/__init__.py,sha256=IOfHl15vxb_uC6KN62-PeUzbBha_vQyqkkXbJ2HU674,38
|
147
|
-
bec_widgets/widgets/scan_control/scan_control.py,sha256=
|
148
|
+
bec_widgets/widgets/scan_control/scan_control.py,sha256=YT3Vvy27_FY3UY7IXvy87o9ZB_syauuEKzkJFOpbP4s,7610
|
148
149
|
bec_widgets/widgets/scan_control/scan_group_box.py,sha256=wrrJLfI0apfll0NKpqM8ymlbl5NaqA9cKNgyfVdYR00,7420
|
149
150
|
bec_widgets/widgets/spinner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
150
151
|
bec_widgets/widgets/spinner/register_spinner_widget.py,sha256=_zCPjLh4M7NTSHP1Atdn6yu33zJ3LJkcBy3KOJ5eSVY,476
|
@@ -153,12 +154,12 @@ bec_widgets/widgets/spinner/spinner_widget.pyproject,sha256=zzLajGB3DTgVnrSqMey2
|
|
153
154
|
bec_widgets/widgets/spinner/spinner_widget_plugin.py,sha256=ZcG1QIwpbriapM5ZrR4gQ-WA2a7ARhsstk8EIY-OGTU,1187
|
154
155
|
bec_widgets/widgets/stop_button/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
155
156
|
bec_widgets/widgets/stop_button/register_stop_button.py,sha256=U7r3fEOH-uPhAQI-nTituHXDDXDWR4JQZ7_vD6b_dfM,471
|
156
|
-
bec_widgets/widgets/stop_button/stop_button.py,sha256=
|
157
|
+
bec_widgets/widgets/stop_button/stop_button.py,sha256=_2vNytWjf-pKqyv5wT8j5NSA_4z9Zyk4aBnkEvU8_dA,798
|
157
158
|
bec_widgets/widgets/stop_button/stop_button.pyproject,sha256=Cc_xbv-zfzNVpsdg_1QyzuTlrJaM9_BkIjes70umrx0,29
|
158
159
|
bec_widgets/widgets/stop_button/stop_button_plugin.py,sha256=-90MqPp1cFumsrHGaFgc_nahdCoew98M5bS1oqSRhDk,1346
|
159
160
|
bec_widgets/widgets/stop_button/assets/stop.png,sha256=9nGdvR-qwOz1YP4xYoBjmDnnj9ns2cLLhfvTz9amyKc,8424
|
160
161
|
bec_widgets/widgets/text_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
161
|
-
bec_widgets/widgets/text_box/text_box.py,sha256=
|
162
|
+
bec_widgets/widgets/text_box/text_box.py,sha256=3OWC6L3CWsH_uh8X11WnifYjhO8ruDe2FWFhE8cn5lY,4274
|
162
163
|
bec_widgets/widgets/toggle/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
163
164
|
bec_widgets/widgets/toggle/register_toggle_switch.py,sha256=8pVtkeEeiDOjV4OPoZq1I30F9JDzl4nQE7e7xoWyWBs,472
|
164
165
|
bec_widgets/widgets/toggle/toggle.py,sha256=JzCGYoyHBrlBWCoyL94QX4zSLyEwWbCNHMegjlnSy2E,4442
|
@@ -167,7 +168,7 @@ bec_widgets/widgets/toggle/toggle_switch_plugin.py,sha256=8e8JjUx6T5CIx7ixWLwVdT
|
|
167
168
|
bec_widgets/widgets/vscode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
168
169
|
bec_widgets/widgets/vscode/vscode.py,sha256=yV1D9PK2IYomq9yYfwqUOrZGIeBwMnNuBfXxBc2M8Qc,2231
|
169
170
|
bec_widgets/widgets/website/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
170
|
-
bec_widgets/widgets/website/website.py,sha256
|
171
|
+
bec_widgets/widgets/website/website.py,sha256=FmhVaasAU3ZSdKP-HHSnJHFbG8lIsNAPH9pZq55fhic,1731
|
171
172
|
docs/Makefile,sha256=i2WHuFlgfyAPEW4ssEP8NY4cOibDJrVjvzSEU8_Ggwc,634
|
172
173
|
docs/conf.py,sha256=HxLxupNGu0Smhwn57g1kFdjZzFuaWVREgRJKhT1zi2k,2464
|
173
174
|
docs/index.md,sha256=8ZCgaLIbJsYvt-jwi--QxsNwnK4-k3rejIeOOLclG40,1101
|
@@ -243,8 +244,9 @@ tests/unit_tests/test_color_map_selector.py,sha256=NVnKrz5kFUKgljm7HslIpMII-IpzP
|
|
243
244
|
tests/unit_tests/test_color_validation.py,sha256=xbFbtFDia36XLgaNrX2IwvAX3IDC_Odpj5BGoJSgiIE,2389
|
244
245
|
tests/unit_tests/test_crosshair.py,sha256=3OMAJ2ZaISYXMOtkXf1rPdy94vCr8njeLi6uHblBL9Q,5045
|
245
246
|
tests/unit_tests/test_device_box.py,sha256=q9IVFpt1NF3TBF0Jhk-I-LRiuvvHG3FGUalw4jEYwVo,3431
|
246
|
-
tests/unit_tests/test_device_input_base.py,sha256=
|
247
|
+
tests/unit_tests/test_device_input_base.py,sha256=Unw-CdRwXYdHBKRDWOEYoenLBjtFktbrzpjUx3lFIkM,2601
|
247
248
|
tests/unit_tests/test_device_input_widgets.py,sha256=39MtgF-Q67UWz6qapyYP4ukDEUOD81iEJ_jhATyG7dM,5889
|
249
|
+
tests/unit_tests/test_error_utils.py,sha256=LQOxz29WCGOe0qwFkaPDixjUmdnF3qeAGxD4A3t9IKg,2108
|
248
250
|
tests/unit_tests/test_generate_cli_client.py,sha256=ng-eV5iF7Dhm-6YpxYo99CMY0KgqoaZBQNkMeKULDBU,3355
|
249
251
|
tests/unit_tests/test_generate_plugin.py,sha256=9603ucZChM-pYpHadzsR94U1Zec1KZT34WedX9qzgMo,4464
|
250
252
|
tests/unit_tests/test_motor_map_widget.py,sha256=3nbINg3NYvWUrrGGMRPs8SDtePjXhoehSY_CShFGvEI,7507
|
@@ -271,8 +273,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
271
273
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
272
274
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
273
275
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
274
|
-
bec_widgets-0.
|
275
|
-
bec_widgets-0.
|
276
|
-
bec_widgets-0.
|
277
|
-
bec_widgets-0.
|
278
|
-
bec_widgets-0.
|
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"
|
@@ -0,0 +1,63 @@
|
|
1
|
+
from unittest.mock import patch
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
import pytestqt
|
5
|
+
from qtpy.QtWidgets import QMessageBox
|
6
|
+
|
7
|
+
from bec_widgets.qt_utils.error_popups import ErrorPopupUtility, ExampleWidget
|
8
|
+
|
9
|
+
|
10
|
+
@pytest.fixture
|
11
|
+
def widget(qtbot):
|
12
|
+
test_widget = ExampleWidget()
|
13
|
+
qtbot.addWidget(test_widget)
|
14
|
+
qtbot.waitExposed(test_widget)
|
15
|
+
yield test_widget
|
16
|
+
test_widget.close()
|
17
|
+
|
18
|
+
|
19
|
+
@patch.object(QMessageBox, "exec_", return_value=QMessageBox.Ok)
|
20
|
+
def test_show_error_message_global(mock_exec, widget, qtbot):
|
21
|
+
error_utility = ErrorPopupUtility()
|
22
|
+
error_utility.enable_global_error_popups(True)
|
23
|
+
|
24
|
+
with qtbot.waitSignal(error_utility.error_occurred, timeout=1000) as blocker:
|
25
|
+
error_utility.error_occurred.emit("Test Error", "This is a test error message.", widget)
|
26
|
+
|
27
|
+
assert mock_exec.called
|
28
|
+
assert blocker.signal_triggered
|
29
|
+
|
30
|
+
|
31
|
+
@pytest.mark.parametrize("global_pop", [False, True])
|
32
|
+
@patch.object(QMessageBox, "exec_", return_value=QMessageBox.Ok)
|
33
|
+
def test_slot_with_popup_on_error(mock_exec, widget, qtbot, global_pop):
|
34
|
+
error_utility = ErrorPopupUtility()
|
35
|
+
error_utility.enable_global_error_popups(global_pop)
|
36
|
+
|
37
|
+
with qtbot.waitSignal(error_utility.error_occurred, timeout=200) as blocker:
|
38
|
+
widget.method_with_error_handling()
|
39
|
+
|
40
|
+
assert blocker.signal_triggered
|
41
|
+
assert mock_exec.called
|
42
|
+
|
43
|
+
|
44
|
+
@pytest.mark.parametrize("global_pop", [False, True])
|
45
|
+
@patch.object(QMessageBox, "exec_", return_value=QMessageBox.Ok)
|
46
|
+
def test_slot_no_popup_by_default_on_error(mock_exec, widget, qtbot, capsys, global_pop):
|
47
|
+
error_utility = ErrorPopupUtility()
|
48
|
+
error_utility.enable_global_error_popups(global_pop)
|
49
|
+
|
50
|
+
try:
|
51
|
+
with qtbot.waitSignal(error_utility.error_occurred, timeout=200) as blocker:
|
52
|
+
widget.method_without_error_handling()
|
53
|
+
except pytestqt.exceptions.TimeoutError:
|
54
|
+
assert not global_pop
|
55
|
+
|
56
|
+
if global_pop:
|
57
|
+
assert blocker.signal_triggered
|
58
|
+
assert mock_exec.called
|
59
|
+
else:
|
60
|
+
assert not blocker.signal_triggered
|
61
|
+
assert not mock_exec.called
|
62
|
+
stdout, stderr = capsys.readouterr()
|
63
|
+
assert "ValueError" in stderr
|
File without changes
|
File without changes
|
File without changes
|