bec-widgets 0.94.1__py3-none-any.whl → 0.94.3__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 -16
- PKG-INFO +1 -1
- bec_widgets/examples/jupyter_console/jupyter_console_window.py +1 -0
- bec_widgets/widgets/figure/plots/image/image.py +6 -5
- bec_widgets/widgets/figure/plots/waveform/waveform.py +7 -5
- bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py +17 -15
- {bec_widgets-0.94.1.dist-info → bec_widgets-0.94.3.dist-info}/METADATA +1 -1
- {bec_widgets-0.94.1.dist-info → bec_widgets-0.94.3.dist-info}/RECORD +13 -13
- pyproject.toml +1 -1
- tests/unit_tests/test_waveform_widget.py +199 -0
- {bec_widgets-0.94.1.dist-info → bec_widgets-0.94.3.dist-info}/WHEEL +0 -0
- {bec_widgets-0.94.1.dist-info → bec_widgets-0.94.3.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.94.1.dist-info → bec_widgets-0.94.3.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.94.3 (2024-08-13)
|
4
|
+
|
5
|
+
### Fix
|
6
|
+
|
7
|
+
* fix(curve_dialog): async curves are shown in curve dialog after addition. ([`7aeb2b5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7aeb2b5c26c7c2851e8d663d32521da8daec95ef))
|
8
|
+
|
9
|
+
* fix(waveform): async device entry is correctly passed, updated and with new scan the previous data are cleared ([`d56ea95`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d56ea95ef97bfdd0bc3eeddc4505d20b38e28559))
|
10
|
+
|
11
|
+
### Test
|
12
|
+
|
13
|
+
* test(waveform_widget): added tests for axis setting and curve dialog ([`f285b35`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f285b35b491660549e74349318119f7c2c44f619))
|
14
|
+
|
15
|
+
## v0.94.2 (2024-08-13)
|
16
|
+
|
17
|
+
### Fix
|
18
|
+
|
19
|
+
* fix(image): image is single image mode do not raise popup error when connected twice with the same monitor ([`98b79aa`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/98b79aac7b47b73137f4d582f7f1d552b1d95366))
|
20
|
+
|
3
21
|
## v0.94.1 (2024-08-12)
|
4
22
|
|
5
23
|
### Fix
|
@@ -124,10 +142,6 @@ This reverts commit fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6 ([`5aad401`](https:
|
|
124
142
|
|
125
143
|
## v0.92.1 (2024-07-28)
|
126
144
|
|
127
|
-
### Build
|
128
|
-
|
129
|
-
* build(ci): install ophyd_devices in editable mode for pipelines ([`06205e0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/06205e07903d93accf40abab153f440059f236ed))
|
130
|
-
|
131
145
|
### Fix
|
132
146
|
|
133
147
|
* fix: use SafeSlot instead of Slot ([`bc1e239`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/bc1e23944cc0e5a861e3d0b4dc5b4ac6292d5269))
|
@@ -135,15 +149,3 @@ This reverts commit fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6 ([`5aad401`](https:
|
|
135
149
|
* fix: linting ([`a3fe205`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a3fe20500ae2ac03dcde07432f7e21ce5262ce46))
|
136
150
|
|
137
151
|
* fix: always add a QApplication for tests ([`61a4e32`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/61a4e32deb337ed27f2f43358b88b7266413b58e))
|
138
|
-
|
139
|
-
* fix: add xvfb to draw offscreen ([`3d681f7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3d681f77e144e74138fc5fa65630004d7c166878))
|
140
|
-
|
141
|
-
* fix: reset ErrorPopup singleton between tests ([`5a9ccfd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5a9ccfd1f6d2aacd5d86c1a34f74163b272d1ae4))
|
142
|
-
|
143
|
-
* fix: metaclass + QObject segfaults PyQt(cpp bindings) ([`fc57b7a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fc57b7a1262031a2df9e6a99493db87e766b779a))
|
144
|
-
|
145
|
-
### Refactor
|
146
|
-
|
147
|
-
* refactor: renamed DeviceMonitor2DMessage ([`4be6fd6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4be6fd6b83ea1048f16310f7d2bbe777b13b245e))
|
148
|
-
|
149
|
-
* refactor: rename device_monitor to device_monitor_2d ([`714e1e1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/714e1e139e0033d2725fefb636c419ca137a68c6))
|
PKG-INFO
CHANGED
@@ -251,9 +251,10 @@ class BECImageShow(BECPlotBase):
|
|
251
251
|
|
252
252
|
image_exits = self._check_image_id(monitor, self._images)
|
253
253
|
if image_exits:
|
254
|
-
raise ValueError(
|
255
|
-
|
256
|
-
)
|
254
|
+
# raise ValueError(
|
255
|
+
# f"Monitor with ID '{monitor}' already exists in widget '{self.gui_id}'."
|
256
|
+
# )
|
257
|
+
return
|
257
258
|
|
258
259
|
# monitor = self.entry_validator.validate_monitor(monitor)
|
259
260
|
|
@@ -577,10 +578,10 @@ class BECImageShow(BECPlotBase):
|
|
577
578
|
self, source: str, name: str, config: ImageItemConfig, data=None
|
578
579
|
) -> BECImageItem: # TODO fix types
|
579
580
|
config.parent_id = self.gui_id
|
580
|
-
image = BECImageItem(config=config, parent_image=self)
|
581
|
-
self.plot_item.addItem(image)
|
582
581
|
if self.single_image is True and len(self.images) > 0:
|
583
582
|
self.remove_image(0)
|
583
|
+
image = BECImageItem(config=config, parent_image=self)
|
584
|
+
self.plot_item.addItem(image)
|
584
585
|
self._images[source][name] = image
|
585
586
|
if source == "device_monitor_2d":
|
586
587
|
self._connect_device_monitor_2d(config.monitor)
|
@@ -943,7 +943,9 @@ class BECWaveform(BECPlotBase):
|
|
943
943
|
self.setup_dap(self.old_scan_id, self.scan_id)
|
944
944
|
if self._curves_data["async"]:
|
945
945
|
for curve_id, curve in self._curves_data["async"].items():
|
946
|
-
self.setup_async(
|
946
|
+
self.setup_async(
|
947
|
+
name=curve.config.signals.y.name, entry=curve.config.signals.y.entry
|
948
|
+
)
|
947
949
|
|
948
950
|
@Slot(dict, dict)
|
949
951
|
def on_scan_segment(self, msg: dict, metadata: dict):
|
@@ -1005,18 +1007,18 @@ class BECWaveform(BECPlotBase):
|
|
1005
1007
|
)
|
1006
1008
|
|
1007
1009
|
@Slot(str)
|
1008
|
-
def setup_async(self,
|
1010
|
+
def setup_async(self, name: str, entry: str):
|
1009
1011
|
self.bec_dispatcher.disconnect_slot(
|
1010
|
-
self.on_async_readback, MessageEndpoints.device_async_readback(self.old_scan_id,
|
1012
|
+
self.on_async_readback, MessageEndpoints.device_async_readback(self.old_scan_id, name)
|
1011
1013
|
)
|
1012
1014
|
try:
|
1013
|
-
self._curves_data["async"][f"{
|
1015
|
+
self._curves_data["async"][f"{name}-{entry}"].clear_data()
|
1014
1016
|
except KeyError:
|
1015
1017
|
pass
|
1016
1018
|
if len(self._curves_data["async"]) > 0:
|
1017
1019
|
self.bec_dispatcher.connect_slot(
|
1018
1020
|
self.on_async_readback,
|
1019
|
-
MessageEndpoints.device_async_readback(self.scan_id,
|
1021
|
+
MessageEndpoints.device_async_readback(self.scan_id, name),
|
1020
1022
|
from_start=True,
|
1021
1023
|
)
|
1022
1024
|
|
@@ -58,16 +58,17 @@ class CurveSettings(SettingWidget):
|
|
58
58
|
self.ui.color_map_selector_scan.combo.setCurrentText(cm)
|
59
59
|
|
60
60
|
# Scan Curve Table
|
61
|
-
for
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
61
|
+
for source in ["scan_segment", "async"]:
|
62
|
+
for label, curve in config[source].items():
|
63
|
+
row_count = self.ui.scan_table.rowCount()
|
64
|
+
self.ui.scan_table.insertRow(row_count)
|
65
|
+
DialogRow(
|
66
|
+
parent=self,
|
67
|
+
table_widget=self.ui.scan_table,
|
68
|
+
client=self.target_widget.client,
|
69
|
+
row=row_count,
|
70
|
+
config=curve.config,
|
71
|
+
).add_scan_row()
|
71
72
|
|
72
73
|
# Add DAP Curves
|
73
74
|
for label, curve in config["DAP"].items():
|
@@ -132,11 +133,12 @@ class CurveSettings(SettingWidget):
|
|
132
133
|
self.accept_curve_changes()
|
133
134
|
|
134
135
|
def accept_curve_changes(self):
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
136
|
+
sources = ["scan_segment", "async", "DAP"]
|
137
|
+
old_curves = []
|
138
|
+
|
139
|
+
for source in sources:
|
140
|
+
old_curves += list(self.target_widget.waveform._curves_data[source].values())
|
141
|
+
for curve in old_curves:
|
140
142
|
curve.remove()
|
141
143
|
self.get_curve_params()
|
142
144
|
|
@@ -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=gE46tUW66TsIdZamfkYZMGj7-k6WJUT4oPY_7PPyQ3Q,6445
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=giIQGgT_Zow6YiayO_MJDB6XtuM2IEnWABhbbg14HrA,1307
|
8
8
|
README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=7CgY9VSUC5P1rXOXpjUppxnvxkVqsajIgSZQefR2-iA,2356
|
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
|
@@ -94,7 +94,7 @@ bec_widgets/examples/general_app/general_app.py,sha256=Ks9CKtIQIFOzKosh204zVg1lt
|
|
94
94
|
bec_widgets/examples/general_app/general_app.ui,sha256=TsejkM3Z8znnixyqxoj4SwhIIpIzTAuGAMkGXSS1aT8,10479
|
95
95
|
bec_widgets/examples/general_app/web_links.py,sha256=d5OgzgI9zb-NAC0pOGanOtJX3nZoe4x8QuQTw-_hK_8,434
|
96
96
|
bec_widgets/examples/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
97
|
-
bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=
|
97
|
+
bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=2PDhUevxU5YlZcoVokH5fgGdwFGIQFSN8x0DChhxoxE,6803
|
98
98
|
bec_widgets/examples/plugin_example_pyside/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
99
99
|
bec_widgets/examples/plugin_example_pyside/main.py,sha256=zDP5wO7wb3BVsQ15HOCRT1nNmCujIVRvSXZ3Txje8L0,549
|
100
100
|
bec_widgets/examples/plugin_example_pyside/registertictactoe.py,sha256=cVhBnP0qx5j9Jft-VeKvlTFE-bX58hbP45CX0f4r5pM,535
|
@@ -176,13 +176,13 @@ bec_widgets/widgets/figure/plots/axis_settings.py,sha256=QxRpQwgfBr1H0HTjfOpiXi_
|
|
176
176
|
bec_widgets/widgets/figure/plots/axis_settings.ui,sha256=a2qIuK9lyi9HCyrSvPr6wxzmm1FymaWcpmyOhMIiFt8,11013
|
177
177
|
bec_widgets/widgets/figure/plots/plot_base.py,sha256=TG9FZZJi9ixTeZ1yDOO4sl7fJ524wxbNcr-2_Qd2mcQ,11154
|
178
178
|
bec_widgets/widgets/figure/plots/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
179
|
-
bec_widgets/widgets/figure/plots/image/image.py,sha256=
|
179
|
+
bec_widgets/widgets/figure/plots/image/image.py,sha256=y2MqgJv6Njv-huDN_exn0Fq1rAh5vs_assKCKHgQH6I,24941
|
180
180
|
bec_widgets/widgets/figure/plots/image/image_item.py,sha256=RljjbkqJEr2cKDlqj1j5GQ1h89jpqOV-OpFz1TbED8I,10937
|
181
181
|
bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=GeTtWjbldy6VejMwPGQgM-o3d6bmLglCjdoktu19xfA,5262
|
182
182
|
bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
183
183
|
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=wgARzsm98Y8SHPPwVp1LzNlXCxKEi6a8by8yYzIWsbY,18319
|
184
184
|
bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
185
|
-
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256
|
185
|
+
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=-op62_CFX1Gu-Ag6CD5d3ylEDqu_ieTbfoTUF2zf7T8,51800
|
186
186
|
bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=ZwRxSfPHbMWEvgUC-mL2orpZvtxR-DcrYAFikkdWEzk,8654
|
187
187
|
bec_widgets/widgets/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
188
188
|
bec_widgets/widgets/image/bec_image_widget.pyproject,sha256=PHisdBo5_5UCApd27GkizzqgfdjsDx2bFZa_p9LiSW8,30
|
@@ -259,7 +259,7 @@ bec_widgets/widgets/waveform/register_bec_waveform_widget.py,sha256=qZHVZH_lP2hv
|
|
259
259
|
bec_widgets/widgets/waveform/waveform_widget.py,sha256=zErnkgwm69QZEVvNRLi57v9-zRQeu0IaJpYRj34mGmA,19125
|
260
260
|
bec_widgets/widgets/waveform/waveform_popups/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
261
261
|
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
262
|
-
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py,sha256=
|
262
|
+
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py,sha256=S1j44i1xxJtmCcNtbOsxF8XdklMPsG9t4-1DZ2YfOPw,13128
|
263
263
|
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.ui,sha256=OaQE5HlyBQ3RQoHqxOFHiUoNcx8SDZP5sHJ9NNGhsPI,10404
|
264
264
|
bec_widgets/widgets/waveform/waveform_popups/dap_summary_dialog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
265
265
|
bec_widgets/widgets/waveform/waveform_popups/dap_summary_dialog/dap_summary.ui,sha256=PFEKro61UXd-jmx65U4pqJ5D29DXtVnhQRnsnDvN-wM,6138
|
@@ -367,7 +367,7 @@ tests/unit_tests/test_text_box_widget.py,sha256=OhHy5gu_XgWU2WvcO5ZcGbZcc-tiE-lZ
|
|
367
367
|
tests/unit_tests/test_toggle.py,sha256=Amzgres7te0tTQIDR2WMKSx9Kce44TxMpIPR6HZygXQ,832
|
368
368
|
tests/unit_tests/test_vscode_widget.py,sha256=BOepZuDzbATK7_yy4wJEkVbz5VWSwVBj9__uxJ5vpM0,2748
|
369
369
|
tests/unit_tests/test_waveform1d.py,sha256=AOfpHvebsEVb-MNf8Shh2bAML5bandtvoXkYqKWe8qc,24470
|
370
|
-
tests/unit_tests/test_waveform_widget.py,sha256=
|
370
|
+
tests/unit_tests/test_waveform_widget.py,sha256=EcJim-T6rcMKChleSnolNhXh6AIeIpYyFTsbLl4TmEY,16728
|
371
371
|
tests/unit_tests/test_website_widget.py,sha256=POcHK4INck3quasMD14DBlBBJWD0uKJbkOMt_JsPhXA,708
|
372
372
|
tests/unit_tests/test_widget_io.py,sha256=FeL3ZYSBQnRt6jxj8VGYw1cmcicRQyHKleahw7XIyR0,3475
|
373
373
|
tests/unit_tests/test_yaml_dialog.py,sha256=SEvUgC_poWC6fAoHVWolaORpgMFc7c0Xqqk9cFvHSvo,5826
|
@@ -376,8 +376,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
376
376
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
377
377
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
378
378
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
379
|
-
bec_widgets-0.94.
|
380
|
-
bec_widgets-0.94.
|
381
|
-
bec_widgets-0.94.
|
382
|
-
bec_widgets-0.94.
|
383
|
-
bec_widgets-0.94.
|
379
|
+
bec_widgets-0.94.3.dist-info/METADATA,sha256=giIQGgT_Zow6YiayO_MJDB6XtuM2IEnWABhbbg14HrA,1307
|
380
|
+
bec_widgets-0.94.3.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
381
|
+
bec_widgets-0.94.3.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
|
382
|
+
bec_widgets-0.94.3.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
383
|
+
bec_widgets-0.94.3.dist-info/RECORD,,
|
pyproject.toml
CHANGED
@@ -3,6 +3,9 @@ from unittest.mock import MagicMock, patch
|
|
3
3
|
import pyqtgraph as pg
|
4
4
|
import pytest
|
5
5
|
|
6
|
+
from bec_widgets.qt_utils.settings_dialog import SettingsDialog
|
7
|
+
from bec_widgets.widgets.figure.plots.axis_settings import AxisSettings
|
8
|
+
from bec_widgets.widgets.waveform.waveform_popups.curve_dialog.curve_dialog import CurveSettings
|
6
9
|
from bec_widgets.widgets.waveform.waveform_widget import BECWaveformWidget
|
7
10
|
|
8
11
|
from .client_mocks import mocked_client
|
@@ -261,3 +264,199 @@ def test_enable_mouse_pan_mode(qtbot, waveform_widget):
|
|
261
264
|
assert action_drag.isChecked() == True
|
262
265
|
assert action_rectangle.isChecked() == False
|
263
266
|
mock_view_box.setMouseMode.assert_called_once_with(pg.ViewBox.PanMode)
|
267
|
+
|
268
|
+
|
269
|
+
###################################
|
270
|
+
# Curve Dialog Tests
|
271
|
+
###################################
|
272
|
+
def show_curve_dialog(qtbot, waveform_widget):
|
273
|
+
curve_dialog = SettingsDialog(
|
274
|
+
waveform_widget,
|
275
|
+
settings_widget=CurveSettings(),
|
276
|
+
window_title="Curve Settings",
|
277
|
+
config=waveform_widget.waveform._curves_data,
|
278
|
+
)
|
279
|
+
qtbot.addWidget(curve_dialog)
|
280
|
+
qtbot.waitExposed(curve_dialog)
|
281
|
+
return curve_dialog
|
282
|
+
|
283
|
+
|
284
|
+
def test_curve_dialog_scan_curves_interactions(qtbot, waveform_widget):
|
285
|
+
waveform_widget.plot(y_name="bpm4i")
|
286
|
+
waveform_widget.plot(y_name="bpm3a")
|
287
|
+
|
288
|
+
curve_dialog = show_curve_dialog(qtbot, waveform_widget)
|
289
|
+
|
290
|
+
# Check default display of config from waveform widget
|
291
|
+
assert curve_dialog is not None
|
292
|
+
assert curve_dialog.widget.ui.scan_table.rowCount() == 2
|
293
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(0, 0).text() == "bpm4i"
|
294
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(0, 1).text() == "bpm4i"
|
295
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(1, 0).text() == "bpm3a"
|
296
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(1, 1).text() == "bpm3a"
|
297
|
+
assert curve_dialog.widget.ui.x_mode.currentText() == "best_effort"
|
298
|
+
assert curve_dialog.widget.ui.x_name.isEnabled() == False
|
299
|
+
assert curve_dialog.widget.ui.x_entry.isEnabled() == False
|
300
|
+
|
301
|
+
# Add a new curve
|
302
|
+
curve_dialog.widget.ui.add_curve.click()
|
303
|
+
qtbot.wait(200)
|
304
|
+
assert curve_dialog.widget.ui.scan_table.rowCount() == 3
|
305
|
+
|
306
|
+
# Set device to new curve
|
307
|
+
curve_dialog.widget.ui.scan_table.cellWidget(2, 0).setText("bpm3i")
|
308
|
+
|
309
|
+
# Change the x mode to device
|
310
|
+
curve_dialog.widget.ui.x_mode.setCurrentText("device")
|
311
|
+
qtbot.wait(200)
|
312
|
+
assert curve_dialog.widget.ui.x_name.isEnabled() == True
|
313
|
+
assert curve_dialog.widget.ui.x_entry.isEnabled() == True
|
314
|
+
|
315
|
+
# Set the x device
|
316
|
+
curve_dialog.widget.ui.x_name.setText("samx")
|
317
|
+
|
318
|
+
# Delete first curve ('bpm4i')
|
319
|
+
curve_dialog.widget.ui.scan_table.cellWidget(0, 6).click()
|
320
|
+
qtbot.wait(200)
|
321
|
+
assert curve_dialog.widget.ui.scan_table.rowCount() == 2
|
322
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(0, 0).text() == "bpm3a"
|
323
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(0, 1).text() == "bpm3a"
|
324
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(1, 0).text() == "bpm3i"
|
325
|
+
|
326
|
+
# Close the dialog
|
327
|
+
curve_dialog.accept()
|
328
|
+
qtbot.wait(200)
|
329
|
+
|
330
|
+
# Check the curve data in the target widget
|
331
|
+
assert list(waveform_widget.waveform._curves_data["scan_segment"].keys()) == [
|
332
|
+
"bpm3a-bpm3a",
|
333
|
+
"bpm3i-bpm3i",
|
334
|
+
]
|
335
|
+
assert len(waveform_widget.curves) == 2
|
336
|
+
|
337
|
+
|
338
|
+
def test_curve_dialog_async(qtbot, waveform_widget):
|
339
|
+
waveform_widget.plot(y_name="bpm4i")
|
340
|
+
waveform_widget.plot(y_name="async_device")
|
341
|
+
|
342
|
+
curve_dialog = show_curve_dialog(qtbot, waveform_widget)
|
343
|
+
|
344
|
+
assert curve_dialog is not None
|
345
|
+
assert curve_dialog.widget.ui.scan_table.rowCount() == 2
|
346
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(0, 0).text() == "bpm4i"
|
347
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(0, 1).text() == "bpm4i"
|
348
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(1, 0).text() == "async_device"
|
349
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(1, 1).text() == "async_device"
|
350
|
+
|
351
|
+
|
352
|
+
def test_curve_dialog_dap(qtbot, waveform_widget):
|
353
|
+
waveform_widget.plot(x_name="samx", y_name="bpm4i", dap="GaussianModel")
|
354
|
+
|
355
|
+
curve_dialog = show_curve_dialog(qtbot, waveform_widget)
|
356
|
+
|
357
|
+
assert curve_dialog is not None
|
358
|
+
assert curve_dialog.widget.ui.scan_table.rowCount() == 1
|
359
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(0, 0).text() == "bpm4i"
|
360
|
+
assert curve_dialog.widget.ui.scan_table.cellWidget(0, 1).text() == "bpm4i"
|
361
|
+
assert curve_dialog.widget.ui.dap_table.isEnabled() == True
|
362
|
+
assert curve_dialog.widget.ui.dap_table.rowCount() == 1
|
363
|
+
assert curve_dialog.widget.ui.dap_table.cellWidget(0, 0).text() == "bpm4i"
|
364
|
+
assert curve_dialog.widget.ui.dap_table.cellWidget(0, 1).text() == "bpm4i"
|
365
|
+
assert curve_dialog.widget.ui.x_mode.currentText() == "device"
|
366
|
+
assert curve_dialog.widget.ui.x_name.isEnabled() == True
|
367
|
+
assert curve_dialog.widget.ui.x_entry.isEnabled() == True
|
368
|
+
assert curve_dialog.widget.ui.x_name.text() == "samx"
|
369
|
+
assert curve_dialog.widget.ui.x_entry.text() == "samx"
|
370
|
+
|
371
|
+
curve_dialog.accept()
|
372
|
+
qtbot.wait(200)
|
373
|
+
|
374
|
+
assert list(waveform_widget.waveform._curves_data["scan_segment"].keys()) == ["bpm4i-bpm4i"]
|
375
|
+
assert len(waveform_widget.curves) == 2
|
376
|
+
|
377
|
+
|
378
|
+
###################################
|
379
|
+
# Axis Dialog Tests
|
380
|
+
###################################
|
381
|
+
|
382
|
+
|
383
|
+
def show_axis_dialog(qtbot, waveform_widget):
|
384
|
+
axis_dialog = SettingsDialog(
|
385
|
+
waveform_widget,
|
386
|
+
settings_widget=AxisSettings(),
|
387
|
+
window_title="Axis Settings",
|
388
|
+
config=waveform_widget._config_dict["axis"],
|
389
|
+
)
|
390
|
+
qtbot.addWidget(axis_dialog)
|
391
|
+
qtbot.waitExposed(axis_dialog)
|
392
|
+
return axis_dialog
|
393
|
+
|
394
|
+
|
395
|
+
def test_axis_dialog_with_axis_limits(qtbot, waveform_widget):
|
396
|
+
waveform_widget.set(
|
397
|
+
title="Test Title",
|
398
|
+
x_label="X Label",
|
399
|
+
y_label="Y Label",
|
400
|
+
x_scale="linear",
|
401
|
+
y_scale="log",
|
402
|
+
x_lim=(0, 10),
|
403
|
+
y_lim=(0, 10),
|
404
|
+
)
|
405
|
+
|
406
|
+
axis_dialog = show_axis_dialog(qtbot, waveform_widget)
|
407
|
+
|
408
|
+
assert axis_dialog is not None
|
409
|
+
assert axis_dialog.widget.ui.plot_title.text() == "Test Title"
|
410
|
+
assert axis_dialog.widget.ui.x_label.text() == "X Label"
|
411
|
+
assert axis_dialog.widget.ui.y_label.text() == "Y Label"
|
412
|
+
assert axis_dialog.widget.ui.x_scale.currentText() == "linear"
|
413
|
+
assert axis_dialog.widget.ui.y_scale.currentText() == "log"
|
414
|
+
assert axis_dialog.widget.ui.x_min.value() == 0
|
415
|
+
assert axis_dialog.widget.ui.x_max.value() == 10
|
416
|
+
assert axis_dialog.widget.ui.y_min.value() == 0
|
417
|
+
assert axis_dialog.widget.ui.y_max.value() == 10
|
418
|
+
|
419
|
+
|
420
|
+
def test_axis_dialog_without_axis_limits(qtbot, waveform_widget):
|
421
|
+
waveform_widget.set(
|
422
|
+
title="Test Title", x_label="X Label", y_label="Y Label", x_scale="linear", y_scale="log"
|
423
|
+
)
|
424
|
+
x_range = waveform_widget.fig.widget_list[0].plot_item.viewRange()[0]
|
425
|
+
y_range = waveform_widget.fig.widget_list[0].plot_item.viewRange()[1]
|
426
|
+
|
427
|
+
axis_dialog = show_axis_dialog(qtbot, waveform_widget)
|
428
|
+
|
429
|
+
assert axis_dialog is not None
|
430
|
+
assert axis_dialog.widget.ui.plot_title.text() == "Test Title"
|
431
|
+
assert axis_dialog.widget.ui.x_label.text() == "X Label"
|
432
|
+
assert axis_dialog.widget.ui.y_label.text() == "Y Label"
|
433
|
+
assert axis_dialog.widget.ui.x_scale.currentText() == "linear"
|
434
|
+
assert axis_dialog.widget.ui.y_scale.currentText() == "log"
|
435
|
+
assert axis_dialog.widget.ui.x_min.value() == x_range[0]
|
436
|
+
assert axis_dialog.widget.ui.x_max.value() == x_range[1]
|
437
|
+
assert axis_dialog.widget.ui.y_min.value() == y_range[0]
|
438
|
+
assert axis_dialog.widget.ui.y_max.value() == y_range[1]
|
439
|
+
|
440
|
+
|
441
|
+
def test_axis_dialog_set_properties(qtbot, waveform_widget):
|
442
|
+
axis_dialog = show_axis_dialog(qtbot, waveform_widget)
|
443
|
+
|
444
|
+
axis_dialog.widget.ui.plot_title.setText("New Title")
|
445
|
+
axis_dialog.widget.ui.x_label.setText("New X Label")
|
446
|
+
axis_dialog.widget.ui.y_label.setText("New Y Label")
|
447
|
+
axis_dialog.widget.ui.x_scale.setCurrentText("log")
|
448
|
+
axis_dialog.widget.ui.y_scale.setCurrentText("linear")
|
449
|
+
axis_dialog.widget.ui.x_min.setValue(5)
|
450
|
+
axis_dialog.widget.ui.x_max.setValue(15)
|
451
|
+
axis_dialog.widget.ui.y_min.setValue(5)
|
452
|
+
axis_dialog.widget.ui.y_max.setValue(15)
|
453
|
+
|
454
|
+
axis_dialog.accept()
|
455
|
+
|
456
|
+
assert waveform_widget._config_dict["axis"]["title"] == "New Title"
|
457
|
+
assert waveform_widget._config_dict["axis"]["x_label"] == "New X Label"
|
458
|
+
assert waveform_widget._config_dict["axis"]["y_label"] == "New Y Label"
|
459
|
+
assert waveform_widget._config_dict["axis"]["x_scale"] == "log"
|
460
|
+
assert waveform_widget._config_dict["axis"]["y_scale"] == "linear"
|
461
|
+
assert waveform_widget._config_dict["axis"]["x_lim"] == (5, 15)
|
462
|
+
assert waveform_widget._config_dict["axis"]["y_lim"] == (5, 15)
|
File without changes
|
File without changes
|
File without changes
|