bec-widgets 0.51.0__py3-none-any.whl → 0.52.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bec_widgets/cli/__init__.py +1 -1
- bec_widgets/cli/bec_widgets_icon.png +0 -0
- bec_widgets/cli/client.py +328 -5
- bec_widgets/cli/client_utils.py +17 -5
- bec_widgets/cli/generate_cli.py +7 -3
- bec_widgets/cli/rpc_register.py +4 -0
- bec_widgets/cli/rpc_wigdet_handler.py +27 -0
- bec_widgets/cli/server.py +34 -9
- bec_widgets/examples/jupyter_console/jupyter_console_window.py +54 -2
- bec_widgets/examples/jupyter_console/jupyter_console_window.ui +26 -2
- bec_widgets/examples/jupyter_console/terminal_icon.png +0 -0
- bec_widgets/utils/__init__.py +1 -0
- bec_widgets/utils/bec_connector.py +18 -3
- bec_widgets/utils/bec_table.py +1 -0
- bec_widgets/utils/container_utils.py +3 -0
- bec_widgets/utils/crosshair.py +1 -0
- bec_widgets/utils/entry_validator.py +2 -0
- bec_widgets/utils/layout_manager.py +121 -0
- bec_widgets/utils/widget_io.py +5 -0
- bec_widgets/utils/yaml_dialog.py +2 -0
- bec_widgets/validation/monitor_config_validator.py +2 -1
- bec_widgets/widgets/__init__.py +1 -0
- bec_widgets/widgets/dock/__init__.py +2 -0
- bec_widgets/widgets/dock/dock.py +269 -0
- bec_widgets/widgets/dock/dock_area.py +225 -0
- bec_widgets/widgets/figure/figure.py +45 -16
- bec_widgets/widgets/plots/__init__.py +1 -1
- bec_widgets/widgets/plots/image.py +46 -9
- bec_widgets/widgets/plots/motor_map.py +17 -3
- bec_widgets/widgets/plots/plot_base.py +14 -3
- bec_widgets/widgets/plots/waveform.py +37 -10
- bec_widgets/widgets/scan_control/scan_control.py +10 -2
- bec_widgets/widgets/toolbar/toolbar.py +1 -0
- {bec_widgets-0.51.0.dist-info → bec_widgets-0.52.1.dist-info}/METADATA +1 -1
- {bec_widgets-0.51.0.dist-info → bec_widgets-0.52.1.dist-info}/RECORD +46 -40
- tests/end-2-end/conftest.py +19 -4
- tests/end-2-end/test_bec_dock_rpc_e2e.py +145 -0
- tests/end-2-end/test_bec_figure_rpc_e2e.py +17 -17
- tests/end-2-end/test_rpc_register_e2e.py +3 -3
- tests/unit_tests/test_bec_dock.py +114 -0
- tests/unit_tests/test_bec_figure.py +20 -22
- tests/unit_tests/test_generate_cli_client.py +1 -1
- tests/unit_tests/test_waveform1d.py +1 -1
- bec_widgets/simulations/__init__.py +0 -0
- bec_widgets/utils/ctrl_c.py +0 -39
- {bec_widgets-0.51.0.dist-info → bec_widgets-0.52.1.dist-info}/LICENSE +0 -0
- {bec_widgets-0.51.0.dist-info → bec_widgets-0.52.1.dist-info}/WHEEL +0 -0
- {bec_widgets-0.51.0.dist-info → bec_widgets-0.52.1.dist-info}/top_level.txt +0 -0
bec_widgets/cli/client.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
from typing import Literal, Optional, overload
|
4
4
|
|
5
|
-
from bec_widgets.cli.client_utils import
|
5
|
+
from bec_widgets.cli.client_utils import BECGuiClientMixin, RPCBase, rpc_call
|
6
6
|
|
7
7
|
|
8
8
|
class BECPlotBase(RPCBase):
|
@@ -11,6 +11,7 @@ class BECPlotBase(RPCBase):
|
|
11
11
|
def config_dict(self) -> "dict":
|
12
12
|
"""
|
13
13
|
Get the configuration of the widget.
|
14
|
+
|
14
15
|
Returns:
|
15
16
|
dict: The configuration of the widget.
|
16
17
|
"""
|
@@ -19,8 +20,10 @@ class BECPlotBase(RPCBase):
|
|
19
20
|
def set(self, **kwargs) -> "None":
|
20
21
|
"""
|
21
22
|
Set the properties of the plot widget.
|
23
|
+
|
22
24
|
Args:
|
23
25
|
**kwargs: Keyword arguments for the properties to be set.
|
26
|
+
|
24
27
|
Possible properties:
|
25
28
|
- title: str
|
26
29
|
- x_label: str
|
@@ -35,6 +38,7 @@ class BECPlotBase(RPCBase):
|
|
35
38
|
def set_title(self, title: "str"):
|
36
39
|
"""
|
37
40
|
Set the title of the plot widget.
|
41
|
+
|
38
42
|
Args:
|
39
43
|
title(str): Title of the plot widget.
|
40
44
|
"""
|
@@ -43,6 +47,7 @@ class BECPlotBase(RPCBase):
|
|
43
47
|
def set_x_label(self, label: "str"):
|
44
48
|
"""
|
45
49
|
Set the label of the x-axis.
|
50
|
+
|
46
51
|
Args:
|
47
52
|
label(str): Label of the x-axis.
|
48
53
|
"""
|
@@ -51,6 +56,7 @@ class BECPlotBase(RPCBase):
|
|
51
56
|
def set_y_label(self, label: "str"):
|
52
57
|
"""
|
53
58
|
Set the label of the y-axis.
|
59
|
+
|
54
60
|
Args:
|
55
61
|
label(str): Label of the y-axis.
|
56
62
|
"""
|
@@ -59,6 +65,7 @@ class BECPlotBase(RPCBase):
|
|
59
65
|
def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
60
66
|
"""
|
61
67
|
Set the scale of the x-axis.
|
68
|
+
|
62
69
|
Args:
|
63
70
|
scale(Literal["linear", "log"]): Scale of the x-axis.
|
64
71
|
"""
|
@@ -67,6 +74,7 @@ class BECPlotBase(RPCBase):
|
|
67
74
|
def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
68
75
|
"""
|
69
76
|
Set the scale of the y-axis.
|
77
|
+
|
70
78
|
Args:
|
71
79
|
scale(Literal["linear", "log"]): Scale of the y-axis.
|
72
80
|
"""
|
@@ -105,6 +113,7 @@ class BECPlotBase(RPCBase):
|
|
105
113
|
def set_grid(self, x: "bool" = False, y: "bool" = False):
|
106
114
|
"""
|
107
115
|
Set the grid of the plot widget.
|
116
|
+
|
108
117
|
Args:
|
109
118
|
x(bool): Show grid on the x-axis.
|
110
119
|
y(bool): Show grid on the y-axis.
|
@@ -114,6 +123,7 @@ class BECPlotBase(RPCBase):
|
|
114
123
|
def lock_aspect_ratio(self, lock):
|
115
124
|
"""
|
116
125
|
Lock aspect ratio.
|
126
|
+
|
117
127
|
Args:
|
118
128
|
lock(bool): True to lock, False to unlock.
|
119
129
|
"""
|
@@ -122,6 +132,7 @@ class BECPlotBase(RPCBase):
|
|
122
132
|
def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
|
123
133
|
"""
|
124
134
|
Plot custom data on the plot widget. These data are not saved in config.
|
135
|
+
|
125
136
|
Args:
|
126
137
|
data_x(list|np.ndarray): x-axis data
|
127
138
|
data_y(list|np.ndarray): y-axis data
|
@@ -148,6 +159,7 @@ class BECWaveform(RPCBase):
|
|
148
159
|
def config_dict(self) -> "dict":
|
149
160
|
"""
|
150
161
|
Get the configuration of the widget.
|
162
|
+
|
151
163
|
Returns:
|
152
164
|
dict: The configuration of the widget.
|
153
165
|
"""
|
@@ -169,6 +181,7 @@ class BECWaveform(RPCBase):
|
|
169
181
|
) -> "BECCurve":
|
170
182
|
"""
|
171
183
|
Add a curve to the plot widget from the scan segment.
|
184
|
+
|
172
185
|
Args:
|
173
186
|
x_name(str): Name of the x signal.
|
174
187
|
x_entry(str): Entry of the x signal.
|
@@ -196,6 +209,7 @@ class BECWaveform(RPCBase):
|
|
196
209
|
) -> "BECCurve":
|
197
210
|
"""
|
198
211
|
Add a custom data curve to the plot widget.
|
212
|
+
|
199
213
|
Args:
|
200
214
|
x(list|np.ndarray): X data of the curve.
|
201
215
|
y(list|np.ndarray): Y data of the curve.
|
@@ -211,6 +225,7 @@ class BECWaveform(RPCBase):
|
|
211
225
|
def remove_curve(self, *identifiers):
|
212
226
|
"""
|
213
227
|
Remove a curve from the plot widget.
|
228
|
+
|
214
229
|
Args:
|
215
230
|
*identifiers: Identifier of the curve to be removed. Can be either an integer (index) or a string (curve_id).
|
216
231
|
"""
|
@@ -220,6 +235,7 @@ class BECWaveform(RPCBase):
|
|
220
235
|
"""
|
221
236
|
Update the scan curves with the data from the scan storage.
|
222
237
|
Provide only one of scan_id or scan_index.
|
238
|
+
|
223
239
|
Args:
|
224
240
|
scan_id(str, optional): ScanID of the scan to be updated. Defaults to None.
|
225
241
|
scan_index(int, optional): Index of the scan to be updated. Defaults to None.
|
@@ -238,8 +254,10 @@ class BECWaveform(RPCBase):
|
|
238
254
|
def get_curve(self, identifier) -> "BECCurve":
|
239
255
|
"""
|
240
256
|
Get the curve by its index or ID.
|
257
|
+
|
241
258
|
Args:
|
242
259
|
identifier(int|str): Identifier of the curve. Can be either an integer (index) or a string (curve_id).
|
260
|
+
|
243
261
|
Returns:
|
244
262
|
BECCurve: The curve object.
|
245
263
|
"""
|
@@ -248,18 +266,21 @@ class BECWaveform(RPCBase):
|
|
248
266
|
def get_curve_config(self, curve_id: "str", dict_output: "bool" = True) -> "CurveConfig | dict":
|
249
267
|
"""
|
250
268
|
Get the configuration of a curve by its ID.
|
269
|
+
|
251
270
|
Args:
|
252
271
|
curve_id(str): ID of the curve.
|
272
|
+
|
253
273
|
Returns:
|
254
274
|
CurveConfig|dict: Configuration of the curve.
|
255
275
|
"""
|
256
276
|
|
257
277
|
@rpc_call
|
258
|
-
def apply_config(self, config: "dict |
|
278
|
+
def apply_config(self, config: "dict | SubplotConfig", replot_last_scan: "bool" = False):
|
259
279
|
"""
|
260
280
|
Apply the configuration to the 1D waveform widget.
|
281
|
+
|
261
282
|
Args:
|
262
|
-
config(dict|
|
283
|
+
config(dict|SubplotConfig): Configuration settings.
|
263
284
|
replot_last_scan(bool, optional): If True, replot the last scan. Defaults to False.
|
264
285
|
"""
|
265
286
|
|
@@ -267,8 +288,10 @@ class BECWaveform(RPCBase):
|
|
267
288
|
def get_all_data(self, output: "Literal['dict', 'pandas']" = "dict") -> "dict | pd.DataFrame":
|
268
289
|
"""
|
269
290
|
Extract all curve data into a dictionary or a pandas DataFrame.
|
291
|
+
|
270
292
|
Args:
|
271
293
|
output (Literal["dict", "pandas"]): Format of the output data.
|
294
|
+
|
272
295
|
Returns:
|
273
296
|
dict | pd.DataFrame: Data of all curves in the specified format.
|
274
297
|
"""
|
@@ -277,8 +300,10 @@ class BECWaveform(RPCBase):
|
|
277
300
|
def set(self, **kwargs) -> "None":
|
278
301
|
"""
|
279
302
|
Set the properties of the plot widget.
|
303
|
+
|
280
304
|
Args:
|
281
305
|
**kwargs: Keyword arguments for the properties to be set.
|
306
|
+
|
282
307
|
Possible properties:
|
283
308
|
- title: str
|
284
309
|
- x_label: str
|
@@ -293,6 +318,7 @@ class BECWaveform(RPCBase):
|
|
293
318
|
def set_title(self, title: "str"):
|
294
319
|
"""
|
295
320
|
Set the title of the plot widget.
|
321
|
+
|
296
322
|
Args:
|
297
323
|
title(str): Title of the plot widget.
|
298
324
|
"""
|
@@ -301,6 +327,7 @@ class BECWaveform(RPCBase):
|
|
301
327
|
def set_x_label(self, label: "str"):
|
302
328
|
"""
|
303
329
|
Set the label of the x-axis.
|
330
|
+
|
304
331
|
Args:
|
305
332
|
label(str): Label of the x-axis.
|
306
333
|
"""
|
@@ -309,6 +336,7 @@ class BECWaveform(RPCBase):
|
|
309
336
|
def set_y_label(self, label: "str"):
|
310
337
|
"""
|
311
338
|
Set the label of the y-axis.
|
339
|
+
|
312
340
|
Args:
|
313
341
|
label(str): Label of the y-axis.
|
314
342
|
"""
|
@@ -317,6 +345,7 @@ class BECWaveform(RPCBase):
|
|
317
345
|
def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
318
346
|
"""
|
319
347
|
Set the scale of the x-axis.
|
348
|
+
|
320
349
|
Args:
|
321
350
|
scale(Literal["linear", "log"]): Scale of the x-axis.
|
322
351
|
"""
|
@@ -325,6 +354,7 @@ class BECWaveform(RPCBase):
|
|
325
354
|
def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
326
355
|
"""
|
327
356
|
Set the scale of the y-axis.
|
357
|
+
|
328
358
|
Args:
|
329
359
|
scale(Literal["linear", "log"]): Scale of the y-axis.
|
330
360
|
"""
|
@@ -363,6 +393,7 @@ class BECWaveform(RPCBase):
|
|
363
393
|
def set_grid(self, x: "bool" = False, y: "bool" = False):
|
364
394
|
"""
|
365
395
|
Set the grid of the plot widget.
|
396
|
+
|
366
397
|
Args:
|
367
398
|
x(bool): Show grid on the x-axis.
|
368
399
|
y(bool): Show grid on the y-axis.
|
@@ -372,6 +403,7 @@ class BECWaveform(RPCBase):
|
|
372
403
|
def lock_aspect_ratio(self, lock):
|
373
404
|
"""
|
374
405
|
Lock aspect ratio.
|
406
|
+
|
375
407
|
Args:
|
376
408
|
lock(bool): True to lock, False to unlock.
|
377
409
|
"""
|
@@ -380,6 +412,7 @@ class BECWaveform(RPCBase):
|
|
380
412
|
def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
|
381
413
|
"""
|
382
414
|
Plot custom data on the plot widget. These data are not saved in config.
|
415
|
+
|
383
416
|
Args:
|
384
417
|
data_x(list|np.ndarray): x-axis data
|
385
418
|
data_y(list|np.ndarray): y-axis data
|
@@ -393,7 +426,7 @@ class BECWaveform(RPCBase):
|
|
393
426
|
"""
|
394
427
|
|
395
428
|
|
396
|
-
class BECFigure(RPCBase
|
429
|
+
class BECFigure(RPCBase):
|
397
430
|
@property
|
398
431
|
@rpc_call
|
399
432
|
def rpc_id(self) -> "str":
|
@@ -406,6 +439,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
406
439
|
def config_dict(self) -> "dict":
|
407
440
|
"""
|
408
441
|
Get the configuration of the widget.
|
442
|
+
|
409
443
|
Returns:
|
410
444
|
dict: The configuration of the widget.
|
411
445
|
"""
|
@@ -414,6 +448,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
414
448
|
def axes(self, row: "int", col: "int") -> "BECPlotBase":
|
415
449
|
"""
|
416
450
|
Get widget by its coordinates in the figure.
|
451
|
+
|
417
452
|
Args:
|
418
453
|
row(int): the row coordinate
|
419
454
|
col(int): the column coordinate
|
@@ -426,7 +461,9 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
426
461
|
@rpc_call
|
427
462
|
def widgets(self) -> "dict":
|
428
463
|
"""
|
429
|
-
|
464
|
+
All widgets within the figure with gui ids as keys.
|
465
|
+
Returns:
|
466
|
+
dict: All widgets within the figure.
|
430
467
|
"""
|
431
468
|
|
432
469
|
@rpc_call
|
@@ -451,6 +488,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
451
488
|
) -> "BECWaveform":
|
452
489
|
"""
|
453
490
|
Add a Waveform1D plot to the figure at the specified position.
|
491
|
+
|
454
492
|
Args:
|
455
493
|
widget_id(str): The unique identifier of the widget. If not provided, a unique ID will be generated.
|
456
494
|
row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
|
@@ -474,6 +512,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
474
512
|
) -> "BECImageShow":
|
475
513
|
"""
|
476
514
|
Add an image to the figure at the specified position.
|
515
|
+
|
477
516
|
Args:
|
478
517
|
monitor(str): The name of the monitor to display.
|
479
518
|
color_bar(Literal["simple","full"]): The type of color bar to display.
|
@@ -531,6 +570,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
531
570
|
) -> "BECWaveform":
|
532
571
|
"""
|
533
572
|
Add a 1D waveform plot to the figure. Always access the first waveform widget in the figure.
|
573
|
+
|
534
574
|
Args:
|
535
575
|
x_name(str): The name of the device for the x-axis.
|
536
576
|
y_name(str): The name of the device for the y-axis.
|
@@ -562,6 +602,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
562
602
|
) -> "BECImageShow":
|
563
603
|
"""
|
564
604
|
Add an image to the figure. Always access the first image widget in the figure.
|
605
|
+
|
565
606
|
Args:
|
566
607
|
monitor(str): The name of the monitor to display.
|
567
608
|
color_bar(Literal["simple","full"]): The type of color bar to display.
|
@@ -580,6 +621,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
580
621
|
) -> "BECMotorMap":
|
581
622
|
"""
|
582
623
|
Add a motor map to the figure. Always access the first motor map widget in the figure.
|
624
|
+
|
583
625
|
Args:
|
584
626
|
motor_x(str): The name of the motor for the X axis.
|
585
627
|
motor_y(str): The name of the motor for the Y axis.
|
@@ -599,6 +641,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
599
641
|
) -> "None":
|
600
642
|
"""
|
601
643
|
Remove a widget from the figure. Can be removed by its unique identifier or by its coordinates.
|
644
|
+
|
602
645
|
Args:
|
603
646
|
row(int): The row coordinate of the widget to remove.
|
604
647
|
col(int): The column coordinate of the widget to remove.
|
@@ -621,6 +664,7 @@ class BECFigure(RPCBase, BECFigureClientMixin):
|
|
621
664
|
def change_theme(self, theme: "Literal['dark', 'light']") -> "None":
|
622
665
|
"""
|
623
666
|
Change the theme of the figure widget.
|
667
|
+
|
624
668
|
Args:
|
625
669
|
theme(Literal["dark","light"]): The theme to set for the figure widget.
|
626
670
|
"""
|
@@ -666,6 +710,7 @@ class BECCurve(RPCBase):
|
|
666
710
|
def config_dict(self) -> "dict":
|
667
711
|
"""
|
668
712
|
Get the configuration of the widget.
|
713
|
+
|
669
714
|
Returns:
|
670
715
|
dict: The configuration of the widget.
|
671
716
|
"""
|
@@ -674,8 +719,10 @@ class BECCurve(RPCBase):
|
|
674
719
|
def set(self, **kwargs):
|
675
720
|
"""
|
676
721
|
Set the properties of the curve.
|
722
|
+
|
677
723
|
Args:
|
678
724
|
**kwargs: Keyword arguments for the properties to be set.
|
725
|
+
|
679
726
|
Possible properties:
|
680
727
|
- color: str
|
681
728
|
- symbol: str
|
@@ -695,6 +742,7 @@ class BECCurve(RPCBase):
|
|
695
742
|
def set_color(self, color: "str", symbol_color: "Optional[str]" = None):
|
696
743
|
"""
|
697
744
|
Change the color of the curve.
|
745
|
+
|
698
746
|
Args:
|
699
747
|
color(str): Color of the curve.
|
700
748
|
symbol_color(str, optional): Color of the symbol. Defaults to None.
|
@@ -704,6 +752,7 @@ class BECCurve(RPCBase):
|
|
704
752
|
def set_colormap(self, colormap: "str"):
|
705
753
|
"""
|
706
754
|
Set the colormap for the scatter plot z gradient.
|
755
|
+
|
707
756
|
Args:
|
708
757
|
colormap(str): Colormap for the scatter plot.
|
709
758
|
"""
|
@@ -712,6 +761,7 @@ class BECCurve(RPCBase):
|
|
712
761
|
def set_symbol(self, symbol: "str"):
|
713
762
|
"""
|
714
763
|
Change the symbol of the curve.
|
764
|
+
|
715
765
|
Args:
|
716
766
|
symbol(str): Symbol of the curve.
|
717
767
|
"""
|
@@ -720,6 +770,7 @@ class BECCurve(RPCBase):
|
|
720
770
|
def set_symbol_color(self, symbol_color: "str"):
|
721
771
|
"""
|
722
772
|
Change the symbol color of the curve.
|
773
|
+
|
723
774
|
Args:
|
724
775
|
symbol_color(str): Color of the symbol.
|
725
776
|
"""
|
@@ -728,6 +779,7 @@ class BECCurve(RPCBase):
|
|
728
779
|
def set_symbol_size(self, symbol_size: "int"):
|
729
780
|
"""
|
730
781
|
Change the symbol size of the curve.
|
782
|
+
|
731
783
|
Args:
|
732
784
|
symbol_size(int): Size of the symbol.
|
733
785
|
"""
|
@@ -736,6 +788,7 @@ class BECCurve(RPCBase):
|
|
736
788
|
def set_pen_width(self, pen_width: "int"):
|
737
789
|
"""
|
738
790
|
Change the pen width of the curve.
|
791
|
+
|
739
792
|
Args:
|
740
793
|
pen_width(int): Width of the pen.
|
741
794
|
"""
|
@@ -744,6 +797,7 @@ class BECCurve(RPCBase):
|
|
744
797
|
def set_pen_style(self, pen_style: "Literal['solid', 'dash', 'dot', 'dashdot']"):
|
745
798
|
"""
|
746
799
|
Change the pen style of the curve.
|
800
|
+
|
747
801
|
Args:
|
748
802
|
pen_style(Literal["solid", "dash", "dot", "dashdot"]): Style of the pen.
|
749
803
|
"""
|
@@ -770,6 +824,7 @@ class BECImageShow(RPCBase):
|
|
770
824
|
def config_dict(self) -> "dict":
|
771
825
|
"""
|
772
826
|
Get the configuration of the widget.
|
827
|
+
|
773
828
|
Returns:
|
774
829
|
dict: The configuration of the widget.
|
775
830
|
"""
|
@@ -778,6 +833,7 @@ class BECImageShow(RPCBase):
|
|
778
833
|
def add_image_by_config(self, config: "ImageItemConfig | dict") -> "BECImageItem":
|
779
834
|
"""
|
780
835
|
Add an image to the widget by configuration.
|
836
|
+
|
781
837
|
Args:
|
782
838
|
config(ImageItemConfig|dict): The configuration of the image.
|
783
839
|
|
@@ -789,6 +845,7 @@ class BECImageShow(RPCBase):
|
|
789
845
|
def get_image_config(self, image_id, dict_output: "bool" = True) -> "ImageItemConfig | dict":
|
790
846
|
"""
|
791
847
|
Get the configuration of the image.
|
848
|
+
|
792
849
|
Args:
|
793
850
|
image_id(str): The ID of the image.
|
794
851
|
dict_output(bool): Whether to return the configuration as a dictionary. Defaults to True.
|
@@ -801,6 +858,7 @@ class BECImageShow(RPCBase):
|
|
801
858
|
def get_image_dict(self) -> "dict[str, dict[str, BECImageItem]]":
|
802
859
|
"""
|
803
860
|
Get all images.
|
861
|
+
|
804
862
|
Returns:
|
805
863
|
dict[str, dict[str, BECImageItem]]: The dictionary of images.
|
806
864
|
"""
|
@@ -841,6 +899,7 @@ class BECImageShow(RPCBase):
|
|
841
899
|
"""
|
842
900
|
Set the range of the color bar.
|
843
901
|
If name is not specified, then set vrange for all images.
|
902
|
+
|
844
903
|
Args:
|
845
904
|
vmin(float): Minimum value of the color bar.
|
846
905
|
vmax(float): Maximum value of the color bar.
|
@@ -852,6 +911,7 @@ class BECImageShow(RPCBase):
|
|
852
911
|
"""
|
853
912
|
Set the color map of the image.
|
854
913
|
If name is not specified, then set color map for all images.
|
914
|
+
|
855
915
|
Args:
|
856
916
|
cmap(str): The color map of the image.
|
857
917
|
name(str): The name of the image. If None, apply to all images.
|
@@ -861,6 +921,7 @@ class BECImageShow(RPCBase):
|
|
861
921
|
def set_autorange(self, enable: "bool" = False, name: "str" = None):
|
862
922
|
"""
|
863
923
|
Set the autoscale of the image.
|
924
|
+
|
864
925
|
Args:
|
865
926
|
enable(bool): Whether to autoscale the color bar.
|
866
927
|
name(str): The name of the image. If None, apply to all images.
|
@@ -871,6 +932,7 @@ class BECImageShow(RPCBase):
|
|
871
932
|
"""
|
872
933
|
Set the monitor of the image.
|
873
934
|
If name is not specified, then set monitor for all images.
|
935
|
+
|
874
936
|
Args:
|
875
937
|
monitor(str): The name of the monitor.
|
876
938
|
name(str): The name of the image. If None, apply to all images.
|
@@ -881,6 +943,7 @@ class BECImageShow(RPCBase):
|
|
881
943
|
"""
|
882
944
|
Set the post processing of the image.
|
883
945
|
If name is not specified, then set post processing for all images.
|
946
|
+
|
884
947
|
Args:
|
885
948
|
name(str): The name of the image. If None, apply to all images.
|
886
949
|
**kwargs: Keyword arguments for the properties to be set.
|
@@ -895,6 +958,7 @@ class BECImageShow(RPCBase):
|
|
895
958
|
def set_image_properties(self, name: "str" = None, **kwargs):
|
896
959
|
"""
|
897
960
|
Set the properties of the image.
|
961
|
+
|
898
962
|
Args:
|
899
963
|
name(str): The name of the image. If None, apply to all images.
|
900
964
|
**kwargs: Keyword arguments for the properties to be set.
|
@@ -915,6 +979,7 @@ class BECImageShow(RPCBase):
|
|
915
979
|
"""
|
916
980
|
Set the FFT of the image.
|
917
981
|
If name is not specified, then set FFT for all images.
|
982
|
+
|
918
983
|
Args:
|
919
984
|
enable(bool): Whether to perform FFT on the monitor data.
|
920
985
|
name(str): The name of the image. If None, apply to all images.
|
@@ -925,6 +990,7 @@ class BECImageShow(RPCBase):
|
|
925
990
|
"""
|
926
991
|
Set the log of the image.
|
927
992
|
If name is not specified, then set log for all images.
|
993
|
+
|
928
994
|
Args:
|
929
995
|
enable(bool): Whether to perform log on the monitor data.
|
930
996
|
name(str): The name of the image. If None, apply to all images.
|
@@ -935,6 +1001,7 @@ class BECImageShow(RPCBase):
|
|
935
1001
|
"""
|
936
1002
|
Set the rotation of the image.
|
937
1003
|
If name is not specified, then set rotation for all images.
|
1004
|
+
|
938
1005
|
Args:
|
939
1006
|
deg_90(int): The rotation angle of the monitor data before displaying.
|
940
1007
|
name(str): The name of the image. If None, apply to all images.
|
@@ -945,6 +1012,7 @@ class BECImageShow(RPCBase):
|
|
945
1012
|
"""
|
946
1013
|
Set the transpose of the image.
|
947
1014
|
If name is not specified, then set transpose for all images.
|
1015
|
+
|
948
1016
|
Args:
|
949
1017
|
enable(bool): Whether to transpose the monitor data before displaying.
|
950
1018
|
name(str): The name of the image. If None, apply to all images.
|
@@ -954,6 +1022,7 @@ class BECImageShow(RPCBase):
|
|
954
1022
|
def toggle_threading(self, use_threading: "bool"):
|
955
1023
|
"""
|
956
1024
|
Toggle threading for the widgets postprocessing and updating.
|
1025
|
+
|
957
1026
|
Args:
|
958
1027
|
use_threading(bool): Whether to use threading.
|
959
1028
|
"""
|
@@ -962,8 +1031,10 @@ class BECImageShow(RPCBase):
|
|
962
1031
|
def set(self, **kwargs) -> "None":
|
963
1032
|
"""
|
964
1033
|
Set the properties of the plot widget.
|
1034
|
+
|
965
1035
|
Args:
|
966
1036
|
**kwargs: Keyword arguments for the properties to be set.
|
1037
|
+
|
967
1038
|
Possible properties:
|
968
1039
|
- title: str
|
969
1040
|
- x_label: str
|
@@ -978,6 +1049,7 @@ class BECImageShow(RPCBase):
|
|
978
1049
|
def set_title(self, title: "str"):
|
979
1050
|
"""
|
980
1051
|
Set the title of the plot widget.
|
1052
|
+
|
981
1053
|
Args:
|
982
1054
|
title(str): Title of the plot widget.
|
983
1055
|
"""
|
@@ -986,6 +1058,7 @@ class BECImageShow(RPCBase):
|
|
986
1058
|
def set_x_label(self, label: "str"):
|
987
1059
|
"""
|
988
1060
|
Set the label of the x-axis.
|
1061
|
+
|
989
1062
|
Args:
|
990
1063
|
label(str): Label of the x-axis.
|
991
1064
|
"""
|
@@ -994,6 +1067,7 @@ class BECImageShow(RPCBase):
|
|
994
1067
|
def set_y_label(self, label: "str"):
|
995
1068
|
"""
|
996
1069
|
Set the label of the y-axis.
|
1070
|
+
|
997
1071
|
Args:
|
998
1072
|
label(str): Label of the y-axis.
|
999
1073
|
"""
|
@@ -1002,6 +1076,7 @@ class BECImageShow(RPCBase):
|
|
1002
1076
|
def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
1003
1077
|
"""
|
1004
1078
|
Set the scale of the x-axis.
|
1079
|
+
|
1005
1080
|
Args:
|
1006
1081
|
scale(Literal["linear", "log"]): Scale of the x-axis.
|
1007
1082
|
"""
|
@@ -1010,6 +1085,7 @@ class BECImageShow(RPCBase):
|
|
1010
1085
|
def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
1011
1086
|
"""
|
1012
1087
|
Set the scale of the y-axis.
|
1088
|
+
|
1013
1089
|
Args:
|
1014
1090
|
scale(Literal["linear", "log"]): Scale of the y-axis.
|
1015
1091
|
"""
|
@@ -1048,6 +1124,7 @@ class BECImageShow(RPCBase):
|
|
1048
1124
|
def set_grid(self, x: "bool" = False, y: "bool" = False):
|
1049
1125
|
"""
|
1050
1126
|
Set the grid of the plot widget.
|
1127
|
+
|
1051
1128
|
Args:
|
1052
1129
|
x(bool): Show grid on the x-axis.
|
1053
1130
|
y(bool): Show grid on the y-axis.
|
@@ -1057,6 +1134,7 @@ class BECImageShow(RPCBase):
|
|
1057
1134
|
def lock_aspect_ratio(self, lock):
|
1058
1135
|
"""
|
1059
1136
|
Lock aspect ratio.
|
1137
|
+
|
1060
1138
|
Args:
|
1061
1139
|
lock(bool): True to lock, False to unlock.
|
1062
1140
|
"""
|
@@ -1065,6 +1143,7 @@ class BECImageShow(RPCBase):
|
|
1065
1143
|
def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
|
1066
1144
|
"""
|
1067
1145
|
Plot custom data on the plot widget. These data are not saved in config.
|
1146
|
+
|
1068
1147
|
Args:
|
1069
1148
|
data_x(list|np.ndarray): x-axis data
|
1070
1149
|
data_y(list|np.ndarray): y-axis data
|
@@ -1093,6 +1172,7 @@ class BECConnector(RPCBase):
|
|
1093
1172
|
def config_dict(self) -> "dict":
|
1094
1173
|
"""
|
1095
1174
|
Get the configuration of the widget.
|
1175
|
+
|
1096
1176
|
Returns:
|
1097
1177
|
dict: The configuration of the widget.
|
1098
1178
|
"""
|
@@ -1117,6 +1197,7 @@ class BECImageItem(RPCBase):
|
|
1117
1197
|
def config_dict(self) -> "dict":
|
1118
1198
|
"""
|
1119
1199
|
Get the configuration of the widget.
|
1200
|
+
|
1120
1201
|
Returns:
|
1121
1202
|
dict: The configuration of the widget.
|
1122
1203
|
"""
|
@@ -1125,8 +1206,10 @@ class BECImageItem(RPCBase):
|
|
1125
1206
|
def set(self, **kwargs):
|
1126
1207
|
"""
|
1127
1208
|
Set the properties of the image.
|
1209
|
+
|
1128
1210
|
Args:
|
1129
1211
|
**kwargs: Keyword arguments for the properties to be set.
|
1212
|
+
|
1130
1213
|
Possible properties:
|
1131
1214
|
- downsample
|
1132
1215
|
- color_map
|
@@ -1143,6 +1226,7 @@ class BECImageItem(RPCBase):
|
|
1143
1226
|
def set_fft(self, enable: "bool" = False):
|
1144
1227
|
"""
|
1145
1228
|
Set the FFT of the image.
|
1229
|
+
|
1146
1230
|
Args:
|
1147
1231
|
enable(bool): Whether to perform FFT on the monitor data.
|
1148
1232
|
"""
|
@@ -1151,6 +1235,7 @@ class BECImageItem(RPCBase):
|
|
1151
1235
|
def set_log(self, enable: "bool" = False):
|
1152
1236
|
"""
|
1153
1237
|
Set the log of the image.
|
1238
|
+
|
1154
1239
|
Args:
|
1155
1240
|
enable(bool): Whether to perform log on the monitor data.
|
1156
1241
|
"""
|
@@ -1159,6 +1244,7 @@ class BECImageItem(RPCBase):
|
|
1159
1244
|
def set_rotation(self, deg_90: "int" = 0):
|
1160
1245
|
"""
|
1161
1246
|
Set the rotation of the image.
|
1247
|
+
|
1162
1248
|
Args:
|
1163
1249
|
deg_90(int): The rotation angle of the monitor data before displaying.
|
1164
1250
|
"""
|
@@ -1167,6 +1253,7 @@ class BECImageItem(RPCBase):
|
|
1167
1253
|
def set_transpose(self, enable: "bool" = False):
|
1168
1254
|
"""
|
1169
1255
|
Set the transpose of the image.
|
1256
|
+
|
1170
1257
|
Args:
|
1171
1258
|
enable(bool): Whether to transpose the image.
|
1172
1259
|
"""
|
@@ -1175,6 +1262,7 @@ class BECImageItem(RPCBase):
|
|
1175
1262
|
def set_opacity(self, opacity: "float" = 1.0):
|
1176
1263
|
"""
|
1177
1264
|
Set the opacity of the image.
|
1265
|
+
|
1178
1266
|
Args:
|
1179
1267
|
opacity(float): The opacity of the image.
|
1180
1268
|
"""
|
@@ -1183,6 +1271,7 @@ class BECImageItem(RPCBase):
|
|
1183
1271
|
def set_autorange(self, autorange: "bool" = False):
|
1184
1272
|
"""
|
1185
1273
|
Set the autorange of the color bar.
|
1274
|
+
|
1186
1275
|
Args:
|
1187
1276
|
autorange(bool): Whether to autorange the color bar.
|
1188
1277
|
"""
|
@@ -1191,6 +1280,7 @@ class BECImageItem(RPCBase):
|
|
1191
1280
|
def set_color_map(self, cmap: "str" = "magma"):
|
1192
1281
|
"""
|
1193
1282
|
Set the color map of the image.
|
1283
|
+
|
1194
1284
|
Args:
|
1195
1285
|
cmap(str): The color map of the image.
|
1196
1286
|
"""
|
@@ -1199,6 +1289,7 @@ class BECImageItem(RPCBase):
|
|
1199
1289
|
def set_auto_downsample(self, auto: "bool" = True):
|
1200
1290
|
"""
|
1201
1291
|
Set the auto downsample of the image.
|
1292
|
+
|
1202
1293
|
Args:
|
1203
1294
|
auto(bool): Whether to downsample the image.
|
1204
1295
|
"""
|
@@ -1207,6 +1298,7 @@ class BECImageItem(RPCBase):
|
|
1207
1298
|
def set_monitor(self, monitor: "str"):
|
1208
1299
|
"""
|
1209
1300
|
Set the monitor of the image.
|
1301
|
+
|
1210
1302
|
Args:
|
1211
1303
|
monitor(str): The name of the monitor.
|
1212
1304
|
"""
|
@@ -1217,6 +1309,7 @@ class BECImageItem(RPCBase):
|
|
1217
1309
|
):
|
1218
1310
|
"""
|
1219
1311
|
Set the range of the color bar.
|
1312
|
+
|
1220
1313
|
Args:
|
1221
1314
|
vmin(float): Minimum value of the color bar.
|
1222
1315
|
vmax(float): Maximum value of the color bar.
|
@@ -1237,6 +1330,7 @@ class BECMotorMap(RPCBase):
|
|
1237
1330
|
def config_dict(self) -> "dict":
|
1238
1331
|
"""
|
1239
1332
|
Get the configuration of the widget.
|
1333
|
+
|
1240
1334
|
Returns:
|
1241
1335
|
dict: The configuration of the widget.
|
1242
1336
|
"""
|
@@ -1252,6 +1346,7 @@ class BECMotorMap(RPCBase):
|
|
1252
1346
|
) -> "None":
|
1253
1347
|
"""
|
1254
1348
|
Change the active motors for the plot.
|
1349
|
+
|
1255
1350
|
Args:
|
1256
1351
|
motor_x(str): Motor name for the X axis.
|
1257
1352
|
motor_y(str): Motor name for the Y axis.
|
@@ -1264,6 +1359,7 @@ class BECMotorMap(RPCBase):
|
|
1264
1359
|
def set_max_points(self, max_points: "int") -> "None":
|
1265
1360
|
"""
|
1266
1361
|
Set the maximum number of points to display.
|
1362
|
+
|
1267
1363
|
Args:
|
1268
1364
|
max_points(int): Maximum number of points to display.
|
1269
1365
|
"""
|
@@ -1272,6 +1368,7 @@ class BECMotorMap(RPCBase):
|
|
1272
1368
|
def set_precision(self, precision: "int") -> "None":
|
1273
1369
|
"""
|
1274
1370
|
Set the decimal precision of the motor position.
|
1371
|
+
|
1275
1372
|
Args:
|
1276
1373
|
precision(int): Decimal precision of the motor position.
|
1277
1374
|
"""
|
@@ -1280,6 +1377,7 @@ class BECMotorMap(RPCBase):
|
|
1280
1377
|
def set_num_dim_points(self, num_dim_points: "int") -> "None":
|
1281
1378
|
"""
|
1282
1379
|
Set the number of dim points for the motor map.
|
1380
|
+
|
1283
1381
|
Args:
|
1284
1382
|
num_dim_points(int): Number of dim points.
|
1285
1383
|
"""
|
@@ -1288,6 +1386,7 @@ class BECMotorMap(RPCBase):
|
|
1288
1386
|
def set_background_value(self, background_value: "int") -> "None":
|
1289
1387
|
"""
|
1290
1388
|
Set the background value of the motor map.
|
1389
|
+
|
1291
1390
|
Args:
|
1292
1391
|
background_value(int): Background value of the motor map.
|
1293
1392
|
"""
|
@@ -1296,6 +1395,7 @@ class BECMotorMap(RPCBase):
|
|
1296
1395
|
def set_scatter_size(self, scatter_size: "int") -> "None":
|
1297
1396
|
"""
|
1298
1397
|
Set the scatter size of the motor map plot.
|
1398
|
+
|
1299
1399
|
Args:
|
1300
1400
|
scatter_size(int): Size of the scatter points.
|
1301
1401
|
"""
|
@@ -1307,3 +1407,226 @@ class BECMotorMap(RPCBase):
|
|
1307
1407
|
Returns:
|
1308
1408
|
dict: Data of the motor map.
|
1309
1409
|
"""
|
1410
|
+
|
1411
|
+
|
1412
|
+
class BECDock(RPCBase):
|
1413
|
+
@property
|
1414
|
+
@rpc_call
|
1415
|
+
def rpc_id(self) -> "str":
|
1416
|
+
"""
|
1417
|
+
Get the RPC ID of the widget.
|
1418
|
+
"""
|
1419
|
+
|
1420
|
+
@property
|
1421
|
+
@rpc_call
|
1422
|
+
def widget_list(self) -> "list":
|
1423
|
+
"""
|
1424
|
+
Get the widgets in the dock.
|
1425
|
+
|
1426
|
+
Returns:
|
1427
|
+
widgets(list): The widgets in the dock.
|
1428
|
+
"""
|
1429
|
+
|
1430
|
+
@rpc_call
|
1431
|
+
def show_title_bar(self):
|
1432
|
+
"""
|
1433
|
+
Hide the title bar of the dock.
|
1434
|
+
"""
|
1435
|
+
|
1436
|
+
@rpc_call
|
1437
|
+
def hide_title_bar(self):
|
1438
|
+
"""
|
1439
|
+
Hide the title bar of the dock.
|
1440
|
+
"""
|
1441
|
+
|
1442
|
+
@rpc_call
|
1443
|
+
def get_widgets_positions(self) -> "dict":
|
1444
|
+
"""
|
1445
|
+
Get the positions of the widgets in the dock.
|
1446
|
+
|
1447
|
+
Returns:
|
1448
|
+
dict: The positions of the widgets in the dock as dict -> {(row, col, rowspan, colspan):widget}
|
1449
|
+
"""
|
1450
|
+
|
1451
|
+
@rpc_call
|
1452
|
+
def set_title(self, title: "str"):
|
1453
|
+
"""
|
1454
|
+
Set the title of the dock.
|
1455
|
+
|
1456
|
+
Args:
|
1457
|
+
title(str): The title of the dock.
|
1458
|
+
"""
|
1459
|
+
|
1460
|
+
@rpc_call
|
1461
|
+
def add_widget_bec(
|
1462
|
+
self,
|
1463
|
+
widget_type: "str",
|
1464
|
+
row=None,
|
1465
|
+
col=0,
|
1466
|
+
rowspan=1,
|
1467
|
+
colspan=1,
|
1468
|
+
shift: "Literal['down', 'up', 'left', 'right']" = "down",
|
1469
|
+
):
|
1470
|
+
"""
|
1471
|
+
Add a widget to the dock.
|
1472
|
+
|
1473
|
+
Args:
|
1474
|
+
widget_type(str): The widget to add. Only BEC RPC widgets from RPCWidgetHandler are allowed.
|
1475
|
+
row(int): The row to add the widget to. If None, the widget will be added to the next available row.
|
1476
|
+
col(int): The column to add the widget to.
|
1477
|
+
rowspan(int): The number of rows the widget should span.
|
1478
|
+
colspan(int): The number of columns the widget should span.
|
1479
|
+
shift(Literal["down", "up", "left", "right"]): The direction to shift the widgets if the position is occupied.
|
1480
|
+
"""
|
1481
|
+
|
1482
|
+
@rpc_call
|
1483
|
+
def list_eligible_widgets(self) -> "list":
|
1484
|
+
"""
|
1485
|
+
List all widgets that can be added to the dock.
|
1486
|
+
|
1487
|
+
Returns:
|
1488
|
+
list: The list of eligible widgets.
|
1489
|
+
"""
|
1490
|
+
|
1491
|
+
@rpc_call
|
1492
|
+
def move_widget(self, widget: "QWidget", new_row: "int", new_col: "int"):
|
1493
|
+
"""
|
1494
|
+
Move a widget to a new position in the layout.
|
1495
|
+
|
1496
|
+
Args:
|
1497
|
+
widget(QWidget): The widget to move.
|
1498
|
+
new_row(int): The new row to move the widget to.
|
1499
|
+
new_col(int): The new column to move the widget to.
|
1500
|
+
"""
|
1501
|
+
|
1502
|
+
@rpc_call
|
1503
|
+
def remove_widget(self, widget_rpc_id: "str"):
|
1504
|
+
"""
|
1505
|
+
Remove a widget from the dock.
|
1506
|
+
|
1507
|
+
Args:
|
1508
|
+
widget_rpc_id(str): The ID of the widget to remove.
|
1509
|
+
"""
|
1510
|
+
|
1511
|
+
@rpc_call
|
1512
|
+
def remove(self):
|
1513
|
+
"""
|
1514
|
+
Remove the dock from the parent dock area.
|
1515
|
+
"""
|
1516
|
+
|
1517
|
+
@rpc_call
|
1518
|
+
def attach(self):
|
1519
|
+
"""
|
1520
|
+
Attach the dock to the parent dock area.
|
1521
|
+
"""
|
1522
|
+
|
1523
|
+
@rpc_call
|
1524
|
+
def detach(self):
|
1525
|
+
"""
|
1526
|
+
Detach the dock from the parent dock area.
|
1527
|
+
"""
|
1528
|
+
|
1529
|
+
|
1530
|
+
class BECDockArea(RPCBase, BECGuiClientMixin):
|
1531
|
+
@property
|
1532
|
+
@rpc_call
|
1533
|
+
def panels(self) -> "dict":
|
1534
|
+
"""
|
1535
|
+
Get the docks in the dock area.
|
1536
|
+
Returns:
|
1537
|
+
dock_dict(dict): The docks in the dock area.
|
1538
|
+
"""
|
1539
|
+
|
1540
|
+
@rpc_call
|
1541
|
+
def save_state(self) -> "dict":
|
1542
|
+
"""
|
1543
|
+
Save the state of the dock area.
|
1544
|
+
|
1545
|
+
Returns:
|
1546
|
+
dict: The state of the dock area.
|
1547
|
+
"""
|
1548
|
+
|
1549
|
+
@rpc_call
|
1550
|
+
def remove_dock(self, name: "str"):
|
1551
|
+
"""
|
1552
|
+
Remove a dock by name and ensure it is properly closed and cleaned up.
|
1553
|
+
|
1554
|
+
Args:
|
1555
|
+
name(str): The name of the dock to remove.
|
1556
|
+
"""
|
1557
|
+
|
1558
|
+
@rpc_call
|
1559
|
+
def restore_state(
|
1560
|
+
self, state: "dict" = None, missing: "Literal['ignore', 'error']" = "ignore", extra="bottom"
|
1561
|
+
):
|
1562
|
+
"""
|
1563
|
+
Restore the state of the dock area. If no state is provided, the last state is restored.
|
1564
|
+
|
1565
|
+
Args:
|
1566
|
+
state(dict): The state to restore.
|
1567
|
+
missing(Literal['ignore','error']): What to do if a dock is missing.
|
1568
|
+
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.
|
1569
|
+
"""
|
1570
|
+
|
1571
|
+
@rpc_call
|
1572
|
+
def add_dock(
|
1573
|
+
self,
|
1574
|
+
name: "str" = None,
|
1575
|
+
position: "Literal['bottom', 'top', 'left', 'right', 'above', 'below']" = None,
|
1576
|
+
relative_to: "BECDock | None" = None,
|
1577
|
+
closable: "bool" = False,
|
1578
|
+
prefix: "str" = "dock",
|
1579
|
+
widget: "str | QWidget | None" = None,
|
1580
|
+
row: "int" = None,
|
1581
|
+
col: "int" = 0,
|
1582
|
+
rowspan: "int" = 1,
|
1583
|
+
colspan: "int" = 1,
|
1584
|
+
) -> "BECDock":
|
1585
|
+
"""
|
1586
|
+
Add a dock to the dock area. Dock has QGridLayout as layout manager by default.
|
1587
|
+
|
1588
|
+
Args:
|
1589
|
+
name(str): The name of the dock to be displayed and for further references. Has to be unique.
|
1590
|
+
position(Literal["bottom", "top", "left", "right", "above", "below"]): The position of the dock.
|
1591
|
+
relative_to(BECDock): The dock to which the new dock should be added relative to.
|
1592
|
+
closable(bool): Whether the dock is closable.
|
1593
|
+
prefix(str): The prefix for the dock name if no name is provided.
|
1594
|
+
widget(str|QWidget|None): The widget to be added to the dock. While using RPC, only BEC RPC widgets from RPCWidgetHandler are allowed.
|
1595
|
+
row(int): The row of the added widget.
|
1596
|
+
col(int): The column of the added widget.
|
1597
|
+
rowspan(int): The rowspan of the added widget.
|
1598
|
+
colspan(int): The colspan of the added widget.
|
1599
|
+
|
1600
|
+
Returns:
|
1601
|
+
BECDock: The created dock.
|
1602
|
+
"""
|
1603
|
+
|
1604
|
+
@rpc_call
|
1605
|
+
def clear_all(self):
|
1606
|
+
"""
|
1607
|
+
Close all docks and remove all temp areas.
|
1608
|
+
"""
|
1609
|
+
|
1610
|
+
@rpc_call
|
1611
|
+
def detach_dock(self, dock_name: "str") -> "BECDock":
|
1612
|
+
"""
|
1613
|
+
Undock a dock from the dock area.
|
1614
|
+
|
1615
|
+
Args:
|
1616
|
+
dock_name(str): The dock to undock.
|
1617
|
+
|
1618
|
+
Returns:
|
1619
|
+
BECDock: The undocked dock.
|
1620
|
+
"""
|
1621
|
+
|
1622
|
+
@rpc_call
|
1623
|
+
def attach_all(self):
|
1624
|
+
"""
|
1625
|
+
Return all floating docks to the dock area.
|
1626
|
+
"""
|
1627
|
+
|
1628
|
+
@rpc_call
|
1629
|
+
def get_all_rpc(self) -> "dict":
|
1630
|
+
"""
|
1631
|
+
Get all registered RPC objects.
|
1632
|
+
"""
|