bec-widgets 0.59.1__py3-none-any.whl → 0.60.0__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 +25 -23
- CHANGELOG.md +43 -43
- PKG-INFO +3 -2
- bec_widgets/cli/__init__.py +1 -1
- bec_widgets/cli/client.py +562 -639
- bec_widgets/cli/generate_cli.py +114 -45
- bec_widgets/utils/bec_connector.py +1 -0
- bec_widgets/widgets/dock/dock.py +5 -7
- bec_widgets/widgets/figure/plots/waveform/waveform.py +0 -1
- {bec_widgets-0.59.1.dist-info → bec_widgets-0.60.0.dist-info}/METADATA +3 -2
- {bec_widgets-0.59.1.dist-info → bec_widgets-0.60.0.dist-info}/RECORD +16 -15
- bec_widgets-0.60.0.dist-info/entry_points.txt +2 -0
- pyproject.toml +8 -3
- tests/unit_tests/test_generate_cli_client.py +37 -5
- {bec_widgets-0.59.1.dist-info → bec_widgets-0.60.0.dist-info}/WHEEL +0 -0
- {bec_widgets-0.59.1.dist-info → bec_widgets-0.60.0.dist-info}/licenses/LICENSE +0 -0
bec_widgets/cli/client.py
CHANGED
@@ -1,11 +1,39 @@
|
|
1
1
|
# This file was automatically generated by generate_cli.py
|
2
2
|
|
3
|
+
import enum
|
3
4
|
from typing import Literal, Optional, overload
|
4
5
|
|
5
6
|
from bec_widgets.cli.client_utils import BECGuiClientMixin, RPCBase, rpc_call
|
6
7
|
|
8
|
+
# pylint: skip-file
|
9
|
+
|
10
|
+
|
11
|
+
class Widgets(str, enum.Enum):
|
12
|
+
"""
|
13
|
+
Enum for the available widgets.
|
14
|
+
"""
|
15
|
+
|
16
|
+
BECDock = "BECDock"
|
17
|
+
BECDockArea = "BECDockArea"
|
18
|
+
BECFigure = "BECFigure"
|
19
|
+
SpiralProgressBar = "SpiralProgressBar"
|
20
|
+
WebsiteWidget = "WebsiteWidget"
|
21
|
+
|
22
|
+
|
23
|
+
class BECCurve(RPCBase):
|
24
|
+
@rpc_call
|
25
|
+
def remove(self):
|
26
|
+
"""
|
27
|
+
Remove the curve from the plot.
|
28
|
+
"""
|
29
|
+
|
30
|
+
@property
|
31
|
+
@rpc_call
|
32
|
+
def rpc_id(self) -> "str":
|
33
|
+
"""
|
34
|
+
Get the RPC ID of the widget.
|
35
|
+
"""
|
7
36
|
|
8
|
-
class BECPlotBase(RPCBase):
|
9
37
|
@property
|
10
38
|
@rpc_call
|
11
39
|
def config_dict(self) -> "dict":
|
@@ -17,132 +45,102 @@ class BECPlotBase(RPCBase):
|
|
17
45
|
"""
|
18
46
|
|
19
47
|
@rpc_call
|
20
|
-
def set(self, **kwargs)
|
48
|
+
def set(self, **kwargs):
|
21
49
|
"""
|
22
|
-
Set the properties of the
|
50
|
+
Set the properties of the curve.
|
23
51
|
|
24
52
|
Args:
|
25
53
|
**kwargs: Keyword arguments for the properties to be set.
|
26
54
|
|
27
55
|
Possible properties:
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
- y_lim: tuple
|
35
|
-
"""
|
36
|
-
|
37
|
-
@rpc_call
|
38
|
-
def set_title(self, title: "str"):
|
39
|
-
"""
|
40
|
-
Set the title of the plot widget.
|
41
|
-
|
42
|
-
Args:
|
43
|
-
title(str): Title of the plot widget.
|
56
|
+
- color: str
|
57
|
+
- symbol: str
|
58
|
+
- symbol_color: str
|
59
|
+
- symbol_size: int
|
60
|
+
- pen_width: int
|
61
|
+
- pen_style: Literal["solid", "dash", "dot", "dashdot"]
|
44
62
|
"""
|
45
63
|
|
46
64
|
@rpc_call
|
47
|
-
def
|
65
|
+
def set_data(self, x, y):
|
48
66
|
"""
|
49
|
-
|
50
|
-
|
51
|
-
Args:
|
52
|
-
label(str): Label of the x-axis.
|
67
|
+
None
|
53
68
|
"""
|
54
69
|
|
55
70
|
@rpc_call
|
56
|
-
def
|
71
|
+
def set_color(self, color: "str", symbol_color: "Optional[str]" = None):
|
57
72
|
"""
|
58
|
-
|
73
|
+
Change the color of the curve.
|
59
74
|
|
60
75
|
Args:
|
61
|
-
|
76
|
+
color(str): Color of the curve.
|
77
|
+
symbol_color(str, optional): Color of the symbol. Defaults to None.
|
62
78
|
"""
|
63
79
|
|
64
80
|
@rpc_call
|
65
|
-
def
|
81
|
+
def set_color_map_z(self, colormap: "str"):
|
66
82
|
"""
|
67
|
-
Set the
|
83
|
+
Set the colormap for the scatter plot z gradient.
|
68
84
|
|
69
85
|
Args:
|
70
|
-
|
86
|
+
colormap(str): Colormap for the scatter plot.
|
71
87
|
"""
|
72
88
|
|
73
89
|
@rpc_call
|
74
|
-
def
|
90
|
+
def set_symbol(self, symbol: "str"):
|
75
91
|
"""
|
76
|
-
|
92
|
+
Change the symbol of the curve.
|
77
93
|
|
78
94
|
Args:
|
79
|
-
|
95
|
+
symbol(str): Symbol of the curve.
|
80
96
|
"""
|
81
97
|
|
82
98
|
@rpc_call
|
83
|
-
def
|
99
|
+
def set_symbol_color(self, symbol_color: "str"):
|
84
100
|
"""
|
85
|
-
|
86
|
-
for the minimum and maximum x-axis values, or a single tuple containing both limits.
|
87
|
-
|
88
|
-
Usage:
|
89
|
-
set_x_lim(x_min, x_max)
|
90
|
-
set_x_lim((x_min, x_max))
|
101
|
+
Change the symbol color of the curve.
|
91
102
|
|
92
103
|
Args:
|
93
|
-
|
94
|
-
or a single tuple with two integers.
|
104
|
+
symbol_color(str): Color of the symbol.
|
95
105
|
"""
|
96
106
|
|
97
107
|
@rpc_call
|
98
|
-
def
|
108
|
+
def set_symbol_size(self, symbol_size: "int"):
|
99
109
|
"""
|
100
|
-
|
101
|
-
for the minimum and maximum y-axis values, or a single tuple containing both limits.
|
102
|
-
|
103
|
-
Usage:
|
104
|
-
set_y_lim(y_min, y_max)
|
105
|
-
set_y_lim((y_min, y_max))
|
110
|
+
Change the symbol size of the curve.
|
106
111
|
|
107
112
|
Args:
|
108
|
-
|
109
|
-
or a single tuple with two integers.
|
113
|
+
symbol_size(int): Size of the symbol.
|
110
114
|
"""
|
111
115
|
|
112
116
|
@rpc_call
|
113
|
-
def
|
117
|
+
def set_pen_width(self, pen_width: "int"):
|
114
118
|
"""
|
115
|
-
|
119
|
+
Change the pen width of the curve.
|
116
120
|
|
117
121
|
Args:
|
118
|
-
|
119
|
-
y(bool): Show grid on the y-axis.
|
122
|
+
pen_width(int): Width of the pen.
|
120
123
|
"""
|
121
124
|
|
122
125
|
@rpc_call
|
123
|
-
def
|
126
|
+
def set_pen_style(self, pen_style: "Literal['solid', 'dash', 'dot', 'dashdot']"):
|
124
127
|
"""
|
125
|
-
|
128
|
+
Change the pen style of the curve.
|
126
129
|
|
127
130
|
Args:
|
128
|
-
|
131
|
+
pen_style(Literal["solid", "dash", "dot", "dashdot"]): Style of the pen.
|
129
132
|
"""
|
130
133
|
|
131
134
|
@rpc_call
|
132
|
-
def
|
135
|
+
def get_data(self) -> "tuple[np.ndarray, np.ndarray]":
|
133
136
|
"""
|
134
|
-
|
137
|
+
Get the data of the curve.
|
138
|
+
Returns:
|
139
|
+
tuple[np.ndarray,np.ndarray]: X and Y data of the curve.
|
135
140
|
"""
|
136
141
|
|
137
142
|
|
138
|
-
class
|
139
|
-
@property
|
140
|
-
@rpc_call
|
141
|
-
def rpc_id(self) -> "str":
|
142
|
-
"""
|
143
|
-
Get the RPC ID of the widget.
|
144
|
-
"""
|
145
|
-
|
143
|
+
class BECDock(RPCBase):
|
146
144
|
@property
|
147
145
|
@rpc_call
|
148
146
|
def config_dict(self) -> "dict":
|
@@ -153,269 +151,247 @@ class BECWaveform(RPCBase):
|
|
153
151
|
dict: The configuration of the widget.
|
154
152
|
"""
|
155
153
|
|
154
|
+
@property
|
156
155
|
@rpc_call
|
157
|
-
def
|
158
|
-
self,
|
159
|
-
x: "list | np.ndarray | None" = None,
|
160
|
-
y: "list | np.ndarray | None" = None,
|
161
|
-
x_name: "str | None" = None,
|
162
|
-
y_name: "str | None" = None,
|
163
|
-
z_name: "str | None" = None,
|
164
|
-
x_entry: "str | None" = None,
|
165
|
-
y_entry: "str | None" = None,
|
166
|
-
z_entry: "str | None" = None,
|
167
|
-
color: "str | None" = None,
|
168
|
-
color_map_z: "str | None" = "plasma",
|
169
|
-
label: "str | None" = None,
|
170
|
-
validate: "bool" = True,
|
171
|
-
) -> "BECCurve":
|
156
|
+
def rpc_id(self) -> "str":
|
172
157
|
"""
|
173
|
-
|
174
|
-
Args:
|
175
|
-
x(list | np.ndarray): Custom x data to plot.
|
176
|
-
y(list | np.ndarray): Custom y data to plot.
|
177
|
-
x_name(str): The name of the device for the x-axis.
|
178
|
-
y_name(str): The name of the device for the y-axis.
|
179
|
-
z_name(str): The name of the device for the z-axis.
|
180
|
-
x_entry(str): The name of the entry for the x-axis.
|
181
|
-
y_entry(str): The name of the entry for the y-axis.
|
182
|
-
z_entry(str): The name of the entry for the z-axis.
|
183
|
-
color(str): The color of the curve.
|
184
|
-
color_map_z(str): The color map to use for the z-axis.
|
185
|
-
label(str): The label of the curve.
|
186
|
-
validate(bool): If True, validate the device names and entries.
|
187
|
-
|
188
|
-
Returns:
|
189
|
-
BECCurve: The curve object.
|
158
|
+
Get the RPC ID of the widget.
|
190
159
|
"""
|
191
160
|
|
161
|
+
@property
|
192
162
|
@rpc_call
|
193
|
-
def
|
163
|
+
def widget_list(self) -> "list[BECConnector]":
|
194
164
|
"""
|
195
|
-
|
165
|
+
Get the widgets in the dock.
|
196
166
|
|
197
|
-
|
198
|
-
|
167
|
+
Returns:
|
168
|
+
widgets(list): The widgets in the dock.
|
199
169
|
"""
|
200
170
|
|
201
171
|
@rpc_call
|
202
|
-
def
|
172
|
+
def show_title_bar(self):
|
203
173
|
"""
|
204
|
-
|
205
|
-
Provide only one of scan_id or scan_index.
|
206
|
-
|
207
|
-
Args:
|
208
|
-
scan_id(str, optional): ScanID of the scan to be updated. Defaults to None.
|
209
|
-
scan_index(int, optional): Index of the scan to be updated. Defaults to None.
|
174
|
+
Hide the title bar of the dock.
|
210
175
|
"""
|
211
176
|
|
212
|
-
@property
|
213
177
|
@rpc_call
|
214
|
-
def
|
178
|
+
def hide_title_bar(self):
|
215
179
|
"""
|
216
|
-
|
217
|
-
Returns:
|
218
|
-
list: List of curves.
|
180
|
+
Hide the title bar of the dock.
|
219
181
|
"""
|
220
182
|
|
221
183
|
@rpc_call
|
222
|
-
def
|
184
|
+
def get_widgets_positions(self) -> "dict":
|
223
185
|
"""
|
224
|
-
Get the
|
225
|
-
|
226
|
-
Args:
|
227
|
-
identifier(int|str): Identifier of the curve. Can be either an integer (index) or a string (curve_id).
|
186
|
+
Get the positions of the widgets in the dock.
|
228
187
|
|
229
188
|
Returns:
|
230
|
-
|
189
|
+
dict: The positions of the widgets in the dock as dict -> {(row, col, rowspan, colspan):widget}
|
231
190
|
"""
|
232
191
|
|
233
192
|
@rpc_call
|
234
|
-
def
|
193
|
+
def set_title(self, title: "str"):
|
235
194
|
"""
|
236
|
-
|
195
|
+
Set the title of the dock.
|
237
196
|
|
238
197
|
Args:
|
239
|
-
|
240
|
-
|
241
|
-
Returns:
|
242
|
-
CurveConfig|dict: Configuration of the curve.
|
198
|
+
title(str): The title of the dock.
|
243
199
|
"""
|
244
200
|
|
245
201
|
@rpc_call
|
246
|
-
def
|
202
|
+
def add_widget(
|
203
|
+
self,
|
204
|
+
widget: "BECConnector | str",
|
205
|
+
row=None,
|
206
|
+
col=0,
|
207
|
+
rowspan=1,
|
208
|
+
colspan=1,
|
209
|
+
shift: "Literal['down', 'up', 'left', 'right']" = "down",
|
210
|
+
) -> "BECConnector":
|
247
211
|
"""
|
248
|
-
|
212
|
+
Add a widget to the dock.
|
249
213
|
|
250
214
|
Args:
|
251
|
-
|
252
|
-
|
215
|
+
widget(QWidget): The widget to add.
|
216
|
+
row(int): The row to add the widget to. If None, the widget will be added to the next available row.
|
217
|
+
col(int): The column to add the widget to.
|
218
|
+
rowspan(int): The number of rows the widget should span.
|
219
|
+
colspan(int): The number of columns the widget should span.
|
220
|
+
shift(Literal["down", "up", "left", "right"]): The direction to shift the widgets if the position is occupied.
|
253
221
|
"""
|
254
222
|
|
255
223
|
@rpc_call
|
256
|
-
def
|
224
|
+
def list_eligible_widgets(self) -> "list":
|
257
225
|
"""
|
258
|
-
|
259
|
-
|
260
|
-
Args:
|
261
|
-
output (Literal["dict", "pandas"]): Format of the output data.
|
226
|
+
List all widgets that can be added to the dock.
|
262
227
|
|
263
228
|
Returns:
|
264
|
-
|
229
|
+
list: The list of eligible widgets.
|
265
230
|
"""
|
266
231
|
|
267
232
|
@rpc_call
|
268
|
-
def
|
233
|
+
def move_widget(self, widget: "QWidget", new_row: "int", new_col: "int"):
|
269
234
|
"""
|
270
|
-
|
235
|
+
Move a widget to a new position in the layout.
|
271
236
|
|
272
237
|
Args:
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
- title: str
|
277
|
-
- x_label: str
|
278
|
-
- y_label: str
|
279
|
-
- x_scale: Literal["linear", "log"]
|
280
|
-
- y_scale: Literal["linear", "log"]
|
281
|
-
- x_lim: tuple
|
282
|
-
- y_lim: tuple
|
238
|
+
widget(QWidget): The widget to move.
|
239
|
+
new_row(int): The new row to move the widget to.
|
240
|
+
new_col(int): The new column to move the widget to.
|
283
241
|
"""
|
284
242
|
|
285
243
|
@rpc_call
|
286
|
-
def
|
244
|
+
def remove_widget(self, widget_rpc_id: "str"):
|
287
245
|
"""
|
288
|
-
|
246
|
+
Remove a widget from the dock.
|
289
247
|
|
290
248
|
Args:
|
291
|
-
|
249
|
+
widget_rpc_id(str): The ID of the widget to remove.
|
292
250
|
"""
|
293
251
|
|
294
252
|
@rpc_call
|
295
|
-
def
|
253
|
+
def remove(self):
|
296
254
|
"""
|
297
|
-
|
298
|
-
|
299
|
-
Args:
|
300
|
-
label(str): Label of the x-axis.
|
255
|
+
Remove the dock from the parent dock area.
|
301
256
|
"""
|
302
257
|
|
303
258
|
@rpc_call
|
304
|
-
def
|
259
|
+
def attach(self):
|
305
260
|
"""
|
306
|
-
|
307
|
-
|
308
|
-
Args:
|
309
|
-
label(str): Label of the y-axis.
|
261
|
+
Attach the dock to the parent dock area.
|
310
262
|
"""
|
311
263
|
|
312
264
|
@rpc_call
|
313
|
-
def
|
265
|
+
def detach(self):
|
314
266
|
"""
|
315
|
-
|
316
|
-
|
317
|
-
Args:
|
318
|
-
scale(Literal["linear", "log"]): Scale of the x-axis.
|
267
|
+
Detach the dock from the parent dock area.
|
319
268
|
"""
|
320
269
|
|
270
|
+
|
271
|
+
class BECDockArea(RPCBase, BECGuiClientMixin):
|
272
|
+
@property
|
321
273
|
@rpc_call
|
322
|
-
def
|
274
|
+
def config_dict(self) -> "dict":
|
323
275
|
"""
|
324
|
-
|
276
|
+
Get the configuration of the widget.
|
325
277
|
|
326
|
-
|
327
|
-
|
278
|
+
Returns:
|
279
|
+
dict: The configuration of the widget.
|
328
280
|
"""
|
329
281
|
|
282
|
+
@property
|
330
283
|
@rpc_call
|
331
|
-
def
|
284
|
+
def panels(self) -> "dict[str, BECDock]":
|
285
|
+
"""
|
286
|
+
Get the docks in the dock area.
|
287
|
+
Returns:
|
288
|
+
dock_dict(dict): The docks in the dock area.
|
332
289
|
"""
|
333
|
-
Set the limits of the x-axis. This method can accept either two separate arguments
|
334
|
-
for the minimum and maximum x-axis values, or a single tuple containing both limits.
|
335
290
|
|
336
|
-
|
337
|
-
|
338
|
-
|
291
|
+
@rpc_call
|
292
|
+
def save_state(self) -> "dict":
|
293
|
+
"""
|
294
|
+
Save the state of the dock area.
|
339
295
|
|
340
|
-
|
341
|
-
|
342
|
-
or a single tuple with two integers.
|
296
|
+
Returns:
|
297
|
+
dict: The state of the dock area.
|
343
298
|
"""
|
344
299
|
|
345
300
|
@rpc_call
|
346
|
-
def
|
301
|
+
def remove_dock(self, name: "str"):
|
347
302
|
"""
|
348
|
-
|
349
|
-
for the minimum and maximum y-axis values, or a single tuple containing both limits.
|
350
|
-
|
351
|
-
Usage:
|
352
|
-
set_y_lim(y_min, y_max)
|
353
|
-
set_y_lim((y_min, y_max))
|
303
|
+
Remove a dock by name and ensure it is properly closed and cleaned up.
|
354
304
|
|
355
305
|
Args:
|
356
|
-
|
357
|
-
or a single tuple with two integers.
|
306
|
+
name(str): The name of the dock to remove.
|
358
307
|
"""
|
359
308
|
|
360
309
|
@rpc_call
|
361
|
-
def
|
310
|
+
def restore_state(
|
311
|
+
self, state: "dict" = None, missing: "Literal['ignore', 'error']" = "ignore", extra="bottom"
|
312
|
+
):
|
362
313
|
"""
|
363
|
-
|
314
|
+
Restore the state of the dock area. If no state is provided, the last state is restored.
|
364
315
|
|
365
316
|
Args:
|
366
|
-
|
367
|
-
|
317
|
+
state(dict): The state to restore.
|
318
|
+
missing(Literal['ignore','error']): What to do if a dock is missing.
|
319
|
+
extra(str): Extra docks that are in the dockarea but that are not mentioned in state will be added to the bottom of the dockarea, unless otherwise specified by the extra argument.
|
368
320
|
"""
|
369
321
|
|
370
322
|
@rpc_call
|
371
|
-
def
|
323
|
+
def add_dock(
|
324
|
+
self,
|
325
|
+
name: "str" = None,
|
326
|
+
position: "Literal['bottom', 'top', 'left', 'right', 'above', 'below']" = None,
|
327
|
+
relative_to: "BECDock | None" = None,
|
328
|
+
closable: "bool" = False,
|
329
|
+
floating: "bool" = False,
|
330
|
+
prefix: "str" = "dock",
|
331
|
+
widget: "str | QWidget | None" = None,
|
332
|
+
row: "int" = None,
|
333
|
+
col: "int" = 0,
|
334
|
+
rowspan: "int" = 1,
|
335
|
+
colspan: "int" = 1,
|
336
|
+
) -> "BECDock":
|
372
337
|
"""
|
373
|
-
|
338
|
+
Add a dock to the dock area. Dock has QGridLayout as layout manager by default.
|
374
339
|
|
375
340
|
Args:
|
376
|
-
|
341
|
+
name(str): The name of the dock to be displayed and for further references. Has to be unique.
|
342
|
+
position(Literal["bottom", "top", "left", "right", "above", "below"]): The position of the dock.
|
343
|
+
relative_to(BECDock): The dock to which the new dock should be added relative to.
|
344
|
+
closable(bool): Whether the dock is closable.
|
345
|
+
floating(bool): Whether the dock is detached after creating.
|
346
|
+
prefix(str): The prefix for the dock name if no name is provided.
|
347
|
+
widget(str|QWidget|None): The widget to be added to the dock. While using RPC, only BEC RPC widgets from RPCWidgetHandler are allowed.
|
348
|
+
row(int): The row of the added widget.
|
349
|
+
col(int): The column of the added widget.
|
350
|
+
rowspan(int): The rowspan of the added widget.
|
351
|
+
colspan(int): The colspan of the added widget.
|
352
|
+
|
353
|
+
Returns:
|
354
|
+
BECDock: The created dock.
|
377
355
|
"""
|
378
356
|
|
379
357
|
@rpc_call
|
380
|
-
def
|
381
|
-
self,
|
382
|
-
x: "list | np.ndarray | None" = None,
|
383
|
-
y: "list | np.ndarray | None" = None,
|
384
|
-
x_name: "str | None" = None,
|
385
|
-
y_name: "str | None" = None,
|
386
|
-
z_name: "str | None" = None,
|
387
|
-
x_entry: "str | None" = None,
|
388
|
-
y_entry: "str | None" = None,
|
389
|
-
z_entry: "str | None" = None,
|
390
|
-
color: "str | None" = None,
|
391
|
-
color_map_z: "str | None" = "plasma",
|
392
|
-
label: "str | None" = None,
|
393
|
-
validate: "bool" = True,
|
394
|
-
) -> "BECCurve":
|
358
|
+
def clear_all(self):
|
395
359
|
"""
|
396
|
-
|
360
|
+
Close all docks and remove all temp areas.
|
361
|
+
"""
|
362
|
+
|
363
|
+
@rpc_call
|
364
|
+
def detach_dock(self, dock_name: "str") -> "BECDock":
|
365
|
+
"""
|
366
|
+
Undock a dock from the dock area.
|
367
|
+
|
397
368
|
Args:
|
398
|
-
|
399
|
-
y(list | np.ndarray): Custom y data to plot.
|
400
|
-
x_name(str): The name of the device for the x-axis.
|
401
|
-
y_name(str): The name of the device for the y-axis.
|
402
|
-
z_name(str): The name of the device for the z-axis.
|
403
|
-
x_entry(str): The name of the entry for the x-axis.
|
404
|
-
y_entry(str): The name of the entry for the y-axis.
|
405
|
-
z_entry(str): The name of the entry for the z-axis.
|
406
|
-
color(str): The color of the curve.
|
407
|
-
color_map_z(str): The color map to use for the z-axis.
|
408
|
-
label(str): The label of the curve.
|
409
|
-
validate(bool): If True, validate the device names and entries.
|
369
|
+
dock_name(str): The dock to undock.
|
410
370
|
|
411
371
|
Returns:
|
412
|
-
|
372
|
+
BECDock: The undocked dock.
|
413
373
|
"""
|
414
374
|
|
415
375
|
@rpc_call
|
416
|
-
def
|
376
|
+
def attach_all(self):
|
417
377
|
"""
|
418
|
-
|
378
|
+
Return all floating docks to the dock area.
|
379
|
+
"""
|
380
|
+
|
381
|
+
@rpc_call
|
382
|
+
def get_all_rpc(self) -> "dict":
|
383
|
+
"""
|
384
|
+
Get all registered RPC objects.
|
385
|
+
"""
|
386
|
+
|
387
|
+
@property
|
388
|
+
@rpc_call
|
389
|
+
def temp_areas(self) -> "list":
|
390
|
+
"""
|
391
|
+
Get the temporary areas in the dock area.
|
392
|
+
|
393
|
+
Returns:
|
394
|
+
list: The temporary areas in the dock area.
|
419
395
|
"""
|
420
396
|
|
421
397
|
|
@@ -695,13 +671,7 @@ class BECFigure(RPCBase):
|
|
695
671
|
"""
|
696
672
|
|
697
673
|
|
698
|
-
class
|
699
|
-
@rpc_call
|
700
|
-
def remove(self):
|
701
|
-
"""
|
702
|
-
Remove the curve from the plot.
|
703
|
-
"""
|
704
|
-
|
674
|
+
class BECImageItem(RPCBase):
|
705
675
|
@property
|
706
676
|
@rpc_call
|
707
677
|
def rpc_id(self) -> "str":
|
@@ -722,103 +692,129 @@ class BECCurve(RPCBase):
|
|
722
692
|
@rpc_call
|
723
693
|
def set(self, **kwargs):
|
724
694
|
"""
|
725
|
-
Set the properties of the
|
695
|
+
Set the properties of the image.
|
726
696
|
|
727
697
|
Args:
|
728
698
|
**kwargs: Keyword arguments for the properties to be set.
|
729
699
|
|
730
700
|
Possible properties:
|
731
|
-
-
|
732
|
-
-
|
733
|
-
-
|
734
|
-
-
|
735
|
-
-
|
736
|
-
-
|
701
|
+
- downsample
|
702
|
+
- color_map
|
703
|
+
- monitor
|
704
|
+
- opacity
|
705
|
+
- vrange
|
706
|
+
- fft
|
707
|
+
- log
|
708
|
+
- rot
|
709
|
+
- transpose
|
737
710
|
"""
|
738
711
|
|
739
712
|
@rpc_call
|
740
|
-
def
|
713
|
+
def set_fft(self, enable: "bool" = False):
|
741
714
|
"""
|
742
|
-
|
715
|
+
Set the FFT of the image.
|
716
|
+
|
717
|
+
Args:
|
718
|
+
enable(bool): Whether to perform FFT on the monitor data.
|
743
719
|
"""
|
744
720
|
|
745
721
|
@rpc_call
|
746
|
-
def
|
722
|
+
def set_log(self, enable: "bool" = False):
|
747
723
|
"""
|
748
|
-
|
724
|
+
Set the log of the image.
|
749
725
|
|
750
726
|
Args:
|
751
|
-
|
752
|
-
symbol_color(str, optional): Color of the symbol. Defaults to None.
|
727
|
+
enable(bool): Whether to perform log on the monitor data.
|
753
728
|
"""
|
754
729
|
|
755
730
|
@rpc_call
|
756
|
-
def
|
731
|
+
def set_rotation(self, deg_90: "int" = 0):
|
757
732
|
"""
|
758
|
-
Set the
|
733
|
+
Set the rotation of the image.
|
759
734
|
|
760
735
|
Args:
|
761
|
-
|
736
|
+
deg_90(int): The rotation angle of the monitor data before displaying.
|
762
737
|
"""
|
763
738
|
|
764
739
|
@rpc_call
|
765
|
-
def
|
740
|
+
def set_transpose(self, enable: "bool" = False):
|
766
741
|
"""
|
767
|
-
|
742
|
+
Set the transpose of the image.
|
768
743
|
|
769
744
|
Args:
|
770
|
-
|
745
|
+
enable(bool): Whether to transpose the image.
|
771
746
|
"""
|
772
747
|
|
773
748
|
@rpc_call
|
774
|
-
def
|
749
|
+
def set_opacity(self, opacity: "float" = 1.0):
|
775
750
|
"""
|
776
|
-
|
751
|
+
Set the opacity of the image.
|
777
752
|
|
778
753
|
Args:
|
779
|
-
|
754
|
+
opacity(float): The opacity of the image.
|
780
755
|
"""
|
781
756
|
|
782
757
|
@rpc_call
|
783
|
-
def
|
758
|
+
def set_autorange(self, autorange: "bool" = False):
|
784
759
|
"""
|
785
|
-
|
760
|
+
Set the autorange of the color bar.
|
786
761
|
|
787
762
|
Args:
|
788
|
-
|
763
|
+
autorange(bool): Whether to autorange the color bar.
|
789
764
|
"""
|
790
765
|
|
791
766
|
@rpc_call
|
792
|
-
def
|
767
|
+
def set_color_map(self, cmap: "str" = "magma"):
|
793
768
|
"""
|
794
|
-
|
769
|
+
Set the color map of the image.
|
795
770
|
|
796
771
|
Args:
|
797
|
-
|
772
|
+
cmap(str): The color map of the image.
|
798
773
|
"""
|
799
774
|
|
800
775
|
@rpc_call
|
801
|
-
def
|
776
|
+
def set_auto_downsample(self, auto: "bool" = True):
|
802
777
|
"""
|
803
|
-
|
778
|
+
Set the auto downsample of the image.
|
804
779
|
|
805
780
|
Args:
|
806
|
-
|
781
|
+
auto(bool): Whether to downsample the image.
|
807
782
|
"""
|
808
783
|
|
809
784
|
@rpc_call
|
810
|
-
def
|
811
|
-
"""
|
812
|
-
Get the data of the curve.
|
813
|
-
Returns:
|
814
|
-
tuple[np.ndarray,np.ndarray]: X and Y data of the curve.
|
785
|
+
def set_monitor(self, monitor: "str"):
|
815
786
|
"""
|
787
|
+
Set the monitor of the image.
|
816
788
|
|
789
|
+
Args:
|
790
|
+
monitor(str): The name of the monitor.
|
791
|
+
"""
|
817
792
|
|
818
|
-
class BECImageShow(RPCBase):
|
819
|
-
@property
|
820
793
|
@rpc_call
|
821
|
-
def
|
794
|
+
def set_vrange(
|
795
|
+
self, vmin: "float" = None, vmax: "float" = None, vrange: "tuple[int, int]" = None
|
796
|
+
):
|
797
|
+
"""
|
798
|
+
Set the range of the color bar.
|
799
|
+
|
800
|
+
Args:
|
801
|
+
vmin(float): Minimum value of the color bar.
|
802
|
+
vmax(float): Maximum value of the color bar.
|
803
|
+
"""
|
804
|
+
|
805
|
+
@rpc_call
|
806
|
+
def get_data(self) -> "np.ndarray":
|
807
|
+
"""
|
808
|
+
Get the data of the image.
|
809
|
+
Returns:
|
810
|
+
np.ndarray: The data of the image.
|
811
|
+
"""
|
812
|
+
|
813
|
+
|
814
|
+
class BECImageShow(RPCBase):
|
815
|
+
@property
|
816
|
+
@rpc_call
|
817
|
+
def rpc_id(self) -> "str":
|
822
818
|
"""
|
823
819
|
Get the RPC ID of the widget.
|
824
820
|
"""
|
@@ -1159,7 +1155,7 @@ class BECImageShow(RPCBase):
|
|
1159
1155
|
"""
|
1160
1156
|
|
1161
1157
|
|
1162
|
-
class
|
1158
|
+
class BECMotorMap(RPCBase):
|
1163
1159
|
@property
|
1164
1160
|
@rpc_call
|
1165
1161
|
def config_dict(self) -> "dict":
|
@@ -1171,20 +1167,80 @@ class BECConnector(RPCBase):
|
|
1171
1167
|
"""
|
1172
1168
|
|
1173
1169
|
@rpc_call
|
1174
|
-
def
|
1170
|
+
def change_motors(
|
1171
|
+
self,
|
1172
|
+
motor_x: "str",
|
1173
|
+
motor_y: "str",
|
1174
|
+
motor_x_entry: "str" = None,
|
1175
|
+
motor_y_entry: "str" = None,
|
1176
|
+
validate_bec: "bool" = True,
|
1177
|
+
) -> "None":
|
1175
1178
|
"""
|
1176
|
-
|
1179
|
+
Change the active motors for the plot.
|
1180
|
+
|
1181
|
+
Args:
|
1182
|
+
motor_x(str): Motor name for the X axis.
|
1183
|
+
motor_y(str): Motor name for the Y axis.
|
1184
|
+
motor_x_entry(str): Motor entry for the X axis.
|
1185
|
+
motor_y_entry(str): Motor entry for the Y axis.
|
1186
|
+
validate_bec(bool, optional): If True, validate the signal with BEC. Defaults to True.
|
1177
1187
|
"""
|
1178
1188
|
|
1189
|
+
@rpc_call
|
1190
|
+
def set_max_points(self, max_points: "int") -> "None":
|
1191
|
+
"""
|
1192
|
+
Set the maximum number of points to display.
|
1193
|
+
|
1194
|
+
Args:
|
1195
|
+
max_points(int): Maximum number of points to display.
|
1196
|
+
"""
|
1179
1197
|
|
1180
|
-
class BECImageItem(RPCBase):
|
1181
|
-
@property
|
1182
1198
|
@rpc_call
|
1183
|
-
def
|
1199
|
+
def set_precision(self, precision: "int") -> "None":
|
1184
1200
|
"""
|
1185
|
-
|
1201
|
+
Set the decimal precision of the motor position.
|
1202
|
+
|
1203
|
+
Args:
|
1204
|
+
precision(int): Decimal precision of the motor position.
|
1205
|
+
"""
|
1206
|
+
|
1207
|
+
@rpc_call
|
1208
|
+
def set_num_dim_points(self, num_dim_points: "int") -> "None":
|
1186
1209
|
"""
|
1210
|
+
Set the number of dim points for the motor map.
|
1211
|
+
|
1212
|
+
Args:
|
1213
|
+
num_dim_points(int): Number of dim points.
|
1214
|
+
"""
|
1215
|
+
|
1216
|
+
@rpc_call
|
1217
|
+
def set_background_value(self, background_value: "int") -> "None":
|
1218
|
+
"""
|
1219
|
+
Set the background value of the motor map.
|
1220
|
+
|
1221
|
+
Args:
|
1222
|
+
background_value(int): Background value of the motor map.
|
1223
|
+
"""
|
1224
|
+
|
1225
|
+
@rpc_call
|
1226
|
+
def set_scatter_size(self, scatter_size: "int") -> "None":
|
1227
|
+
"""
|
1228
|
+
Set the scatter size of the motor map plot.
|
1187
1229
|
|
1230
|
+
Args:
|
1231
|
+
scatter_size(int): Size of the scatter points.
|
1232
|
+
"""
|
1233
|
+
|
1234
|
+
@rpc_call
|
1235
|
+
def get_data(self) -> "dict":
|
1236
|
+
"""
|
1237
|
+
Get the data of the motor map.
|
1238
|
+
Returns:
|
1239
|
+
dict: Data of the motor map.
|
1240
|
+
"""
|
1241
|
+
|
1242
|
+
|
1243
|
+
class BECPlotBase(RPCBase):
|
1188
1244
|
@property
|
1189
1245
|
@rpc_call
|
1190
1246
|
def config_dict(self) -> "dict":
|
@@ -1196,128 +1252,132 @@ class BECImageItem(RPCBase):
|
|
1196
1252
|
"""
|
1197
1253
|
|
1198
1254
|
@rpc_call
|
1199
|
-
def set(self, **kwargs):
|
1255
|
+
def set(self, **kwargs) -> "None":
|
1200
1256
|
"""
|
1201
|
-
Set the properties of the
|
1257
|
+
Set the properties of the plot widget.
|
1202
1258
|
|
1203
1259
|
Args:
|
1204
1260
|
**kwargs: Keyword arguments for the properties to be set.
|
1205
1261
|
|
1206
1262
|
Possible properties:
|
1207
|
-
-
|
1208
|
-
-
|
1209
|
-
-
|
1210
|
-
-
|
1211
|
-
-
|
1212
|
-
-
|
1213
|
-
-
|
1214
|
-
- rot
|
1215
|
-
- transpose
|
1263
|
+
- title: str
|
1264
|
+
- x_label: str
|
1265
|
+
- y_label: str
|
1266
|
+
- x_scale: Literal["linear", "log"]
|
1267
|
+
- y_scale: Literal["linear", "log"]
|
1268
|
+
- x_lim: tuple
|
1269
|
+
- y_lim: tuple
|
1216
1270
|
"""
|
1217
1271
|
|
1218
1272
|
@rpc_call
|
1219
|
-
def
|
1273
|
+
def set_title(self, title: "str"):
|
1220
1274
|
"""
|
1221
|
-
Set the
|
1275
|
+
Set the title of the plot widget.
|
1222
1276
|
|
1223
1277
|
Args:
|
1224
|
-
|
1278
|
+
title(str): Title of the plot widget.
|
1225
1279
|
"""
|
1226
1280
|
|
1227
1281
|
@rpc_call
|
1228
|
-
def
|
1282
|
+
def set_x_label(self, label: "str"):
|
1229
1283
|
"""
|
1230
|
-
Set the
|
1284
|
+
Set the label of the x-axis.
|
1231
1285
|
|
1232
1286
|
Args:
|
1233
|
-
|
1287
|
+
label(str): Label of the x-axis.
|
1234
1288
|
"""
|
1235
1289
|
|
1236
1290
|
@rpc_call
|
1237
|
-
def
|
1291
|
+
def set_y_label(self, label: "str"):
|
1238
1292
|
"""
|
1239
|
-
Set the
|
1293
|
+
Set the label of the y-axis.
|
1240
1294
|
|
1241
1295
|
Args:
|
1242
|
-
|
1296
|
+
label(str): Label of the y-axis.
|
1243
1297
|
"""
|
1244
1298
|
|
1245
1299
|
@rpc_call
|
1246
|
-
def
|
1300
|
+
def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
1247
1301
|
"""
|
1248
|
-
Set the
|
1302
|
+
Set the scale of the x-axis.
|
1249
1303
|
|
1250
1304
|
Args:
|
1251
|
-
|
1305
|
+
scale(Literal["linear", "log"]): Scale of the x-axis.
|
1252
1306
|
"""
|
1253
1307
|
|
1254
1308
|
@rpc_call
|
1255
|
-
def
|
1309
|
+
def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
1256
1310
|
"""
|
1257
|
-
Set the
|
1311
|
+
Set the scale of the y-axis.
|
1258
1312
|
|
1259
1313
|
Args:
|
1260
|
-
|
1314
|
+
scale(Literal["linear", "log"]): Scale of the y-axis.
|
1261
1315
|
"""
|
1262
1316
|
|
1263
1317
|
@rpc_call
|
1264
|
-
def
|
1318
|
+
def set_x_lim(self, *args) -> "None":
|
1265
1319
|
"""
|
1266
|
-
Set the
|
1320
|
+
Set the limits of the x-axis. This method can accept either two separate arguments
|
1321
|
+
for the minimum and maximum x-axis values, or a single tuple containing both limits.
|
1322
|
+
|
1323
|
+
Usage:
|
1324
|
+
set_x_lim(x_min, x_max)
|
1325
|
+
set_x_lim((x_min, x_max))
|
1267
1326
|
|
1268
1327
|
Args:
|
1269
|
-
|
1328
|
+
*args: A variable number of arguments. Can be two integers (x_min and x_max)
|
1329
|
+
or a single tuple with two integers.
|
1270
1330
|
"""
|
1271
1331
|
|
1272
1332
|
@rpc_call
|
1273
|
-
def
|
1333
|
+
def set_y_lim(self, *args) -> "None":
|
1274
1334
|
"""
|
1275
|
-
Set the
|
1335
|
+
Set the limits of the y-axis. This method can accept either two separate arguments
|
1336
|
+
for the minimum and maximum y-axis values, or a single tuple containing both limits.
|
1337
|
+
|
1338
|
+
Usage:
|
1339
|
+
set_y_lim(y_min, y_max)
|
1340
|
+
set_y_lim((y_min, y_max))
|
1276
1341
|
|
1277
1342
|
Args:
|
1278
|
-
|
1343
|
+
*args: A variable number of arguments. Can be two integers (y_min and y_max)
|
1344
|
+
or a single tuple with two integers.
|
1279
1345
|
"""
|
1280
1346
|
|
1281
1347
|
@rpc_call
|
1282
|
-
def
|
1348
|
+
def set_grid(self, x: "bool" = False, y: "bool" = False):
|
1283
1349
|
"""
|
1284
|
-
Set the
|
1350
|
+
Set the grid of the plot widget.
|
1285
1351
|
|
1286
1352
|
Args:
|
1287
|
-
|
1353
|
+
x(bool): Show grid on the x-axis.
|
1354
|
+
y(bool): Show grid on the y-axis.
|
1288
1355
|
"""
|
1289
1356
|
|
1290
1357
|
@rpc_call
|
1291
|
-
def
|
1358
|
+
def lock_aspect_ratio(self, lock):
|
1292
1359
|
"""
|
1293
|
-
|
1360
|
+
Lock aspect ratio.
|
1294
1361
|
|
1295
1362
|
Args:
|
1296
|
-
|
1363
|
+
lock(bool): True to lock, False to unlock.
|
1297
1364
|
"""
|
1298
1365
|
|
1299
1366
|
@rpc_call
|
1300
|
-
def
|
1301
|
-
self, vmin: "float" = None, vmax: "float" = None, vrange: "tuple[int, int]" = None
|
1302
|
-
):
|
1367
|
+
def remove(self):
|
1303
1368
|
"""
|
1304
|
-
|
1305
|
-
|
1306
|
-
Args:
|
1307
|
-
vmin(float): Minimum value of the color bar.
|
1308
|
-
vmax(float): Maximum value of the color bar.
|
1369
|
+
Remove the plot widget from the figure.
|
1309
1370
|
"""
|
1310
1371
|
|
1372
|
+
|
1373
|
+
class BECWaveform(RPCBase):
|
1374
|
+
@property
|
1311
1375
|
@rpc_call
|
1312
|
-
def
|
1376
|
+
def rpc_id(self) -> "str":
|
1313
1377
|
"""
|
1314
|
-
Get the
|
1315
|
-
Returns:
|
1316
|
-
np.ndarray: The data of the image.
|
1378
|
+
Get the RPC ID of the widget.
|
1317
1379
|
"""
|
1318
1380
|
|
1319
|
-
|
1320
|
-
class BECMotorMap(RPCBase):
|
1321
1381
|
@property
|
1322
1382
|
@rpc_call
|
1323
1383
|
def config_dict(self) -> "dict":
|
@@ -1329,208 +1389,249 @@ class BECMotorMap(RPCBase):
|
|
1329
1389
|
"""
|
1330
1390
|
|
1331
1391
|
@rpc_call
|
1332
|
-
def
|
1392
|
+
def plot(
|
1333
1393
|
self,
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1394
|
+
x: "list | np.ndarray | None" = None,
|
1395
|
+
y: "list | np.ndarray | None" = None,
|
1396
|
+
x_name: "str | None" = None,
|
1397
|
+
y_name: "str | None" = None,
|
1398
|
+
z_name: "str | None" = None,
|
1399
|
+
x_entry: "str | None" = None,
|
1400
|
+
y_entry: "str | None" = None,
|
1401
|
+
z_entry: "str | None" = None,
|
1402
|
+
color: "str | None" = None,
|
1403
|
+
color_map_z: "str | None" = "plasma",
|
1404
|
+
label: "str | None" = None,
|
1405
|
+
validate: "bool" = True,
|
1406
|
+
) -> "BECCurve":
|
1340
1407
|
"""
|
1341
|
-
|
1342
|
-
|
1408
|
+
Plot a curve to the plot widget.
|
1343
1409
|
Args:
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1410
|
+
x(list | np.ndarray): Custom x data to plot.
|
1411
|
+
y(list | np.ndarray): Custom y data to plot.
|
1412
|
+
x_name(str): The name of the device for the x-axis.
|
1413
|
+
y_name(str): The name of the device for the y-axis.
|
1414
|
+
z_name(str): The name of the device for the z-axis.
|
1415
|
+
x_entry(str): The name of the entry for the x-axis.
|
1416
|
+
y_entry(str): The name of the entry for the y-axis.
|
1417
|
+
z_entry(str): The name of the entry for the z-axis.
|
1418
|
+
color(str): The color of the curve.
|
1419
|
+
color_map_z(str): The color map to use for the z-axis.
|
1420
|
+
label(str): The label of the curve.
|
1421
|
+
validate(bool): If True, validate the device names and entries.
|
1422
|
+
|
1423
|
+
Returns:
|
1424
|
+
BECCurve: The curve object.
|
1349
1425
|
"""
|
1350
1426
|
|
1351
1427
|
@rpc_call
|
1352
|
-
def
|
1428
|
+
def remove_curve(self, *identifiers):
|
1353
1429
|
"""
|
1354
|
-
|
1430
|
+
Remove a curve from the plot widget.
|
1355
1431
|
|
1356
1432
|
Args:
|
1357
|
-
|
1433
|
+
*identifiers: Identifier of the curve to be removed. Can be either an integer (index) or a string (curve_id).
|
1358
1434
|
"""
|
1359
1435
|
|
1360
1436
|
@rpc_call
|
1361
|
-
def
|
1437
|
+
def scan_history(self, scan_index: "int" = None, scan_id: "str" = None):
|
1362
1438
|
"""
|
1363
|
-
|
1439
|
+
Update the scan curves with the data from the scan storage.
|
1440
|
+
Provide only one of scan_id or scan_index.
|
1364
1441
|
|
1365
1442
|
Args:
|
1366
|
-
|
1443
|
+
scan_id(str, optional): ScanID of the scan to be updated. Defaults to None.
|
1444
|
+
scan_index(int, optional): Index of the scan to be updated. Defaults to None.
|
1367
1445
|
"""
|
1368
1446
|
|
1447
|
+
@property
|
1369
1448
|
@rpc_call
|
1370
|
-
def
|
1449
|
+
def curves(self) -> "list[BECCurve]":
|
1371
1450
|
"""
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
num_dim_points(int): Number of dim points.
|
1451
|
+
Get the curves of the plot widget as a list
|
1452
|
+
Returns:
|
1453
|
+
list: List of curves.
|
1376
1454
|
"""
|
1377
1455
|
|
1378
1456
|
@rpc_call
|
1379
|
-
def
|
1457
|
+
def get_curve(self, identifier) -> "BECCurve":
|
1380
1458
|
"""
|
1381
|
-
|
1459
|
+
Get the curve by its index or ID.
|
1382
1460
|
|
1383
1461
|
Args:
|
1384
|
-
|
1462
|
+
identifier(int|str): Identifier of the curve. Can be either an integer (index) or a string (curve_id).
|
1463
|
+
|
1464
|
+
Returns:
|
1465
|
+
BECCurve: The curve object.
|
1385
1466
|
"""
|
1386
1467
|
|
1387
1468
|
@rpc_call
|
1388
|
-
def
|
1469
|
+
def get_curve_config(self, curve_id: "str", dict_output: "bool" = True) -> "CurveConfig | dict":
|
1389
1470
|
"""
|
1390
|
-
|
1471
|
+
Get the configuration of a curve by its ID.
|
1391
1472
|
|
1392
1473
|
Args:
|
1393
|
-
|
1474
|
+
curve_id(str): ID of the curve.
|
1475
|
+
|
1476
|
+
Returns:
|
1477
|
+
CurveConfig|dict: Configuration of the curve.
|
1394
1478
|
"""
|
1395
1479
|
|
1396
1480
|
@rpc_call
|
1397
|
-
def
|
1398
|
-
"""
|
1399
|
-
Get the data of the motor map.
|
1400
|
-
Returns:
|
1401
|
-
dict: Data of the motor map.
|
1481
|
+
def apply_config(self, config: "dict | SubplotConfig", replot_last_scan: "bool" = False):
|
1402
1482
|
"""
|
1483
|
+
Apply the configuration to the 1D waveform widget.
|
1403
1484
|
|
1485
|
+
Args:
|
1486
|
+
config(dict|SubplotConfig): Configuration settings.
|
1487
|
+
replot_last_scan(bool, optional): If True, replot the last scan. Defaults to False.
|
1488
|
+
"""
|
1404
1489
|
|
1405
|
-
class BECDock(RPCBase):
|
1406
|
-
@property
|
1407
1490
|
@rpc_call
|
1408
|
-
def
|
1491
|
+
def get_all_data(self, output: "Literal['dict', 'pandas']" = "dict") -> "dict | pd.DataFrame":
|
1409
1492
|
"""
|
1410
|
-
|
1493
|
+
Extract all curve data into a dictionary or a pandas DataFrame.
|
1494
|
+
|
1495
|
+
Args:
|
1496
|
+
output (Literal["dict", "pandas"]): Format of the output data.
|
1411
1497
|
|
1412
1498
|
Returns:
|
1413
|
-
dict:
|
1499
|
+
dict | pd.DataFrame: Data of all curves in the specified format.
|
1414
1500
|
"""
|
1415
1501
|
|
1416
|
-
@property
|
1417
1502
|
@rpc_call
|
1418
|
-
def
|
1503
|
+
def set(self, **kwargs) -> "None":
|
1419
1504
|
"""
|
1420
|
-
|
1505
|
+
Set the properties of the plot widget.
|
1506
|
+
|
1507
|
+
Args:
|
1508
|
+
**kwargs: Keyword arguments for the properties to be set.
|
1509
|
+
|
1510
|
+
Possible properties:
|
1511
|
+
- title: str
|
1512
|
+
- x_label: str
|
1513
|
+
- y_label: str
|
1514
|
+
- x_scale: Literal["linear", "log"]
|
1515
|
+
- y_scale: Literal["linear", "log"]
|
1516
|
+
- x_lim: tuple
|
1517
|
+
- y_lim: tuple
|
1421
1518
|
"""
|
1422
1519
|
|
1423
|
-
@property
|
1424
1520
|
@rpc_call
|
1425
|
-
def
|
1521
|
+
def set_title(self, title: "str"):
|
1426
1522
|
"""
|
1427
|
-
|
1523
|
+
Set the title of the plot widget.
|
1428
1524
|
|
1429
|
-
|
1430
|
-
|
1525
|
+
Args:
|
1526
|
+
title(str): Title of the plot widget.
|
1431
1527
|
"""
|
1432
1528
|
|
1433
1529
|
@rpc_call
|
1434
|
-
def
|
1530
|
+
def set_x_label(self, label: "str"):
|
1435
1531
|
"""
|
1436
|
-
|
1532
|
+
Set the label of the x-axis.
|
1533
|
+
|
1534
|
+
Args:
|
1535
|
+
label(str): Label of the x-axis.
|
1437
1536
|
"""
|
1438
1537
|
|
1439
1538
|
@rpc_call
|
1440
|
-
def
|
1539
|
+
def set_y_label(self, label: "str"):
|
1441
1540
|
"""
|
1442
|
-
|
1541
|
+
Set the label of the y-axis.
|
1542
|
+
|
1543
|
+
Args:
|
1544
|
+
label(str): Label of the y-axis.
|
1443
1545
|
"""
|
1444
1546
|
|
1445
1547
|
@rpc_call
|
1446
|
-
def
|
1548
|
+
def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
1447
1549
|
"""
|
1448
|
-
|
1550
|
+
Set the scale of the x-axis.
|
1449
1551
|
|
1450
|
-
|
1451
|
-
|
1552
|
+
Args:
|
1553
|
+
scale(Literal["linear", "log"]): Scale of the x-axis.
|
1452
1554
|
"""
|
1453
1555
|
|
1454
1556
|
@rpc_call
|
1455
|
-
def
|
1557
|
+
def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
1456
1558
|
"""
|
1457
|
-
Set the
|
1559
|
+
Set the scale of the y-axis.
|
1458
1560
|
|
1459
1561
|
Args:
|
1460
|
-
|
1562
|
+
scale(Literal["linear", "log"]): Scale of the y-axis.
|
1461
1563
|
"""
|
1462
1564
|
|
1463
1565
|
@rpc_call
|
1464
|
-
def
|
1465
|
-
self,
|
1466
|
-
widget: "BECConnector | str",
|
1467
|
-
row=None,
|
1468
|
-
col=0,
|
1469
|
-
rowspan=1,
|
1470
|
-
colspan=1,
|
1471
|
-
shift: "Literal['down', 'up', 'left', 'right']" = "down",
|
1472
|
-
) -> "BECConnector":
|
1566
|
+
def set_x_lim(self, *args) -> "None":
|
1473
1567
|
"""
|
1474
|
-
|
1568
|
+
Set the limits of the x-axis. This method can accept either two separate arguments
|
1569
|
+
for the minimum and maximum x-axis values, or a single tuple containing both limits.
|
1570
|
+
|
1571
|
+
Usage:
|
1572
|
+
set_x_lim(x_min, x_max)
|
1573
|
+
set_x_lim((x_min, x_max))
|
1475
1574
|
|
1476
1575
|
Args:
|
1477
|
-
|
1478
|
-
|
1479
|
-
col(int): The column to add the widget to.
|
1480
|
-
rowspan(int): The number of rows the widget should span.
|
1481
|
-
colspan(int): The number of columns the widget should span.
|
1482
|
-
shift(Literal["down", "up", "left", "right"]): The direction to shift the widgets if the position is occupied.
|
1576
|
+
*args: A variable number of arguments. Can be two integers (x_min and x_max)
|
1577
|
+
or a single tuple with two integers.
|
1483
1578
|
"""
|
1484
1579
|
|
1485
1580
|
@rpc_call
|
1486
|
-
def
|
1581
|
+
def set_y_lim(self, *args) -> "None":
|
1487
1582
|
"""
|
1488
|
-
|
1583
|
+
Set the limits of the y-axis. This method can accept either two separate arguments
|
1584
|
+
for the minimum and maximum y-axis values, or a single tuple containing both limits.
|
1489
1585
|
|
1490
|
-
|
1491
|
-
|
1586
|
+
Usage:
|
1587
|
+
set_y_lim(y_min, y_max)
|
1588
|
+
set_y_lim((y_min, y_max))
|
1589
|
+
|
1590
|
+
Args:
|
1591
|
+
*args: A variable number of arguments. Can be two integers (y_min and y_max)
|
1592
|
+
or a single tuple with two integers.
|
1492
1593
|
"""
|
1493
1594
|
|
1494
1595
|
@rpc_call
|
1495
|
-
def
|
1596
|
+
def set_grid(self, x: "bool" = False, y: "bool" = False):
|
1496
1597
|
"""
|
1497
|
-
|
1598
|
+
Set the grid of the plot widget.
|
1498
1599
|
|
1499
1600
|
Args:
|
1500
|
-
|
1501
|
-
|
1502
|
-
new_col(int): The new column to move the widget to.
|
1601
|
+
x(bool): Show grid on the x-axis.
|
1602
|
+
y(bool): Show grid on the y-axis.
|
1503
1603
|
"""
|
1504
1604
|
|
1505
1605
|
@rpc_call
|
1506
|
-
def
|
1606
|
+
def lock_aspect_ratio(self, lock):
|
1507
1607
|
"""
|
1508
|
-
|
1608
|
+
Lock aspect ratio.
|
1509
1609
|
|
1510
1610
|
Args:
|
1511
|
-
|
1611
|
+
lock(bool): True to lock, False to unlock.
|
1512
1612
|
"""
|
1513
1613
|
|
1514
1614
|
@rpc_call
|
1515
1615
|
def remove(self):
|
1516
1616
|
"""
|
1517
|
-
Remove the
|
1617
|
+
Remove the plot widget from the figure.
|
1518
1618
|
"""
|
1519
1619
|
|
1620
|
+
|
1621
|
+
class Ring(RPCBase):
|
1520
1622
|
@rpc_call
|
1521
|
-
def
|
1623
|
+
def get_all_rpc(self) -> "dict":
|
1522
1624
|
"""
|
1523
|
-
|
1625
|
+
Get all registered RPC objects.
|
1524
1626
|
"""
|
1525
1627
|
|
1628
|
+
@property
|
1526
1629
|
@rpc_call
|
1527
|
-
def
|
1630
|
+
def rpc_id(self) -> "str":
|
1528
1631
|
"""
|
1529
|
-
|
1632
|
+
Get the RPC ID of the widget.
|
1530
1633
|
"""
|
1531
1634
|
|
1532
|
-
|
1533
|
-
class BECDockArea(RPCBase, BECGuiClientMixin):
|
1534
1635
|
@property
|
1535
1636
|
@rpc_call
|
1536
1637
|
def config_dict(self) -> "dict":
|
@@ -1541,119 +1642,79 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
|
|
1541
1642
|
dict: The configuration of the widget.
|
1542
1643
|
"""
|
1543
1644
|
|
1544
|
-
@property
|
1545
|
-
@rpc_call
|
1546
|
-
def panels(self) -> "dict[str, BECDock]":
|
1547
|
-
"""
|
1548
|
-
Get the docks in the dock area.
|
1549
|
-
Returns:
|
1550
|
-
dock_dict(dict): The docks in the dock area.
|
1551
|
-
"""
|
1552
|
-
|
1553
1645
|
@rpc_call
|
1554
|
-
def
|
1646
|
+
def set_value(self, value: "int | float"):
|
1555
1647
|
"""
|
1556
|
-
|
1648
|
+
Set the value for the ring widget
|
1557
1649
|
|
1558
|
-
|
1559
|
-
|
1650
|
+
Args:
|
1651
|
+
value(int | float): Value for the ring widget
|
1560
1652
|
"""
|
1561
1653
|
|
1562
1654
|
@rpc_call
|
1563
|
-
def
|
1655
|
+
def set_color(self, color: "str | tuple"):
|
1564
1656
|
"""
|
1565
|
-
|
1657
|
+
Set the color for the ring widget
|
1566
1658
|
|
1567
1659
|
Args:
|
1568
|
-
|
1660
|
+
color(str | tuple): Color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
1569
1661
|
"""
|
1570
1662
|
|
1571
1663
|
@rpc_call
|
1572
|
-
def
|
1573
|
-
self, state: "dict" = None, missing: "Literal['ignore', 'error']" = "ignore", extra="bottom"
|
1574
|
-
):
|
1664
|
+
def set_background(self, color: "str | tuple"):
|
1575
1665
|
"""
|
1576
|
-
|
1666
|
+
Set the background color for the ring widget
|
1577
1667
|
|
1578
1668
|
Args:
|
1579
|
-
|
1580
|
-
missing(Literal['ignore','error']): What to do if a dock is missing.
|
1581
|
-
extra(str): Extra docks that are in the dockarea but that are not mentioned in state will be added to the bottom of the dockarea, unless otherwise specified by the extra argument.
|
1669
|
+
color(str | tuple): Background color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
1582
1670
|
"""
|
1583
1671
|
|
1584
1672
|
@rpc_call
|
1585
|
-
def
|
1586
|
-
self,
|
1587
|
-
name: "str" = None,
|
1588
|
-
position: "Literal['bottom', 'top', 'left', 'right', 'above', 'below']" = None,
|
1589
|
-
relative_to: "BECDock | None" = None,
|
1590
|
-
closable: "bool" = False,
|
1591
|
-
floating: "bool" = False,
|
1592
|
-
prefix: "str" = "dock",
|
1593
|
-
widget: "str | QWidget | None" = None,
|
1594
|
-
row: "int" = None,
|
1595
|
-
col: "int" = 0,
|
1596
|
-
rowspan: "int" = 1,
|
1597
|
-
colspan: "int" = 1,
|
1598
|
-
) -> "BECDock":
|
1673
|
+
def set_line_width(self, width: "int"):
|
1599
1674
|
"""
|
1600
|
-
|
1675
|
+
Set the line width for the ring widget
|
1601
1676
|
|
1602
1677
|
Args:
|
1603
|
-
|
1604
|
-
position(Literal["bottom", "top", "left", "right", "above", "below"]): The position of the dock.
|
1605
|
-
relative_to(BECDock): The dock to which the new dock should be added relative to.
|
1606
|
-
closable(bool): Whether the dock is closable.
|
1607
|
-
floating(bool): Whether the dock is detached after creating.
|
1608
|
-
prefix(str): The prefix for the dock name if no name is provided.
|
1609
|
-
widget(str|QWidget|None): The widget to be added to the dock. While using RPC, only BEC RPC widgets from RPCWidgetHandler are allowed.
|
1610
|
-
row(int): The row of the added widget.
|
1611
|
-
col(int): The column of the added widget.
|
1612
|
-
rowspan(int): The rowspan of the added widget.
|
1613
|
-
colspan(int): The colspan of the added widget.
|
1614
|
-
|
1615
|
-
Returns:
|
1616
|
-
BECDock: The created dock.
|
1678
|
+
width(int): Line width for the ring widget
|
1617
1679
|
"""
|
1618
1680
|
|
1619
1681
|
@rpc_call
|
1620
|
-
def
|
1682
|
+
def set_min_max_values(self, min_value: "int | float", max_value: "int | float"):
|
1621
1683
|
"""
|
1622
|
-
|
1684
|
+
Set the min and max values for the ring widget.
|
1685
|
+
|
1686
|
+
Args:
|
1687
|
+
min_value(int | float): Minimum value for the ring widget
|
1688
|
+
max_value(int | float): Maximum value for the ring widget
|
1623
1689
|
"""
|
1624
1690
|
|
1625
1691
|
@rpc_call
|
1626
|
-
def
|
1692
|
+
def set_start_angle(self, start_angle: "int"):
|
1627
1693
|
"""
|
1628
|
-
|
1694
|
+
Set the start angle for the ring widget
|
1629
1695
|
|
1630
1696
|
Args:
|
1631
|
-
|
1632
|
-
|
1633
|
-
Returns:
|
1634
|
-
BECDock: The undocked dock.
|
1697
|
+
start_angle(int): Start angle for the ring widget in degrees
|
1635
1698
|
"""
|
1636
1699
|
|
1637
1700
|
@rpc_call
|
1638
|
-
def
|
1639
|
-
"""
|
1640
|
-
Return all floating docks to the dock area.
|
1701
|
+
def set_update(self, mode: "Literal['manual', 'scan', 'device']", device: "str" = None):
|
1641
1702
|
"""
|
1703
|
+
Set the update mode for the ring widget.
|
1704
|
+
Modes:
|
1705
|
+
- "manual": Manual update mode, the value is set by the user.
|
1706
|
+
- "scan": Update mode for the scan progress. The value is updated by the current scan progress.
|
1707
|
+
- "device": Update mode for the device readback. The value is updated by the device readback. Take into account that user has to set the device name and limits.
|
1642
1708
|
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
Get all registered RPC objects.
|
1709
|
+
Args:
|
1710
|
+
mode(str): Update mode for the ring widget. Can be "manual", "scan" or "device"
|
1711
|
+
device(str): Device name for the device readback mode, only used when mode is "device"
|
1647
1712
|
"""
|
1648
1713
|
|
1649
|
-
@property
|
1650
1714
|
@rpc_call
|
1651
|
-
def
|
1715
|
+
def reset_connection(self):
|
1652
1716
|
"""
|
1653
|
-
|
1654
|
-
|
1655
|
-
Returns:
|
1656
|
-
list: The temporary areas in the dock area.
|
1717
|
+
Reset the connections for the ring widget. Disconnect the current slot and endpoint.
|
1657
1718
|
"""
|
1658
1719
|
|
1659
1720
|
|
@@ -1836,144 +1897,6 @@ class SpiralProgressBar(RPCBase):
|
|
1836
1897
|
"""
|
1837
1898
|
|
1838
1899
|
|
1839
|
-
class Ring(RPCBase):
|
1840
|
-
@rpc_call
|
1841
|
-
def get_all_rpc(self) -> "dict":
|
1842
|
-
"""
|
1843
|
-
Get all registered RPC objects.
|
1844
|
-
"""
|
1845
|
-
|
1846
|
-
@property
|
1847
|
-
@rpc_call
|
1848
|
-
def rpc_id(self) -> "str":
|
1849
|
-
"""
|
1850
|
-
Get the RPC ID of the widget.
|
1851
|
-
"""
|
1852
|
-
|
1853
|
-
@property
|
1854
|
-
@rpc_call
|
1855
|
-
def config_dict(self) -> "dict":
|
1856
|
-
"""
|
1857
|
-
Get the configuration of the widget.
|
1858
|
-
|
1859
|
-
Returns:
|
1860
|
-
dict: The configuration of the widget.
|
1861
|
-
"""
|
1862
|
-
|
1863
|
-
@rpc_call
|
1864
|
-
def set_value(self, value: "int | float"):
|
1865
|
-
"""
|
1866
|
-
Set the value for the ring widget
|
1867
|
-
|
1868
|
-
Args:
|
1869
|
-
value(int | float): Value for the ring widget
|
1870
|
-
"""
|
1871
|
-
|
1872
|
-
@rpc_call
|
1873
|
-
def set_color(self, color: "str | tuple"):
|
1874
|
-
"""
|
1875
|
-
Set the color for the ring widget
|
1876
|
-
|
1877
|
-
Args:
|
1878
|
-
color(str | tuple): Color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
1879
|
-
"""
|
1880
|
-
|
1881
|
-
@rpc_call
|
1882
|
-
def set_background(self, color: "str | tuple"):
|
1883
|
-
"""
|
1884
|
-
Set the background color for the ring widget
|
1885
|
-
|
1886
|
-
Args:
|
1887
|
-
color(str | tuple): Background color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
1888
|
-
"""
|
1889
|
-
|
1890
|
-
@rpc_call
|
1891
|
-
def set_line_width(self, width: "int"):
|
1892
|
-
"""
|
1893
|
-
Set the line width for the ring widget
|
1894
|
-
|
1895
|
-
Args:
|
1896
|
-
width(int): Line width for the ring widget
|
1897
|
-
"""
|
1898
|
-
|
1899
|
-
@rpc_call
|
1900
|
-
def set_min_max_values(self, min_value: "int | float", max_value: "int | float"):
|
1901
|
-
"""
|
1902
|
-
Set the min and max values for the ring widget.
|
1903
|
-
|
1904
|
-
Args:
|
1905
|
-
min_value(int | float): Minimum value for the ring widget
|
1906
|
-
max_value(int | float): Maximum value for the ring widget
|
1907
|
-
"""
|
1908
|
-
|
1909
|
-
@rpc_call
|
1910
|
-
def set_start_angle(self, start_angle: "int"):
|
1911
|
-
"""
|
1912
|
-
Set the start angle for the ring widget
|
1913
|
-
|
1914
|
-
Args:
|
1915
|
-
start_angle(int): Start angle for the ring widget in degrees
|
1916
|
-
"""
|
1917
|
-
|
1918
|
-
@rpc_call
|
1919
|
-
def set_update(self, mode: "Literal['manual', 'scan', 'device']", device: "str" = None):
|
1920
|
-
"""
|
1921
|
-
Set the update mode for the ring widget.
|
1922
|
-
Modes:
|
1923
|
-
- "manual": Manual update mode, the value is set by the user.
|
1924
|
-
- "scan": Update mode for the scan progress. The value is updated by the current scan progress.
|
1925
|
-
- "device": Update mode for the device readback. The value is updated by the device readback. Take into account that user has to set the device name and limits.
|
1926
|
-
|
1927
|
-
Args:
|
1928
|
-
mode(str): Update mode for the ring widget. Can be "manual", "scan" or "device"
|
1929
|
-
device(str): Device name for the device readback mode, only used when mode is "device"
|
1930
|
-
"""
|
1931
|
-
|
1932
|
-
@rpc_call
|
1933
|
-
def reset_connection(self):
|
1934
|
-
"""
|
1935
|
-
Reset the connections for the ring widget. Disconnect the current slot and endpoint.
|
1936
|
-
"""
|
1937
|
-
|
1938
|
-
|
1939
|
-
class WebsiteWidget(RPCBase):
|
1940
|
-
@rpc_call
|
1941
|
-
def set_url(self, url: str) -> None:
|
1942
|
-
"""
|
1943
|
-
Set the url of the website widget
|
1944
|
-
|
1945
|
-
Args:
|
1946
|
-
url (str): The url to set
|
1947
|
-
"""
|
1948
|
-
|
1949
|
-
@rpc_call
|
1950
|
-
def get_url(self) -> str:
|
1951
|
-
"""
|
1952
|
-
Get the current url of the website widget
|
1953
|
-
|
1954
|
-
Returns:
|
1955
|
-
str: The current url
|
1956
|
-
"""
|
1957
|
-
|
1958
|
-
@rpc_call
|
1959
|
-
def reload(self):
|
1960
|
-
"""
|
1961
|
-
Reload the website
|
1962
|
-
"""
|
1963
|
-
|
1964
|
-
@rpc_call
|
1965
|
-
def back(self):
|
1966
|
-
"""
|
1967
|
-
Go back in the history
|
1968
|
-
"""
|
1969
|
-
|
1970
|
-
@rpc_call
|
1971
|
-
def forward(self):
|
1972
|
-
"""
|
1973
|
-
Go forward in the history
|
1974
|
-
"""
|
1975
|
-
|
1976
|
-
|
1977
1900
|
class WebsiteWidget(RPCBase):
|
1978
1901
|
@rpc_call
|
1979
1902
|
def set_url(self, url: str) -> None:
|