bec-widgets 0.56.2__py3-none-any.whl → 0.56.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.
- .gitlab-ci.yml +1 -1
- CHANGELOG.md +11 -12
- PKG-INFO +1 -1
- bec_widgets/cli/__init__.py +0 -7
- bec_widgets/cli/auto_updates.py +45 -13
- bec_widgets/cli/client_utils.py +11 -5
- {bec_widgets-0.56.2.dist-info → bec_widgets-0.56.3.dist-info}/METADATA +1 -1
- {bec_widgets-0.56.2.dist-info → bec_widgets-0.56.3.dist-info}/RECORD +13 -13
- pyproject.toml +1 -1
- tests/end-2-end/test_bec_dock_rpc_e2e.py +68 -0
- tests/unit_tests/test_client_utils.py +2 -2
- {bec_widgets-0.56.2.dist-info → bec_widgets-0.56.3.dist-info}/WHEEL +0 -0
- {bec_widgets-0.56.2.dist-info → bec_widgets-0.56.3.dist-info}/licenses/LICENSE +0 -0
.gitlab-ci.yml
CHANGED
CHANGELOG.md
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## v0.56.3 (2024-06-05)
|
6
|
+
|
7
|
+
### Ci
|
8
|
+
|
9
|
+
* ci: increased verbosity for e2e tests ([`4af1abe`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4af1abe4e15b62d2f7e70bf987a1a7d8694ef4d5))
|
10
|
+
|
11
|
+
### Fix
|
12
|
+
|
13
|
+
* fix: fixed support for auto updates ([`131f49d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/131f49da8ea65af4d44b50e81c1acfc29cd92093))
|
14
|
+
|
15
|
+
|
5
16
|
## v0.56.2 (2024-06-05)
|
6
17
|
|
7
18
|
### Documentation
|
@@ -162,15 +173,3 @@
|
|
162
173
|
|
163
174
|
|
164
175
|
## v0.51.0 (2024-05-07)
|
165
|
-
|
166
|
-
### Build
|
167
|
-
|
168
|
-
* build(cli): changed repo name to bec_widgets ([`799ea55`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/799ea554de9a7f3720d100be4886a63f02c6a390))
|
169
|
-
|
170
|
-
### Ci
|
171
|
-
|
172
|
-
* ci: added rule for parent-child pipelines ([`e085125`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e0851250eecb85503db929d37f75d2ba366308a6))
|
173
|
-
|
174
|
-
### Feature
|
175
|
-
|
176
|
-
* feat(utils): added plugin helper to find and load ([`5ece269`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5ece269adb0e9b0c2a468f1dfbaa6212e86d3561))
|
PKG-INFO
CHANGED
bec_widgets/cli/__init__.py
CHANGED
@@ -1,8 +1 @@
|
|
1
|
-
from bec_lib.utils.import_utils import lazy_import_from
|
2
|
-
|
3
|
-
# from .auto_updates import AutoUpdates, ScanInfo
|
4
|
-
# TODO: put back when Pydantic gets faster
|
5
|
-
AutoUpdates, ScanInfo = lazy_import_from(
|
6
|
-
"bec_widgets.cli.auto_updates", ("AutoUpdates", "ScanInfo")
|
7
|
-
)
|
8
1
|
from .client import BECDockArea, BECFigure
|
bec_widgets/cli/auto_updates.py
CHANGED
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING
|
|
5
5
|
from pydantic import BaseModel
|
6
6
|
|
7
7
|
if TYPE_CHECKING:
|
8
|
-
from .client import BECFigure
|
8
|
+
from .client import BECDockArea, BECFigure
|
9
9
|
|
10
10
|
|
11
11
|
class ScanInfo(BaseModel):
|
@@ -18,9 +18,20 @@ class ScanInfo(BaseModel):
|
|
18
18
|
|
19
19
|
|
20
20
|
class AutoUpdates:
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
create_default_dock: bool = False
|
22
|
+
enabled: bool = False
|
23
|
+
dock_name: str = None
|
24
|
+
|
25
|
+
def __init__(self, gui: BECDockArea):
|
26
|
+
self.gui = gui
|
27
|
+
|
28
|
+
def start_default_dock(self):
|
29
|
+
"""
|
30
|
+
Create a default dock for the auto updates.
|
31
|
+
"""
|
32
|
+
dock = self.gui.add_dock("default_figure")
|
33
|
+
dock.add_widget_bec("BECFigure")
|
34
|
+
self.dock_name = "default_figure"
|
24
35
|
|
25
36
|
@staticmethod
|
26
37
|
def get_scan_info(msg) -> ScanInfo:
|
@@ -44,6 +55,18 @@ class AutoUpdates:
|
|
44
55
|
status=status,
|
45
56
|
)
|
46
57
|
|
58
|
+
def get_default_figure(self) -> BECFigure | None:
|
59
|
+
"""
|
60
|
+
Get the default figure from the GUI.
|
61
|
+
"""
|
62
|
+
dock = self.gui.panels.get(self.dock_name, [])
|
63
|
+
if not dock:
|
64
|
+
return None
|
65
|
+
widgets = dock.widget_list
|
66
|
+
if not widgets:
|
67
|
+
return None
|
68
|
+
return widgets[0]
|
69
|
+
|
47
70
|
def run(self, msg):
|
48
71
|
"""
|
49
72
|
Run the update function if enabled.
|
@@ -86,33 +109,42 @@ class AutoUpdates:
|
|
86
109
|
"""
|
87
110
|
Simple line scan.
|
88
111
|
"""
|
112
|
+
fig = self.get_default_figure()
|
113
|
+
if not fig:
|
114
|
+
return
|
89
115
|
dev_x = info.scan_report_devices[0]
|
90
|
-
dev_y = self.get_selected_device(info.monitored_devices, self.
|
116
|
+
dev_y = self.get_selected_device(info.monitored_devices, self.gui.selected_device)
|
91
117
|
if not dev_y:
|
92
118
|
return
|
93
|
-
|
94
|
-
plt =
|
119
|
+
fig.clear_all()
|
120
|
+
plt = fig.plot(x_name=dev_x, y_name=dev_y)
|
95
121
|
plt.set(title=f"Scan {info.scan_number}", x_label=dev_x, y_label=dev_y)
|
96
122
|
|
97
123
|
def simple_grid_scan(self, info: ScanInfo) -> None:
|
98
124
|
"""
|
99
125
|
Simple grid scan.
|
100
126
|
"""
|
127
|
+
fig = self.get_default_figure()
|
128
|
+
if not fig:
|
129
|
+
return
|
101
130
|
dev_x = info.scan_report_devices[0]
|
102
131
|
dev_y = info.scan_report_devices[1]
|
103
|
-
dev_z = self.get_selected_device(info.monitored_devices, self.
|
104
|
-
|
105
|
-
plt =
|
132
|
+
dev_z = self.get_selected_device(info.monitored_devices, self.gui.selected_device)
|
133
|
+
fig.clear_all()
|
134
|
+
plt = fig.plot(x_name=dev_x, y_name=dev_y, z_name=dev_z, label=f"Scan {info.scan_number}")
|
106
135
|
plt.set(title=f"Scan {info.scan_number}", x_label=dev_x, y_label=dev_y)
|
107
136
|
|
108
137
|
def best_effort(self, info: ScanInfo) -> None:
|
109
138
|
"""
|
110
139
|
Best effort scan.
|
111
140
|
"""
|
141
|
+
fig = self.get_default_figure()
|
142
|
+
if not fig:
|
143
|
+
return
|
112
144
|
dev_x = info.scan_report_devices[0]
|
113
|
-
dev_y = self.get_selected_device(info.monitored_devices, self.
|
145
|
+
dev_y = self.get_selected_device(info.monitored_devices, self.gui.selected_device)
|
114
146
|
if not dev_y:
|
115
147
|
return
|
116
|
-
|
117
|
-
plt =
|
148
|
+
fig.clear_all()
|
149
|
+
plt = fig.plot(x_name=dev_x, y_name=dev_y, label=f"Scan {info.scan_number}")
|
118
150
|
plt.set(title=f"Scan {info.scan_number}", x_label=dev_x, y_label=dev_y)
|
bec_widgets/cli/client_utils.py
CHANGED
@@ -17,10 +17,13 @@ from bec_lib.utils.import_utils import isinstance_based_on_class_name, lazy_impo
|
|
17
17
|
from qtpy.QtCore import QCoreApplication
|
18
18
|
|
19
19
|
import bec_widgets.cli.client as client
|
20
|
+
from bec_widgets.cli.auto_updates import AutoUpdates
|
20
21
|
|
21
22
|
if TYPE_CHECKING:
|
22
23
|
from bec_lib.device import DeviceBase
|
23
24
|
|
25
|
+
from bec_widgets.cli.client import BECDockArea, BECFigure
|
26
|
+
|
24
27
|
messages = lazy_import("bec_lib.messages")
|
25
28
|
# from bec_lib.connector import MessageObject
|
26
29
|
MessageObject = lazy_import_from("bec_lib.connector", ("MessageObject",))
|
@@ -62,16 +65,19 @@ class BECGuiClientMixin:
|
|
62
65
|
def __init__(self, **kwargs) -> None:
|
63
66
|
super().__init__(**kwargs)
|
64
67
|
self._process = None
|
65
|
-
self.
|
68
|
+
self.auto_updates = self._get_update_script()
|
66
69
|
self._target_endpoint = MessageEndpoints.scan_status()
|
67
70
|
self._selected_device = None
|
68
71
|
self.stderr_output = []
|
69
72
|
|
70
|
-
def _get_update_script(self) -> AutoUpdates:
|
73
|
+
def _get_update_script(self) -> AutoUpdates | None:
|
71
74
|
eps = imd.entry_points(group="bec.widgets.auto_updates")
|
72
75
|
for ep in eps:
|
73
76
|
if ep.name == "plugin_widgets_update":
|
74
|
-
|
77
|
+
try:
|
78
|
+
return ep.load()(gui=self)
|
79
|
+
except Exception as e:
|
80
|
+
print(f"Error loading auto update script from plugin: {str(e)}")
|
75
81
|
return None
|
76
82
|
|
77
83
|
@property
|
@@ -97,7 +103,7 @@ class BECGuiClientMixin:
|
|
97
103
|
|
98
104
|
@staticmethod
|
99
105
|
def _handle_msg_update(msg: MessageObject, parent: BECGuiClientMixin) -> None:
|
100
|
-
if parent.
|
106
|
+
if parent.auto_updates is not None:
|
101
107
|
# pylint: disable=protected-access
|
102
108
|
parent._update_script_msg_parser(msg.value)
|
103
109
|
|
@@ -105,7 +111,7 @@ class BECGuiClientMixin:
|
|
105
111
|
if isinstance(msg, messages.ScanStatusMessage):
|
106
112
|
if not self.gui_is_alive():
|
107
113
|
return
|
108
|
-
self.
|
114
|
+
self.auto_updates.run(msg)
|
109
115
|
|
110
116
|
def show(self) -> None:
|
111
117
|
"""
|
@@ -1,12 +1,12 @@
|
|
1
1
|
.gitignore,sha256=cMQ1MLmnoR88aMCCJwUyfoTnufzl4-ckmHtlFUqHcT4,3253
|
2
|
-
.gitlab-ci.yml,sha256=
|
2
|
+
.gitlab-ci.yml,sha256=RF2JeGh8tG09DyAOwEu991IZy3C8Vm6lI8O_4Dr9B9Q,12239
|
3
3
|
.pylintrc,sha256=OstrgmEyP0smNFBKoIN5_26-UmNZgMHnbjvAWX0UrLs,18535
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=kanSLoK5uphXdlmpcQqyPg1Z31HfUlC-tbK4nmYvz8o,6924
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=V34V-R1GQv2uDyzy9qDYTnNNe2dbkeeDVpFI-Q8GSkU,1135
|
8
8
|
README.md,sha256=y4jB6wvArS7N8_iTbKWnSM_oRAqLA2GqgzUR-FMh5sU,2645
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=zn3vc-ka-y-TAwav3-etEpelzU-jsqo1KOzt55_6Ucw,1803
|
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
|
@@ -15,10 +15,10 @@ pyproject.toml,sha256=gPO0n84KHnJqOMohCjHJo8LvpNSAtUfsTcED4tcQnzU,1803
|
|
15
15
|
bec_widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
bec_widgets/assets/bec_widgets_icon.png,sha256=K8dgGwIjalDh9PRHUsSQBqgdX7a00nM3igZdc20pkYM,1747017
|
17
17
|
bec_widgets/assets/terminal_icon.png,sha256=bJl7Tft4Fi2uxvuXI8o14uMHnI9eAWKSU2uftXCH9ws,3889
|
18
|
-
bec_widgets/cli/__init__.py,sha256=
|
19
|
-
bec_widgets/cli/auto_updates.py,sha256=
|
18
|
+
bec_widgets/cli/__init__.py,sha256=tLD8HWgyURhMjYlKZ43pBu-qvGD1LI5o3n3rEieg-70,43
|
19
|
+
bec_widgets/cli/auto_updates.py,sha256=RFc9sbNE9Ec8K3U1DSrLzwUweM3W51Lmcp9D2gSt2e4,4696
|
20
20
|
bec_widgets/cli/client.py,sha256=tQIaQcNnOkF3M-Ym4_U7vMwpYWgVPEGAJY4ibnlPLgM,52909
|
21
|
-
bec_widgets/cli/client_utils.py,sha256=
|
21
|
+
bec_widgets/cli/client_utils.py,sha256=gxa9TpYCWa0a7jsrMaWv_FQOnfeqP-xht8PYbhcEgys,10802
|
22
22
|
bec_widgets/cli/generate_cli.py,sha256=tBt-F4Xccg9Pj2zuDEGHd0Ho1fKLfCf3PuSa8KmelQk,4431
|
23
23
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
24
24
|
bec_widgets/cli/rpc_wigdet_handler.py,sha256=OXHoiDFJPzbQ5RO0bzIX5aUXeMMlJTwAiTmB0_7Chj4,913
|
@@ -115,7 +115,7 @@ docs/user/widgets/widgets.md,sha256=vIfilXMyE1iPQMQXGH8wEjXWsFI6GPI0Cn9VQg5lLwI,
|
|
115
115
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
116
|
tests/end-2-end/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
117
117
|
tests/end-2-end/conftest.py,sha256=b5Yebbj8C1-IcXq23XGbOnXF0kOZD_Po46Z-p4cBwfs,1346
|
118
|
-
tests/end-2-end/test_bec_dock_rpc_e2e.py,sha256=
|
118
|
+
tests/end-2-end/test_bec_dock_rpc_e2e.py,sha256=E2XR6cgmyrHknbe-97LhuSAGlsPguc5VOQ2-Q5Apvm0,9843
|
119
119
|
tests/end-2-end/test_bec_figure_rpc_e2e.py,sha256=X8lQLx2NsB6-nU61IhVtAw1-pJ4A2qFgx5PxOWC0V7Q,5527
|
120
120
|
tests/end-2-end/test_rpc_register_e2e.py,sha256=M7sSq3us2yQIW5tAIFOFfBULatZTQNLdt0frh1bINts,1595
|
121
121
|
tests/unit_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -126,7 +126,7 @@ tests/unit_tests/test_bec_dispatcher.py,sha256=rYPiRizHaswhGZw55IBMneDFxmPiCCLAZ
|
|
126
126
|
tests/unit_tests/test_bec_dock.py,sha256=gvtNkkCPrDFY_1qZ53ZXChdgmQFSwwQrr1VeZC5ybKc,3610
|
127
127
|
tests/unit_tests/test_bec_figure.py,sha256=xYAftY8bI_EH-SlNPD0Tjd7FS_47ouZ1E4hrpjPt7O4,8002
|
128
128
|
tests/unit_tests/test_bec_motor_map.py,sha256=AfD_9-x6VV3TPnkQgNfFYRndPHDsGx-a_YknFeDr6hc,4588
|
129
|
-
tests/unit_tests/test_client_utils.py,sha256=
|
129
|
+
tests/unit_tests/test_client_utils.py,sha256=eViJ1Tz-HX9TkMvQH6W8cO-c3_1I8bUc4_Yen6LOc0E,830
|
130
130
|
tests/unit_tests/test_crosshair.py,sha256=3OMAJ2ZaISYXMOtkXf1rPdy94vCr8njeLi6uHblBL9Q,5045
|
131
131
|
tests/unit_tests/test_generate_cli_client.py,sha256=J7CFoO67txGu_u1Mwk32EejRX204FRuvmVg_yhAr1WM,2397
|
132
132
|
tests/unit_tests/test_motor_control.py,sha256=NBekcGALo5mYkuyBJvBhvJkWiQDV82hI4GmsobRzjTI,20770
|
@@ -142,7 +142,7 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
142
142
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
143
143
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
144
144
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
145
|
-
bec_widgets-0.56.
|
146
|
-
bec_widgets-0.56.
|
147
|
-
bec_widgets-0.56.
|
148
|
-
bec_widgets-0.56.
|
145
|
+
bec_widgets-0.56.3.dist-info/METADATA,sha256=V34V-R1GQv2uDyzy9qDYTnNNe2dbkeeDVpFI-Q8GSkU,1135
|
146
|
+
bec_widgets-0.56.3.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
147
|
+
bec_widgets-0.56.3.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
148
|
+
bec_widgets-0.56.3.dist-info/RECORD,,
|
pyproject.toml
CHANGED
@@ -1,11 +1,25 @@
|
|
1
1
|
import numpy as np
|
2
2
|
import pytest
|
3
|
+
from bec_lib.client import BECClient
|
3
4
|
from bec_lib.endpoints import MessageEndpoints
|
4
5
|
|
6
|
+
from bec_widgets.cli.auto_updates import AutoUpdates
|
5
7
|
from bec_widgets.cli.client import BECDockArea, BECFigure, BECImageShow, BECMotorMap, BECWaveform
|
6
8
|
from bec_widgets.utils import Colors
|
7
9
|
|
8
10
|
|
11
|
+
@pytest.fixture(name="bec_client")
|
12
|
+
def cli_bec_client(rpc_server_dock):
|
13
|
+
"""
|
14
|
+
Fixture to create a BECClient instance that is independent of the GUI.
|
15
|
+
"""
|
16
|
+
# pylint: disable=protected-access
|
17
|
+
cli_client = BECClient(forced=True, config=rpc_server_dock.client._service_config)
|
18
|
+
cli_client.start()
|
19
|
+
yield cli_client
|
20
|
+
cli_client.shutdown()
|
21
|
+
|
22
|
+
|
9
23
|
def test_rpc_add_dock_with_figure_e2e(rpc_server_dock, qtbot):
|
10
24
|
dock = BECDockArea(rpc_server_dock.gui_id)
|
11
25
|
dock_server = rpc_server_dock.gui
|
@@ -224,3 +238,57 @@ def test_spiral_bar_scan_update(rpc_server_dock, qtbot):
|
|
224
238
|
np.testing.assert_allclose(bar_server.rings[1].config.min_value, init_samy, atol=0.1)
|
225
239
|
np.testing.assert_allclose(bar_server.rings[0].config.max_value, final_samx, atol=0.1)
|
226
240
|
np.testing.assert_allclose(bar_server.rings[1].config.max_value, final_samy, atol=0.1)
|
241
|
+
|
242
|
+
|
243
|
+
def test_auto_update(rpc_server_dock, bec_client, qtbot):
|
244
|
+
dock = BECDockArea(rpc_server_dock.gui_id)
|
245
|
+
dock._client = bec_client
|
246
|
+
|
247
|
+
AutoUpdates.enabled = True
|
248
|
+
AutoUpdates.create_default_dock = True
|
249
|
+
dock.auto_updates = AutoUpdates(gui=dock)
|
250
|
+
dock.auto_updates.start_default_dock()
|
251
|
+
dock.selected_device = "bpm4i"
|
252
|
+
|
253
|
+
# we need to start the update script manually; normally this is done when the GUI is started
|
254
|
+
dock._start_update_script()
|
255
|
+
|
256
|
+
client = bec_client
|
257
|
+
dev = client.device_manager.devices
|
258
|
+
scans = client.scans
|
259
|
+
queue = client.queue
|
260
|
+
|
261
|
+
status = scans.line_scan(dev.samx, -5, 5, steps=10, exp_time=0.05, relative=False)
|
262
|
+
|
263
|
+
# wait for scan to finish
|
264
|
+
while not status.status == "COMPLETED":
|
265
|
+
qtbot.wait(200)
|
266
|
+
|
267
|
+
last_scan_data = queue.scan_storage.storage[-1].data
|
268
|
+
|
269
|
+
# get data from curves
|
270
|
+
plt = dock.auto_updates.get_default_figure()
|
271
|
+
widgets = plt.widget_list
|
272
|
+
plt_data = widgets[0].get_all_data()
|
273
|
+
|
274
|
+
# check plotted data
|
275
|
+
assert plt_data["bpm4i-bpm4i"]["x"] == last_scan_data["samx"]["samx"].val
|
276
|
+
assert plt_data["bpm4i-bpm4i"]["y"] == last_scan_data["bpm4i"]["bpm4i"].val
|
277
|
+
|
278
|
+
status = scans.grid_scan(
|
279
|
+
dev.samx, -10, 10, 5, dev.samy, -5, 5, 5, exp_time=0.05, relative=False
|
280
|
+
)
|
281
|
+
|
282
|
+
# wait for scan to finish
|
283
|
+
while not status.status == "COMPLETED":
|
284
|
+
qtbot.wait(200)
|
285
|
+
|
286
|
+
plt = dock.auto_updates.get_default_figure()
|
287
|
+
widgets = plt.widget_list
|
288
|
+
plt_data = widgets[0].get_all_data()
|
289
|
+
|
290
|
+
last_scan_data = queue.scan_storage.storage[-1].data
|
291
|
+
|
292
|
+
# check plotted data
|
293
|
+
assert plt_data[f"Scan {status.scan.scan_number}"]["x"] == last_scan_data["samx"]["samx"].val
|
294
|
+
assert plt_data[f"Scan {status.scan.scan_number}"]["y"] == last_scan_data["samy"]["samy"].val
|
@@ -25,5 +25,5 @@ def test_rpc_call_accepts_device_as_input(cli_figure):
|
|
25
25
|
dev1 = FakeDevice("samx")
|
26
26
|
dev2 = FakeDevice("bpm4i")
|
27
27
|
fig, mock_rpc_call = cli_figure
|
28
|
-
fig.plot(dev1, dev2)
|
29
|
-
mock_rpc_call.assert_called_with("plot", "samx", "bpm4i")
|
28
|
+
fig.plot(x_name=dev1, y_name=dev2)
|
29
|
+
mock_rpc_call.assert_called_with("plot", x_name="samx", y_name="bpm4i")
|
File without changes
|
File without changes
|