bec-widgets 0.92.3__py3-none-any.whl → 0.92.5__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 +22 -20
- PKG-INFO +1 -1
- bec_widgets/widgets/bec_queue/bec_queue.py +18 -12
- bec_widgets/widgets/bec_status_box/bec_status_box.py +10 -0
- bec_widgets/widgets/figure/plots/image/image.py +3 -2
- bec_widgets/widgets/figure/plots/motor_map/motor_map.py +3 -2
- bec_widgets/widgets/spinner/spinner.py +4 -0
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.5.dist-info}/METADATA +1 -1
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.5.dist-info}/RECORD +25 -25
- pyproject.toml +1 -1
- tests/end-2-end/test_scan_control_e2e.py +1 -0
- tests/unit_tests/conftest.py +1 -0
- tests/unit_tests/test_bec_image.py +8 -14
- tests/unit_tests/test_bec_motor_map.py +17 -8
- tests/unit_tests/test_bec_queue.py +9 -8
- tests/unit_tests/test_bec_status_box.py +1 -0
- tests/unit_tests/test_device_input_base.py +7 -2
- tests/unit_tests/test_scan_control.py +1 -0
- tests/unit_tests/test_setting_dialog.py +7 -7
- tests/unit_tests/test_spinner.py +1 -0
- tests/unit_tests/test_toggle.py +1 -0
- tests/unit_tests/test_vscode_widget.py +2 -0
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.5.dist-info}/WHEEL +0 -0
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.5.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.92.3.dist-info → bec_widgets-0.92.5.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.92.5 (2024-08-05)
|
4
|
+
|
5
|
+
### Fix
|
6
|
+
|
7
|
+
* fix(spinner): stop timer on close event ([`30fef92`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/30fef929cf6fb4b73f48151c92a0ee54c734031d))
|
8
|
+
|
9
|
+
* fix(status_box): fix cleanup of status box ([`1f30dd7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1f30dd73a9c1e3135087a5eef92c7329f54a604e))
|
10
|
+
|
11
|
+
### Refactor
|
12
|
+
|
13
|
+
* refactor(queue): refactored bec queue to inherit only from qwidget ([`7616ca0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7616ca0e145e233ccb48029a8c0b54b54b5b4194))
|
14
|
+
|
15
|
+
### Test
|
16
|
+
|
17
|
+
* test: register all widgets with qtbot and close them ([`73cd11e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/73cd11e47277e4437554b785a9551b28a572094f))
|
18
|
+
|
19
|
+
## v0.92.4 (2024-07-31)
|
20
|
+
|
21
|
+
### Fix
|
22
|
+
|
23
|
+
* fix: fix missmatch of signal/slot in image and motormap ([`dcc5fd7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dcc5fd71ee9f51767a7b2b1ed6200e89d1ef754c))
|
24
|
+
|
3
25
|
## v0.92.3 (2024-07-28)
|
4
26
|
|
5
27
|
### Fix
|
@@ -127,23 +149,3 @@ This reverts commit 3798714369adf4023f833b7749d2f46a0ec74eee ([`fd6ae91`](https:
|
|
127
149
|
### Refactor
|
128
150
|
|
129
151
|
* refactor(toolbar): generalizations of the ToolBarAction ([`ad112d1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ad112d1f08157f6987edd48a0bacf9f669ef1997))
|
130
|
-
|
131
|
-
## v0.88.0 (2024-07-19)
|
132
|
-
|
133
|
-
### Feature
|
134
|
-
|
135
|
-
* feat(waveform_widget): designer plugin added ([`1f8ef52`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1f8ef52b606283038052640849094f515a463403))
|
136
|
-
|
137
|
-
* feat(waveform_widget): switch between drag and rectangle mode ([`2be009c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2be009c6477ba26c5cfb4d827534c5d5eb428999))
|
138
|
-
|
139
|
-
### Fix
|
140
|
-
|
141
|
-
* fix(waveform_widget): plot API unified with BECFigure ([`2c8764a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2c8764a27de89b39b717032b58465e120ec57fbc))
|
142
|
-
|
143
|
-
* fix(colormap_selector): compatibility for PyQt6 when using designer fixed ([`50135b5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/50135b5fe90a88618291e9357f180cb19251dace))
|
144
|
-
|
145
|
-
* fix(waveform_widget): adapted for BECWidget base class ([`6eb313f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6eb313fa76e559d62ecd8fa8849142b83817e47c))
|
146
|
-
|
147
|
-
### Test
|
148
|
-
|
149
|
-
* test(waveform_widget): test added ([`8d764e2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8d764e2d46a1e017dadc3c4630648c1ca708afc2))
|
PKG-INFO
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
from bec_lib.endpoints import MessageEndpoints
|
2
2
|
from qtpy.QtCore import Qt, Slot
|
3
|
-
from qtpy.QtWidgets import QHeaderView, QTableWidget, QTableWidgetItem, QWidget
|
3
|
+
from qtpy.QtWidgets import QHBoxLayout, QHeaderView, QTableWidget, QTableWidgetItem, QWidget
|
4
4
|
|
5
5
|
from bec_widgets.utils.bec_connector import ConnectionConfig
|
6
6
|
from bec_widgets.utils.bec_widget import BECWidget
|
7
7
|
|
8
8
|
|
9
|
-
class BECQueue(BECWidget,
|
9
|
+
class BECQueue(BECWidget, QWidget):
|
10
10
|
"""
|
11
11
|
Widget to display the BEC queue.
|
12
12
|
"""
|
@@ -19,10 +19,14 @@ class BECQueue(BECWidget, QTableWidget):
|
|
19
19
|
gui_id: str = None,
|
20
20
|
):
|
21
21
|
super().__init__(client, config, gui_id)
|
22
|
-
|
23
|
-
self.
|
24
|
-
self.
|
25
|
-
|
22
|
+
QWidget.__init__(self, parent=parent)
|
23
|
+
self.table = QTableWidget(self)
|
24
|
+
self.layout = QHBoxLayout(self)
|
25
|
+
self.layout.addWidget(self.table)
|
26
|
+
|
27
|
+
self.table.setColumnCount(3)
|
28
|
+
self.table.setHorizontalHeaderLabels(["Scan Number", "Type", "Status"])
|
29
|
+
header = self.table.horizontalHeader()
|
26
30
|
header.setSectionResizeMode(QHeaderView.Stretch)
|
27
31
|
self.bec_dispatcher.connect_slot(self.update_queue, MessageEndpoints.scan_queue_status())
|
28
32
|
self.reset_content()
|
@@ -38,8 +42,8 @@ class BECQueue(BECWidget, QTableWidget):
|
|
38
42
|
"""
|
39
43
|
# only show the primary queue for now
|
40
44
|
queue_info = content.get("queue", {}).get("primary", {}).get("info", [])
|
41
|
-
self.setRowCount(len(queue_info))
|
42
|
-
self.clearContents()
|
45
|
+
self.table.setRowCount(len(queue_info))
|
46
|
+
self.table.clearContents()
|
43
47
|
|
44
48
|
if not queue_info:
|
45
49
|
self.reset_content()
|
@@ -73,6 +77,8 @@ class BECQueue(BECWidget, QTableWidget):
|
|
73
77
|
Returns:
|
74
78
|
QTableWidgetItem: The formatted item.
|
75
79
|
"""
|
80
|
+
if not content or not isinstance(content, str):
|
81
|
+
content = ""
|
76
82
|
item = QTableWidgetItem(content)
|
77
83
|
item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
|
78
84
|
return item
|
@@ -88,16 +94,16 @@ class BECQueue(BECWidget, QTableWidget):
|
|
88
94
|
status (str): The status.
|
89
95
|
"""
|
90
96
|
|
91
|
-
self.setItem(index, 0, self.format_item(scan_number))
|
92
|
-
self.setItem(index, 1, self.format_item(scan_type))
|
93
|
-
self.setItem(index, 2, self.format_item(status))
|
97
|
+
self.table.setItem(index, 0, self.format_item(scan_number))
|
98
|
+
self.table.setItem(index, 1, self.format_item(scan_type))
|
99
|
+
self.table.setItem(index, 2, self.format_item(status))
|
94
100
|
|
95
101
|
def reset_content(self):
|
96
102
|
"""
|
97
103
|
Reset the content of the table.
|
98
104
|
"""
|
99
105
|
|
100
|
-
self.setRowCount(1)
|
106
|
+
self.table.setRowCount(1)
|
101
107
|
self.set_row(0, "", "", "")
|
102
108
|
|
103
109
|
|
@@ -56,6 +56,11 @@ class BECServiceStatusMixin(QObject):
|
|
56
56
|
self.client._update_existing_services()
|
57
57
|
self.services_update.emit(self.client._services_info, self.client._services_metric)
|
58
58
|
|
59
|
+
def cleanup(self):
|
60
|
+
"""Cleanup the BECServiceStatusMixin."""
|
61
|
+
self._service_update_timer.stop()
|
62
|
+
self._service_update_timer.deleteLater()
|
63
|
+
|
59
64
|
|
60
65
|
class BECStatusBox(BECWidget, QWidget):
|
61
66
|
"""An autonomous widget to display the status of BEC services.
|
@@ -290,6 +295,11 @@ class BECStatusBox(BECWidget, QWidget):
|
|
290
295
|
if objects["item"] == item:
|
291
296
|
objects["widget"].show_popup()
|
292
297
|
|
298
|
+
def cleanup(self):
|
299
|
+
"""Cleanup the BECStatusBox widget."""
|
300
|
+
self.bec_service_status.cleanup()
|
301
|
+
return super().cleanup()
|
302
|
+
|
293
303
|
|
294
304
|
def main():
|
295
305
|
"""Main method to run the BECStatusBox widget."""
|
@@ -500,13 +500,14 @@ class BECImageShow(BECPlotBase):
|
|
500
500
|
self.update_image(device, data)
|
501
501
|
self.update_vrange(device, self.processor.config.stats)
|
502
502
|
|
503
|
-
@Slot(dict)
|
504
|
-
def on_image_update(self, msg: dict):
|
503
|
+
@Slot(dict, dict)
|
504
|
+
def on_image_update(self, msg: dict, metadata: dict):
|
505
505
|
"""
|
506
506
|
Update the image of the device monitor from bec.
|
507
507
|
|
508
508
|
Args:
|
509
509
|
msg(dict): The message from bec.
|
510
|
+
metadata(dict): The metadata of the message.
|
510
511
|
"""
|
511
512
|
data = msg["data"]
|
512
513
|
device = msg["device"]
|
@@ -493,13 +493,14 @@ class BECMotorMap(BECPlotBase):
|
|
493
493
|
f"Motor position: ({round(float(current_x),precision)}, {round(float(current_y),precision)})"
|
494
494
|
)
|
495
495
|
|
496
|
-
@Slot(dict)
|
497
|
-
def on_device_readback(self, msg: dict) -> None:
|
496
|
+
@Slot(dict, dict)
|
497
|
+
def on_device_readback(self, msg: dict, metadata: dict) -> None:
|
498
498
|
"""
|
499
499
|
Update the motor map plot with the new motor position.
|
500
500
|
|
501
501
|
Args:
|
502
502
|
msg(dict): Message from the device readback.
|
503
|
+
metadata(dict): Metadata of the message.
|
503
504
|
"""
|
504
505
|
if self.motor_x is None or self.motor_y is None:
|
505
506
|
return
|
@@ -75,6 +75,10 @@ class SpinnerWidget(QWidget):
|
|
75
75
|
painter.drawArc(adjusted_rect, self.angle * 16, int(angle_span))
|
76
76
|
painter.end()
|
77
77
|
|
78
|
+
def closeEvent(self, event):
|
79
|
+
self.timer.stop()
|
80
|
+
super().closeEvent(event)
|
81
|
+
|
78
82
|
|
79
83
|
if __name__ == "__main__": # pragma: no cover
|
80
84
|
app = QApplication(sys.argv)
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=BtKhZI3dhK09En1BfpglYi-ZJwG6ZdC-iJr7kXFVfCg,8346
|
3
3
|
.pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=Joi3ErMqWxVmBpTF2lbJSnSOKTxyqSdG8I4I_E6JjEY,6875
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=DjdYKMos7dd7OVT0PWx_ypg9iLMju7znyW5wsG7qEjE,1308
|
8
8
|
README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=rZLVFquIBC7rDsx6pdDSGf7WtEAnRWGV-lItfCHqLhM,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
|
@@ -131,12 +131,12 @@ bec_widgets/widgets/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKV
|
|
131
131
|
bec_widgets/widgets/base_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
132
132
|
bec_widgets/widgets/base_classes/device_input_base.py,sha256=thCOHOa9Z0b3-vlNFWK6PT_DdPTANnfj0_DLES_K-eE,3902
|
133
133
|
bec_widgets/widgets/bec_queue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
134
|
-
bec_widgets/widgets/bec_queue/bec_queue.py,sha256=
|
134
|
+
bec_widgets/widgets/bec_queue/bec_queue.py,sha256=bU3HvghPuh7smTuKMp5WlJ0g3rW0UHIV05WekNHU8Q8,3846
|
135
135
|
bec_widgets/widgets/bec_queue/bec_queue.pyproject,sha256=VhoNmAv1DQUl9dg7dELyf5i4pZ5k65N3GnqOYiSwbQo,27
|
136
136
|
bec_widgets/widgets/bec_queue/bec_queue_plugin.py,sha256=QjT79mY32pFONBXOhv_Sem9nq648LYjXHBciqTWP9NU,1376
|
137
137
|
bec_widgets/widgets/bec_queue/register_bec_queue.py,sha256=XnwtUSa1asK1b80knKWodcyX9qJy4DnKsQL_FoDfZy4,463
|
138
138
|
bec_widgets/widgets/bec_status_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
139
|
-
bec_widgets/widgets/bec_status_box/bec_status_box.py,sha256=
|
139
|
+
bec_widgets/widgets/bec_status_box/bec_status_box.py,sha256=hlo-U9rf1jzSCXpCjx3tthNYT8KImxKSRri5gsCULvw,13108
|
140
140
|
bec_widgets/widgets/bec_status_box/bec_status_box.pyproject,sha256=JWtx3Csfn2h7ODtk10HtyBNLf6tFIqyU6g04rMWOO1U,32
|
141
141
|
bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py,sha256=1yyH1vrhVoCVJg9ezo1ADaM0aoTYG8lPVvmulI7Npps,1433
|
142
142
|
bec_widgets/widgets/bec_status_box/register_bec_status_box.py,sha256=EiQITnkNw7IU7hE776wAeXro97eZd9XlsB9essgCebE,481
|
@@ -181,11 +181,11 @@ bec_widgets/widgets/figure/plots/axis_settings.py,sha256=QxRpQwgfBr1H0HTjfOpiXi_
|
|
181
181
|
bec_widgets/widgets/figure/plots/axis_settings.ui,sha256=a2qIuK9lyi9HCyrSvPr6wxzmm1FymaWcpmyOhMIiFt8,11013
|
182
182
|
bec_widgets/widgets/figure/plots/plot_base.py,sha256=AxzH2J-bLngxlWcgWWgNpLhIQxQzFz-H6yLf5Dou93Y,10921
|
183
183
|
bec_widgets/widgets/figure/plots/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
184
|
-
bec_widgets/widgets/figure/plots/image/image.py,sha256=
|
184
|
+
bec_widgets/widgets/figure/plots/image/image.py,sha256=o_tOWIVlsxdoTeY6qdp-6i6qnXZgaR5RWGJH_gHG-4s,24462
|
185
185
|
bec_widgets/widgets/figure/plots/image/image_item.py,sha256=RljjbkqJEr2cKDlqj1j5GQ1h89jpqOV-OpFz1TbED8I,10937
|
186
186
|
bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=GeTtWjbldy6VejMwPGQgM-o3d6bmLglCjdoktu19xfA,5262
|
187
187
|
bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
188
|
-
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=
|
188
|
+
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=wgARzsm98Y8SHPPwVp1LzNlXCxKEi6a8by8yYzIWsbY,18319
|
189
189
|
bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
190
190
|
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=EjKwD_pOhZYmXU2M_LdIv9A9cbVYxR1Y9lH0tbMNuJE,51710
|
191
191
|
bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=ZwRxSfPHbMWEvgUC-mL2orpZvtxR-DcrYAFikkdWEzk,8654
|
@@ -223,7 +223,7 @@ bec_widgets/widgets/scan_control/scan_control_plugin.py,sha256=vglBKLZKVSFsVxiU1
|
|
223
223
|
bec_widgets/widgets/scan_control/scan_group_box.py,sha256=wrrJLfI0apfll0NKpqM8ymlbl5NaqA9cKNgyfVdYR00,7420
|
224
224
|
bec_widgets/widgets/spinner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
225
225
|
bec_widgets/widgets/spinner/register_spinner_widget.py,sha256=_zCPjLh4M7NTSHP1Atdn6yu33zJ3LJkcBy3KOJ5eSVY,476
|
226
|
-
bec_widgets/widgets/spinner/spinner.py,sha256=
|
226
|
+
bec_widgets/widgets/spinner/spinner.py,sha256=qDUkYZ8-GN3nEv76BdRLNlYFazB9wzOj6DOYM_4SQnM,2589
|
227
227
|
bec_widgets/widgets/spinner/spinner_widget.pyproject,sha256=zzLajGB3DTgVnrSqMey2jRpBlxTq9cBXZL9tWJCKe-I,25
|
228
228
|
bec_widgets/widgets/spinner/spinner_widget_plugin.py,sha256=22b3n0ZGBDI44_cd72Q8ts_iKA3X1i1GhAQ80N2SGtU,1376
|
229
229
|
bec_widgets/widgets/stop_button/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -317,29 +317,29 @@ tests/end-2-end/conftest.py,sha256=-BLnFE-NeCerf6xahGCkbZ4Ktactowi6RkBnboIzRvg,1
|
|
317
317
|
tests/end-2-end/test_bec_dock_rpc_e2e.py,sha256=hj06aUBGofq7yeFVoT3LB4NrCjc5FbOo5CGTvz7afpI,9118
|
318
318
|
tests/end-2-end/test_bec_figure_rpc_e2e.py,sha256=73vuBbPJvkMR3w2jnQ7lk0z4-wN3HAmkLFDdv4BRPrM,6604
|
319
319
|
tests/end-2-end/test_rpc_register_e2e.py,sha256=blhMiW7HVHX1kGm5dg8Sv0PeCuJ0gnBz3evznQFz_B8,1619
|
320
|
-
tests/end-2-end/test_scan_control_e2e.py,sha256=
|
320
|
+
tests/end-2-end/test_scan_control_e2e.py,sha256=Jp1YGwgoAKdvn8e9P6sySEWMPAAlFRJO3WRwD_uZfHc,2295
|
321
321
|
tests/references/SpinnerWidget/SpinnerWidget_darwin.png,sha256=OyiGxyQx0XCKEa1OeAZFVfFXHAllBDOjsvyTA_dDmoc,8353
|
322
322
|
tests/references/SpinnerWidget/SpinnerWidget_linux.png,sha256=OyiGxyQx0XCKEa1OeAZFVfFXHAllBDOjsvyTA_dDmoc,8353
|
323
323
|
tests/references/SpinnerWidget/SpinnerWidget_started_darwin.png,sha256=NA7dOdKY-leFv8JI_5x3OIIY-XlSXSTIflVquz0UUZc,13784
|
324
324
|
tests/references/SpinnerWidget/SpinnerWidget_started_linux.png,sha256=NA7dOdKY-leFv8JI_5x3OIIY-XlSXSTIflVquz0UUZc,13784
|
325
325
|
tests/unit_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
326
326
|
tests/unit_tests/client_mocks.py,sha256=4pS4KvvFGY9hjphds9i-GoIjVWVkax4XpDnVp6Mctfw,5275
|
327
|
-
tests/unit_tests/conftest.py,sha256=
|
327
|
+
tests/unit_tests/conftest.py,sha256=TXlKoz9s-VzCfufvBh8ZC5cpaD-lm8WmHlf9WHd6E7w,965
|
328
328
|
tests/unit_tests/test_bec_connector.py,sha256=5uqBfjgMeOlGvqJlFbytxEpZ1El7_Y2q8fZHh4GvtD8,2478
|
329
329
|
tests/unit_tests/test_bec_dispatcher.py,sha256=rYPiRizHaswhGZw55IBMneDFxmPiCCLAZQBqjEkpdyY,3992
|
330
330
|
tests/unit_tests/test_bec_dock.py,sha256=j52o5ZhGzcSJ2VTtRPjVf9ZpQTdMLO4w-eXc6GB2c90,5593
|
331
331
|
tests/unit_tests/test_bec_figure.py,sha256=8AojxszCIzMi6EYB5mVFMQjk4pjgBCSp6PH2JZsuDkw,8724
|
332
|
-
tests/unit_tests/test_bec_image.py,sha256=
|
332
|
+
tests/unit_tests/test_bec_image.py,sha256=gMoIuKSSSql2EhRrqk7i-iUMNozc9v2jJ2XGAnR0Oyw,2576
|
333
333
|
tests/unit_tests/test_bec_image_widget.py,sha256=4-fdbsJsPuzJs8EFw9C1llcF4Zmv3vzJcA9t34J0WD4,7478
|
334
|
-
tests/unit_tests/test_bec_motor_map.py,sha256=
|
335
|
-
tests/unit_tests/test_bec_queue.py,sha256=
|
336
|
-
tests/unit_tests/test_bec_status_box.py,sha256=
|
334
|
+
tests/unit_tests/test_bec_motor_map.py,sha256=lIyUeEroJKUZ8CPil-s6ASWmpjTMwzkUz6y5ev43klY,9047
|
335
|
+
tests/unit_tests/test_bec_queue.py,sha256=sH_6s1hsJEbzHiaOBtveM6qXD01TNa4F-6uM8RWrzpE,4665
|
336
|
+
tests/unit_tests/test_bec_status_box.py,sha256=KUtupooe0xrSej2JYl8SpJcvtSsXGNN_plh4hDKKohY,4887
|
337
337
|
tests/unit_tests/test_client_utils.py,sha256=CBdWIVJ_UiyFzTJnX3XJm4PGw2uXhFvRCP_Y9ifckbw,2630
|
338
338
|
tests/unit_tests/test_color_map_selector.py,sha256=tsfCwHnEQoQhzA1ZpLhbGCMPqDX5hmH_YIzYTmBwnoM,1516
|
339
339
|
tests/unit_tests/test_color_validation.py,sha256=xbFbtFDia36XLgaNrX2IwvAX3IDC_Odpj5BGoJSgiIE,2389
|
340
340
|
tests/unit_tests/test_crosshair.py,sha256=3OMAJ2ZaISYXMOtkXf1rPdy94vCr8njeLi6uHblBL9Q,5045
|
341
341
|
tests/unit_tests/test_device_box.py,sha256=q9IVFpt1NF3TBF0Jhk-I-LRiuvvHG3FGUalw4jEYwVo,3431
|
342
|
-
tests/unit_tests/test_device_input_base.py,sha256=
|
342
|
+
tests/unit_tests/test_device_input_base.py,sha256=acPoX2COCtdAv6_hu4oNO2m7FD6y_Z7N3EIn_JG-9ic,2878
|
343
343
|
tests/unit_tests/test_device_input_widgets.py,sha256=GeM9Ed5jmPvSQTHUl3nAZuQRfSD-ryA_w9kocjPXiwk,5935
|
344
344
|
tests/unit_tests/test_error_utils.py,sha256=LQOxz29WCGOe0qwFkaPDixjUmdnF3qeAGxD4A3t9IKg,2108
|
345
345
|
tests/unit_tests/test_generate_cli_client.py,sha256=ng-eV5iF7Dhm-6YpxYo99CMY0KgqoaZBQNkMeKULDBU,3355
|
@@ -351,14 +351,14 @@ tests/unit_tests/test_ring_progress_bar.py,sha256=hDlqkQho7FR7HAfM4Zrr4q1m773a3_
|
|
351
351
|
tests/unit_tests/test_rpc_register.py,sha256=hECjZEimd440mwRrO0rg7L3PKN7__3DgjmESN6wx3bo,1179
|
352
352
|
tests/unit_tests/test_rpc_server.py,sha256=MvstcvqUsnGAzUxw8Et1xXXikk_VIxFPwDZD0v1QGkg,1500
|
353
353
|
tests/unit_tests/test_rpc_widget_handler.py,sha256=ceQ3BPnBIFY2Hy-sDPw0wxxREVTTphILts0gvX9qoUw,234
|
354
|
-
tests/unit_tests/test_scan_control.py,sha256=
|
354
|
+
tests/unit_tests/test_scan_control.py,sha256=W7bMB57UDaEnMiX4xvDs_fUXuPWcuISLPWqPR_w40-k,13478
|
355
355
|
tests/unit_tests/test_scan_control_group_box.py,sha256=HNqjP10B_NonikspNwKz9upJU-t7xf6hwBerNhbC-uo,5563
|
356
|
-
tests/unit_tests/test_setting_dialog.py,sha256=
|
357
|
-
tests/unit_tests/test_spinner.py,sha256=
|
356
|
+
tests/unit_tests/test_setting_dialog.py,sha256=dbTJ9AEFkwyhnm0wCqSNuIVNQgwa06MtXrdyRZ1tuu0,3136
|
357
|
+
tests/unit_tests/test_spinner.py,sha256=Moq84xC4ZLRQCcFLuTCrWIYdP4Y8E49s_IlZ3tKx9Jc,814
|
358
358
|
tests/unit_tests/test_stop_button.py,sha256=tpQanzBUyl7qLXjbMUQqm3U3vShbKKARcnLpgsu3P0E,789
|
359
359
|
tests/unit_tests/test_text_box_widget.py,sha256=cT0uEHt_6d-FwST0A_wE9sFW9E3F_nJbKhuBAeU4yHg,1862
|
360
|
-
tests/unit_tests/test_toggle.py,sha256=
|
361
|
-
tests/unit_tests/test_vscode_widget.py,sha256=
|
360
|
+
tests/unit_tests/test_toggle.py,sha256=X8PT4MWbY7hCcUrHx2dYNj8PK9-77J7r3a9jc3QGhhY,851
|
361
|
+
tests/unit_tests/test_vscode_widget.py,sha256=2jwOFqwjqCD846t5tYi5oOognvBGO-9OSlMxqxDlTzg,2741
|
362
362
|
tests/unit_tests/test_waveform1d.py,sha256=ZuHCvGubMuaLIzaMWDvmBUhgzUHCDLdvTZqIOfBKaZg,22713
|
363
363
|
tests/unit_tests/test_waveform_widget.py,sha256=ipUKnHvQ1SBpenO9ZhQOsT-L_nkDElH3XxVUknCSp_4,8592
|
364
364
|
tests/unit_tests/test_website_widget.py,sha256=fBADIJJBAHU4Ro7u95kdemFVNv196UOcuO9oLHuHt8A,761
|
@@ -369,8 +369,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
369
369
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
370
370
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
371
371
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
372
|
-
bec_widgets-0.92.
|
373
|
-
bec_widgets-0.92.
|
374
|
-
bec_widgets-0.92.
|
375
|
-
bec_widgets-0.92.
|
376
|
-
bec_widgets-0.92.
|
372
|
+
bec_widgets-0.92.5.dist-info/METADATA,sha256=DjdYKMos7dd7OVT0PWx_ypg9iLMju7znyW5wsG7qEjE,1308
|
373
|
+
bec_widgets-0.92.5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
374
|
+
bec_widgets-0.92.5.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
|
375
|
+
bec_widgets-0.92.5.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
376
|
+
bec_widgets-0.92.5.dist-info/RECORD,,
|
pyproject.toml
CHANGED
tests/unit_tests/conftest.py
CHANGED
@@ -8,6 +8,7 @@ from bec_widgets.utils import bec_dispatcher as bec_dispatcher_module
|
|
8
8
|
@pytest.fixture(autouse=True)
|
9
9
|
def qapplication(qapp): # pylint: disable=unused-argument
|
10
10
|
yield
|
11
|
+
qapp.processEvents() # make sure all events are processed before shutting down
|
11
12
|
|
12
13
|
|
13
14
|
@pytest.fixture(autouse=True)
|
@@ -17,10 +17,8 @@ def bec_image_show(bec_figure):
|
|
17
17
|
|
18
18
|
def test_on_image_update(bec_image_show):
|
19
19
|
data = np.random.rand(100, 100)
|
20
|
-
msg = messages.DeviceMonitor2DMessage(
|
21
|
-
|
22
|
-
).model_dump()
|
23
|
-
bec_image_show.on_image_update(msg)
|
20
|
+
msg = messages.DeviceMonitor2DMessage(device="eiger", data=data, metadata={"scan_id": "12345"})
|
21
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
24
22
|
img = bec_image_show.images[0]
|
25
23
|
assert np.array_equal(img.get_data(), data)
|
26
24
|
|
@@ -28,10 +26,8 @@ def test_on_image_update(bec_image_show):
|
|
28
26
|
def test_autorange_on_image_update(bec_image_show):
|
29
27
|
# Check if autorange mode "mean" works, should be default
|
30
28
|
data = np.random.rand(100, 100)
|
31
|
-
msg = messages.DeviceMonitor2DMessage(
|
32
|
-
|
33
|
-
).model_dump()
|
34
|
-
bec_image_show.on_image_update(msg)
|
29
|
+
msg = messages.DeviceMonitor2DMessage(device="eiger", data=data, metadata={"scan_id": "12345"})
|
30
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
35
31
|
img = bec_image_show.images[0]
|
36
32
|
assert np.array_equal(img.get_data(), data)
|
37
33
|
vmin = max(np.mean(data) - 2 * np.std(data), 0)
|
@@ -39,7 +35,7 @@ def test_autorange_on_image_update(bec_image_show):
|
|
39
35
|
assert np.isclose(img.color_bar.getLevels(), (vmin, vmax), rtol=(1e-5, 1e-5)).all()
|
40
36
|
# Test general update with autorange True, mode "max"
|
41
37
|
bec_image_show.set_autorange_mode("max")
|
42
|
-
bec_image_show.on_image_update(msg)
|
38
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
43
39
|
img = bec_image_show.images[0]
|
44
40
|
vmin = np.min(data)
|
45
41
|
vmax = np.max(data)
|
@@ -47,18 +43,16 @@ def test_autorange_on_image_update(bec_image_show):
|
|
47
43
|
assert np.isclose(img.color_bar.getLevels(), (vmin, vmax), rtol=(1e-5, 1e-5)).all()
|
48
44
|
# Change the input data, and switch to autorange False, colormap levels should stay untouched
|
49
45
|
data *= 100
|
50
|
-
msg = messages.DeviceMonitor2DMessage(
|
51
|
-
device="eiger", data=data, metadata={"scan_id": "12345"}
|
52
|
-
).model_dump()
|
46
|
+
msg = messages.DeviceMonitor2DMessage(device="eiger", data=data, metadata={"scan_id": "12345"})
|
53
47
|
bec_image_show.set_autorange(False)
|
54
|
-
bec_image_show.on_image_update(msg)
|
48
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
55
49
|
img = bec_image_show.images[0]
|
56
50
|
assert np.array_equal(img.get_data(), data)
|
57
51
|
assert np.isclose(img.color_bar.getLevels(), (vmin, vmax), rtol=(1e-3, 1e-3)).all()
|
58
52
|
# Reactivate autorange, should now scale the new data
|
59
53
|
bec_image_show.set_autorange(True)
|
60
54
|
bec_image_show.set_autorange_mode("mean")
|
61
|
-
bec_image_show.on_image_update(msg)
|
55
|
+
bec_image_show.on_image_update(msg.content, msg.metadata)
|
62
56
|
img = bec_image_show.images[0]
|
63
57
|
vmin = max(np.mean(data) - 2 * np.std(data), 0)
|
64
58
|
vmax = np.mean(data) + 2 * np.std(data)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import numpy as np
|
2
2
|
import pytest
|
3
|
+
from bec_lib.messages import DeviceMessage
|
3
4
|
|
4
5
|
from bec_widgets.widgets.figure.plots.motor_map.motor_map import BECMotorMap, MotorMapConfig
|
5
6
|
from bec_widgets.widgets.figure.plots.waveform.waveform_curve import SignalData
|
@@ -72,7 +73,8 @@ def test_motor_movement_updates_position_and_database(bec_figure):
|
|
72
73
|
|
73
74
|
# Simulate motor movement for 'samx' only
|
74
75
|
new_position_samx = 4.0
|
75
|
-
|
76
|
+
msg = DeviceMessage(signals={"samx": {"value": new_position_samx}}, metadata={})
|
77
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
76
78
|
|
77
79
|
init_positions["samx"].append(new_position_samx)
|
78
80
|
init_positions["samy"].append(init_positions["samy"][-1])
|
@@ -96,7 +98,8 @@ def test_scatter_plot_rendering(bec_figure):
|
|
96
98
|
|
97
99
|
# Simulate motor movement for 'samx' only
|
98
100
|
new_position_samx = 4.0
|
99
|
-
|
101
|
+
msg = DeviceMessage(signals={"samx": {"value": new_position_samx}}, metadata={})
|
102
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
100
103
|
mm._update_plot()
|
101
104
|
|
102
105
|
# Get the scatter plot item
|
@@ -116,8 +119,10 @@ def test_plot_visualization_consistency(bec_figure):
|
|
116
119
|
mm = bec_figure.motor_map("samx", "samy")
|
117
120
|
mm.change_motors("samx", "samy")
|
118
121
|
# Simulate updating the plot with new data
|
119
|
-
|
120
|
-
mm.on_device_readback(
|
122
|
+
msg = DeviceMessage(signals={"samx": {"value": 5}}, metadata={})
|
123
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
124
|
+
msg = DeviceMessage(signals={"samy": {"value": 9}}, metadata={})
|
125
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
121
126
|
mm._update_plot()
|
122
127
|
|
123
128
|
scatter_plot_item = mm.plot_components["scatter"]
|
@@ -234,10 +239,14 @@ def test_motor_map_get_data_max_points(bec_figure, qtbot):
|
|
234
239
|
"samx": [motor_map_dev["samx"].read()["samx"]["value"]],
|
235
240
|
"samy": [motor_map_dev["samy"].read()["samy"]["value"]],
|
236
241
|
}
|
237
|
-
|
238
|
-
mm.on_device_readback(
|
239
|
-
|
240
|
-
mm.on_device_readback(
|
242
|
+
msg = DeviceMessage(signals={"samx": {"value": 5.0}}, metadata={})
|
243
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
244
|
+
msg = DeviceMessage(signals={"samy": {"value": 9.0}}, metadata={})
|
245
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
246
|
+
msg = DeviceMessage(signals={"samx": {"value": 6.0}}, metadata={})
|
247
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
248
|
+
msg = DeviceMessage(signals={"samy": {"value": 7.0}}, metadata={})
|
249
|
+
mm.on_device_readback(msg.content, msg.metadata)
|
241
250
|
|
242
251
|
expected_x = [init_positions["samx"][-1], 5.0, 5.0, 6.0, 6.0]
|
243
252
|
expected_y = [init_positions["samy"][-1], init_positions["samy"][-1], 9.0, 9.0, 7.0]
|
@@ -93,19 +93,20 @@ def bec_queue(qtbot, mocked_client):
|
|
93
93
|
qtbot.addWidget(widget)
|
94
94
|
qtbot.waitExposed(widget)
|
95
95
|
yield widget
|
96
|
+
widget.close()
|
96
97
|
|
97
98
|
|
98
99
|
def test_bec_queue(bec_queue, bec_queue_msg_full):
|
99
100
|
bec_queue.update_queue(bec_queue_msg_full.content, {})
|
100
|
-
assert bec_queue.rowCount() == 1
|
101
|
-
assert bec_queue.item(0, 0).text() == "1289"
|
102
|
-
assert bec_queue.item(0, 1).text() == "line_scan"
|
103
|
-
assert bec_queue.item(0, 2).text() == "COMPLETED"
|
101
|
+
assert bec_queue.table.rowCount() == 1
|
102
|
+
assert bec_queue.table.item(0, 0).text() == "1289"
|
103
|
+
assert bec_queue.table.item(0, 1).text() == "line_scan"
|
104
|
+
assert bec_queue.table.item(0, 2).text() == "COMPLETED"
|
104
105
|
|
105
106
|
|
106
107
|
def test_bec_queue_empty(bec_queue):
|
107
108
|
bec_queue.update_queue({}, {})
|
108
|
-
assert bec_queue.rowCount() == 1
|
109
|
-
assert bec_queue.item(0, 0).text() == ""
|
110
|
-
assert bec_queue.item(0, 1).text() == ""
|
111
|
-
assert bec_queue.item(0, 2).text() == ""
|
109
|
+
assert bec_queue.table.rowCount() == 1
|
110
|
+
assert bec_queue.table.item(0, 0).text() == ""
|
111
|
+
assert bec_queue.table.item(0, 1).text() == ""
|
112
|
+
assert bec_queue.table.item(0, 2).text() == ""
|
@@ -8,13 +8,18 @@ from .client_mocks import mocked_client
|
|
8
8
|
|
9
9
|
# DeviceInputBase is meant to be mixed in a QWidget
|
10
10
|
class DeviceInputWidget(DeviceInputBase, QWidget):
|
11
|
-
|
11
|
+
def __init__(self, parent=None, client=None, config=None, gui_id=None):
|
12
|
+
super().__init__(client=client, config=config, gui_id=gui_id)
|
13
|
+
QWidget.__init__(self, parent=parent)
|
12
14
|
|
13
15
|
|
14
16
|
@pytest.fixture
|
15
|
-
def device_input_base(mocked_client):
|
17
|
+
def device_input_base(qtbot, mocked_client):
|
16
18
|
widget = DeviceInputWidget(client=mocked_client)
|
19
|
+
qtbot.addWidget(widget)
|
20
|
+
qtbot.waitExposed(widget)
|
17
21
|
yield widget
|
22
|
+
widget.close()
|
18
23
|
|
19
24
|
|
20
25
|
def test_device_input_base_init(device_input_base):
|
@@ -46,23 +46,23 @@ def test_setting_widget_display_current_settings(setting_widget):
|
|
46
46
|
# SettingsDialog tests
|
47
47
|
###################################
|
48
48
|
@pytest.fixture
|
49
|
-
def settings_dialog(qtbot):
|
49
|
+
def settings_dialog(qtbot, setting_widget):
|
50
50
|
parent_widget = QWidget()
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
settings_widget.accept_changes = MagicMock()
|
51
|
+
setting_widget.set_target_widget = MagicMock()
|
52
|
+
setting_widget.display_current_settings = MagicMock()
|
53
|
+
setting_widget.accept_changes = MagicMock()
|
55
54
|
|
56
55
|
dialog = SettingsDialog(
|
57
56
|
parent=parent_widget,
|
58
|
-
settings_widget=
|
57
|
+
settings_widget=setting_widget,
|
59
58
|
window_title="Test Settings",
|
60
59
|
config={"setting1": "value1", "setting2": "value2"},
|
61
60
|
)
|
62
61
|
qtbot.addWidget(dialog)
|
63
62
|
qtbot.waitExposed(dialog)
|
64
|
-
yield dialog, parent_widget,
|
63
|
+
yield dialog, parent_widget, setting_widget
|
65
64
|
dialog.close()
|
65
|
+
parent_widget.close()
|
66
66
|
|
67
67
|
|
68
68
|
def test_settings_dialog_initialization(settings_dialog):
|
tests/unit_tests/test_spinner.py
CHANGED
tests/unit_tests/test_toggle.py
CHANGED
@@ -14,7 +14,9 @@ from .client_mocks import mocked_client
|
|
14
14
|
def vscode_widget(qtbot, mocked_client):
|
15
15
|
with mock.patch("bec_widgets.widgets.vscode.vscode.subprocess.Popen") as mock_popen:
|
16
16
|
widget = VSCodeEditor(client=mocked_client)
|
17
|
+
# qtbot.addWidget(widget)
|
17
18
|
yield widget
|
19
|
+
# widget.close()
|
18
20
|
|
19
21
|
|
20
22
|
def test_vscode_widget(qtbot, vscode_widget):
|
File without changes
|
File without changes
|
File without changes
|