bec-widgets 0.76.0__py3-none-any.whl → 0.77.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.
- CHANGELOG.md +42 -44
- PKG-INFO +2 -1
- bec_widgets/cli/client.py +73 -196
- bec_widgets/examples/jupyter_console/jupyter_console_window.py +25 -4
- bec_widgets/utils/bec_connector.py +66 -8
- bec_widgets/utils/colors.py +38 -0
- bec_widgets/utils/generate_designer_plugin.py +15 -14
- bec_widgets/utils/yaml_dialog.py +27 -3
- bec_widgets/widgets/console/console.py +496 -0
- bec_widgets/widgets/dock/dock.py +2 -2
- bec_widgets/widgets/dock/dock_area.py +2 -2
- bec_widgets/widgets/figure/figure.py +149 -195
- bec_widgets/widgets/figure/plots/image/image.py +62 -49
- bec_widgets/widgets/figure/plots/image/image_item.py +4 -3
- bec_widgets/widgets/figure/plots/motor_map/motor_map.py +98 -29
- bec_widgets/widgets/figure/plots/plot_base.py +1 -1
- bec_widgets/widgets/figure/plots/waveform/waveform.py +7 -8
- bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +2 -2
- bec_widgets/widgets/ring_progress_bar/ring.py +3 -3
- bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +3 -3
- {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/METADATA +2 -1
- {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/RECORD +40 -38
- pyproject.toml +2 -1
- tests/end-2-end/test_bec_dock_rpc_e2e.py +16 -16
- tests/end-2-end/test_bec_figure_rpc_e2e.py +7 -7
- tests/end-2-end/test_rpc_register_e2e.py +8 -8
- tests/unit_tests/client_mocks.py +1 -0
- tests/unit_tests/test_bec_figure.py +49 -26
- tests/unit_tests/test_bec_motor_map.py +179 -41
- tests/unit_tests/test_color_validation.py +15 -0
- tests/unit_tests/test_device_input_base.py +1 -1
- tests/unit_tests/test_device_input_widgets.py +2 -0
- tests/unit_tests/test_generate_plugin.py +155 -0
- tests/unit_tests/test_motor_control.py +5 -4
- tests/unit_tests/test_plot_base.py +3 -3
- tests/unit_tests/test_waveform1d.py +18 -17
- tests/unit_tests/test_yaml_dialog.py +7 -7
- {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/WHEEL +0 -0
- {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.76.0.dist-info → bec_widgets-0.77.0.dist-info}/licenses/LICENSE +0 -0
bec_widgets/cli/client.py
CHANGED
@@ -41,14 +41,14 @@ class BECCurve(RPCBase):
|
|
41
41
|
|
42
42
|
@property
|
43
43
|
@rpc_call
|
44
|
-
def
|
44
|
+
def _rpc_id(self) -> "str":
|
45
45
|
"""
|
46
46
|
Get the RPC ID of the widget.
|
47
47
|
"""
|
48
48
|
|
49
49
|
@property
|
50
50
|
@rpc_call
|
51
|
-
def
|
51
|
+
def _config_dict(self) -> "dict":
|
52
52
|
"""
|
53
53
|
Get the configuration of the widget.
|
54
54
|
|
@@ -162,7 +162,7 @@ class BECCurve(RPCBase):
|
|
162
162
|
class BECDock(RPCBase):
|
163
163
|
@property
|
164
164
|
@rpc_call
|
165
|
-
def
|
165
|
+
def _config_dict(self) -> "dict":
|
166
166
|
"""
|
167
167
|
Get the configuration of the widget.
|
168
168
|
|
@@ -172,7 +172,7 @@ class BECDock(RPCBase):
|
|
172
172
|
|
173
173
|
@property
|
174
174
|
@rpc_call
|
175
|
-
def
|
175
|
+
def _rpc_id(self) -> "str":
|
176
176
|
"""
|
177
177
|
Get the RPC ID of the widget.
|
178
178
|
"""
|
@@ -290,7 +290,7 @@ class BECDock(RPCBase):
|
|
290
290
|
class BECDockArea(RPCBase, BECGuiClientMixin):
|
291
291
|
@property
|
292
292
|
@rpc_call
|
293
|
-
def
|
293
|
+
def _config_dict(self) -> "dict":
|
294
294
|
"""
|
295
295
|
Get the configuration of the widget.
|
296
296
|
|
@@ -398,7 +398,7 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
|
|
398
398
|
"""
|
399
399
|
|
400
400
|
@rpc_call
|
401
|
-
def
|
401
|
+
def _get_all_rpc(self) -> "dict":
|
402
402
|
"""
|
403
403
|
Get all registered RPC objects.
|
404
404
|
"""
|
@@ -417,14 +417,14 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
|
|
417
417
|
class BECFigure(RPCBase):
|
418
418
|
@property
|
419
419
|
@rpc_call
|
420
|
-
def
|
420
|
+
def _rpc_id(self) -> "str":
|
421
421
|
"""
|
422
422
|
Get the RPC ID of the widget.
|
423
423
|
"""
|
424
424
|
|
425
425
|
@property
|
426
426
|
@rpc_call
|
427
|
-
def
|
427
|
+
def _config_dict(self) -> "dict":
|
428
428
|
"""
|
429
429
|
Get the configuration of the widget.
|
430
430
|
|
@@ -432,6 +432,12 @@ class BECFigure(RPCBase):
|
|
432
432
|
dict: The configuration of the widget.
|
433
433
|
"""
|
434
434
|
|
435
|
+
@rpc_call
|
436
|
+
def _get_all_rpc(self) -> "dict":
|
437
|
+
"""
|
438
|
+
Get all registered RPC objects.
|
439
|
+
"""
|
440
|
+
|
435
441
|
@rpc_call
|
436
442
|
def axes(self, row: "int", col: "int") -> "BECPlotBase":
|
437
443
|
"""
|
@@ -454,103 +460,6 @@ class BECFigure(RPCBase):
|
|
454
460
|
dict: All widgets within the figure.
|
455
461
|
"""
|
456
462
|
|
457
|
-
@rpc_call
|
458
|
-
def add_plot(
|
459
|
-
self,
|
460
|
-
x: "list | np.ndarray" = None,
|
461
|
-
y: "list | np.ndarray" = None,
|
462
|
-
x_name: "str" = None,
|
463
|
-
y_name: "str" = None,
|
464
|
-
z_name: "str" = None,
|
465
|
-
x_entry: "str" = None,
|
466
|
-
y_entry: "str" = None,
|
467
|
-
z_entry: "str" = None,
|
468
|
-
color: "Optional[str]" = None,
|
469
|
-
color_map_z: "Optional[str]" = "plasma",
|
470
|
-
label: "Optional[str]" = None,
|
471
|
-
validate: "bool" = True,
|
472
|
-
row: "int" = None,
|
473
|
-
col: "int" = None,
|
474
|
-
config=None,
|
475
|
-
dap: "str | None" = None,
|
476
|
-
**axis_kwargs,
|
477
|
-
) -> "BECWaveform":
|
478
|
-
"""
|
479
|
-
Add a Waveform1D plot to the figure at the specified position.
|
480
|
-
|
481
|
-
Args:
|
482
|
-
x(list | np.ndarray): Custom x data to plot.
|
483
|
-
y(list | np.ndarray): Custom y data to plot.
|
484
|
-
x_name(str): The name of the device for the x-axis.
|
485
|
-
y_name(str): The name of the device for the y-axis.
|
486
|
-
z_name(str): The name of the device for the z-axis.
|
487
|
-
x_entry(str): The name of the entry for the x-axis.
|
488
|
-
y_entry(str): The name of the entry for the y-axis.
|
489
|
-
z_entry(str): The name of the entry for the z-axis.
|
490
|
-
color(str): The color of the curve.
|
491
|
-
color_map_z(str): The color map to use for the z-axis.
|
492
|
-
label(str): The label of the curve.
|
493
|
-
validate(bool): If True, validate the device names and entries.
|
494
|
-
row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
|
495
|
-
col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
|
496
|
-
config(dict): Additional configuration for the widget.
|
497
|
-
**axis_kwargs(dict): Additional axis properties to set on the widget after creation.
|
498
|
-
"""
|
499
|
-
|
500
|
-
@rpc_call
|
501
|
-
def add_image(
|
502
|
-
self,
|
503
|
-
monitor: "str" = None,
|
504
|
-
color_bar: "Literal['simple', 'full']" = "full",
|
505
|
-
color_map: "str" = "magma",
|
506
|
-
data: "np.ndarray" = None,
|
507
|
-
vrange: "tuple[float, float]" = None,
|
508
|
-
row: "int" = None,
|
509
|
-
col: "int" = None,
|
510
|
-
config=None,
|
511
|
-
**axis_kwargs,
|
512
|
-
) -> "BECImageShow":
|
513
|
-
"""
|
514
|
-
Add an image to the figure at the specified position.
|
515
|
-
|
516
|
-
Args:
|
517
|
-
monitor(str): The name of the monitor to display.
|
518
|
-
color_bar(Literal["simple","full"]): The type of color bar to display.
|
519
|
-
color_map(str): The color map to use for the image.
|
520
|
-
data(np.ndarray): Custom data to display.
|
521
|
-
vrange(tuple[float, float]): The range of values to display.
|
522
|
-
row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
|
523
|
-
col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
|
524
|
-
config(dict): Additional configuration for the widget.
|
525
|
-
**axis_kwargs: Additional axis properties to set on the widget after creation.
|
526
|
-
|
527
|
-
Returns:
|
528
|
-
BECImageShow: The image widget.
|
529
|
-
"""
|
530
|
-
|
531
|
-
@rpc_call
|
532
|
-
def add_motor_map(
|
533
|
-
self,
|
534
|
-
motor_x: "str" = None,
|
535
|
-
motor_y: "str" = None,
|
536
|
-
row: "int" = None,
|
537
|
-
col: "int" = None,
|
538
|
-
config=None,
|
539
|
-
**axis_kwargs,
|
540
|
-
) -> "BECMotorMap":
|
541
|
-
"""
|
542
|
-
Args:
|
543
|
-
motor_x(str): The name of the motor for the X axis.
|
544
|
-
motor_y(str): The name of the motor for the Y axis.
|
545
|
-
row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
|
546
|
-
col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
|
547
|
-
config(dict): Additional configuration for the widget.
|
548
|
-
**axis_kwargs:
|
549
|
-
|
550
|
-
Returns:
|
551
|
-
BECMotorMap: The motor map widget.
|
552
|
-
"""
|
553
|
-
|
554
463
|
@rpc_call
|
555
464
|
def plot(
|
556
465
|
self,
|
@@ -566,7 +475,11 @@ class BECFigure(RPCBase):
|
|
566
475
|
color_map_z: "str | None" = "plasma",
|
567
476
|
label: "str | None" = None,
|
568
477
|
validate: "bool" = True,
|
478
|
+
new: "bool" = False,
|
479
|
+
row: "int | None" = None,
|
480
|
+
col: "int | None" = None,
|
569
481
|
dap: "str | None" = None,
|
482
|
+
config: "dict | None" = None,
|
570
483
|
**axis_kwargs,
|
571
484
|
) -> "BECWaveform":
|
572
485
|
"""
|
@@ -585,7 +498,11 @@ class BECFigure(RPCBase):
|
|
585
498
|
color_map_z(str): The color map to use for the z-axis.
|
586
499
|
label(str): The label of the curve.
|
587
500
|
validate(bool): If True, validate the device names and entries.
|
501
|
+
new(bool): If True, create a new plot instead of using the first plot.
|
502
|
+
row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
|
503
|
+
col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
|
588
504
|
dap(str): The DAP model to use for the curve.
|
505
|
+
config(dict): Recreates the whole BECWaveform widget from provided configuration.
|
589
506
|
**axis_kwargs: Additional axis properties to set on the widget after creation.
|
590
507
|
|
591
508
|
Returns:
|
@@ -600,6 +517,10 @@ class BECFigure(RPCBase):
|
|
600
517
|
color_map: "str" = "magma",
|
601
518
|
data: "np.ndarray" = None,
|
602
519
|
vrange: "tuple[float, float]" = None,
|
520
|
+
new: "bool" = False,
|
521
|
+
row: "int | None" = None,
|
522
|
+
col: "int | None" = None,
|
523
|
+
config: "dict | None" = None,
|
603
524
|
**axis_kwargs,
|
604
525
|
) -> "BECImageShow":
|
605
526
|
"""
|
@@ -611,6 +532,10 @@ class BECFigure(RPCBase):
|
|
611
532
|
color_map(str): The color map to use for the image.
|
612
533
|
data(np.ndarray): Custom data to display.
|
613
534
|
vrange(tuple[float, float]): The range of values to display.
|
535
|
+
new(bool): If True, create a new plot instead of using the first plot.
|
536
|
+
row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
|
537
|
+
col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
|
538
|
+
config(dict): Recreates the whole BECImageShow widget from provided configuration.
|
614
539
|
**axis_kwargs: Additional axis properties to set on the widget after creation.
|
615
540
|
|
616
541
|
Returns:
|
@@ -619,7 +544,14 @@ class BECFigure(RPCBase):
|
|
619
544
|
|
620
545
|
@rpc_call
|
621
546
|
def motor_map(
|
622
|
-
self,
|
547
|
+
self,
|
548
|
+
motor_x: "str" = None,
|
549
|
+
motor_y: "str" = None,
|
550
|
+
new: "bool" = False,
|
551
|
+
row: "int | None" = None,
|
552
|
+
col: "int | None" = None,
|
553
|
+
config: "dict | None" = None,
|
554
|
+
**axis_kwargs,
|
623
555
|
) -> "BECMotorMap":
|
624
556
|
"""
|
625
557
|
Add a motor map to the figure. Always access the first motor map widget in the figure.
|
@@ -627,6 +559,10 @@ class BECFigure(RPCBase):
|
|
627
559
|
Args:
|
628
560
|
motor_x(str): The name of the motor for the X axis.
|
629
561
|
motor_y(str): The name of the motor for the Y axis.
|
562
|
+
new(bool): If True, create a new plot instead of using the first plot.
|
563
|
+
row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
|
564
|
+
col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
|
565
|
+
config(dict): Recreates the whole BECImageShow widget from provided configuration.
|
630
566
|
**axis_kwargs: Additional axis properties to set on the widget after creation.
|
631
567
|
|
632
568
|
Returns:
|
@@ -677,12 +613,6 @@ class BECFigure(RPCBase):
|
|
677
613
|
Clear all widgets from the figure and reset to default state
|
678
614
|
"""
|
679
615
|
|
680
|
-
@rpc_call
|
681
|
-
def get_all_rpc(self) -> "dict":
|
682
|
-
"""
|
683
|
-
Get all registered RPC objects.
|
684
|
-
"""
|
685
|
-
|
686
616
|
@property
|
687
617
|
@rpc_call
|
688
618
|
def widget_list(self) -> "list[BECPlotBase]":
|
@@ -696,14 +626,14 @@ class BECFigure(RPCBase):
|
|
696
626
|
class BECImageItem(RPCBase):
|
697
627
|
@property
|
698
628
|
@rpc_call
|
699
|
-
def
|
629
|
+
def _rpc_id(self) -> "str":
|
700
630
|
"""
|
701
631
|
Get the RPC ID of the widget.
|
702
632
|
"""
|
703
633
|
|
704
634
|
@property
|
705
635
|
@rpc_call
|
706
|
-
def
|
636
|
+
def _config_dict(self) -> "dict":
|
707
637
|
"""
|
708
638
|
Get the configuration of the widget.
|
709
639
|
|
@@ -850,14 +780,14 @@ class BECImageItem(RPCBase):
|
|
850
780
|
class BECImageShow(RPCBase):
|
851
781
|
@property
|
852
782
|
@rpc_call
|
853
|
-
def
|
783
|
+
def _rpc_id(self) -> "str":
|
854
784
|
"""
|
855
785
|
Get the RPC ID of the widget.
|
856
786
|
"""
|
857
787
|
|
858
788
|
@property
|
859
789
|
@rpc_call
|
860
|
-
def
|
790
|
+
def _config_dict(self) -> "dict":
|
861
791
|
"""
|
862
792
|
Get the configuration of the widget.
|
863
793
|
|
@@ -877,34 +807,12 @@ class BECImageShow(RPCBase):
|
|
877
807
|
BECImageItem: The image object.
|
878
808
|
"""
|
879
809
|
|
880
|
-
@rpc_call
|
881
|
-
def get_image_config(self, image_id, dict_output: "bool" = True) -> "ImageItemConfig | dict":
|
882
|
-
"""
|
883
|
-
Get the configuration of the image.
|
884
|
-
|
885
|
-
Args:
|
886
|
-
image_id(str): The ID of the image.
|
887
|
-
dict_output(bool): Whether to return the configuration as a dictionary. Defaults to True.
|
888
|
-
|
889
|
-
Returns:
|
890
|
-
ImageItemConfig|dict: The configuration of the image.
|
891
|
-
"""
|
892
|
-
|
893
|
-
@rpc_call
|
894
|
-
def get_image_dict(self) -> "dict[str, dict[str, BECImageItem]]":
|
895
|
-
"""
|
896
|
-
Get all images.
|
897
|
-
|
898
|
-
Returns:
|
899
|
-
dict[str, dict[str, BECImageItem]]: The dictionary of images.
|
900
|
-
"""
|
901
|
-
|
902
810
|
@rpc_call
|
903
811
|
def add_monitor_image(
|
904
812
|
self,
|
905
813
|
monitor: "str",
|
906
814
|
color_map: "Optional[str]" = "magma",
|
907
|
-
color_bar: "Optional[Literal['simple', 'full']]" = "
|
815
|
+
color_bar: "Optional[Literal['simple', 'full']]" = "full",
|
908
816
|
downsample: "Optional[bool]" = True,
|
909
817
|
opacity: "Optional[float]" = 1.0,
|
910
818
|
vrange: "Optional[tuple[int, int]]" = None,
|
@@ -920,7 +828,7 @@ class BECImageShow(RPCBase):
|
|
920
828
|
name: "str",
|
921
829
|
data: "Optional[np.ndarray]" = None,
|
922
830
|
color_map: "Optional[str]" = "magma",
|
923
|
-
color_bar: "Optional[Literal['simple', 'full']]" = "
|
831
|
+
color_bar: "Optional[Literal['simple', 'full']]" = "full",
|
924
832
|
downsample: "Optional[bool]" = True,
|
925
833
|
opacity: "Optional[float]" = 1.0,
|
926
834
|
vrange: "Optional[tuple[int, int]]" = None,
|
@@ -1065,15 +973,6 @@ class BECImageShow(RPCBase):
|
|
1065
973
|
name(str): The name of the image. If None, apply to all images.
|
1066
974
|
"""
|
1067
975
|
|
1068
|
-
@rpc_call
|
1069
|
-
def toggle_threading(self, use_threading: "bool"):
|
1070
|
-
"""
|
1071
|
-
Toggle threading for the widgets postprocessing and updating.
|
1072
|
-
|
1073
|
-
Args:
|
1074
|
-
use_threading(bool): Whether to use threading.
|
1075
|
-
"""
|
1076
|
-
|
1077
976
|
@rpc_call
|
1078
977
|
def set(self, **kwargs) -> "None":
|
1079
978
|
"""
|
@@ -1209,14 +1108,14 @@ class BECImageShow(RPCBase):
|
|
1209
1108
|
class BECMotorMap(RPCBase):
|
1210
1109
|
@property
|
1211
1110
|
@rpc_call
|
1212
|
-
def
|
1111
|
+
def _rpc_id(self) -> "str":
|
1213
1112
|
"""
|
1214
1113
|
Get the RPC ID of the widget.
|
1215
1114
|
"""
|
1216
1115
|
|
1217
1116
|
@property
|
1218
1117
|
@rpc_call
|
1219
|
-
def
|
1118
|
+
def _config_dict(self) -> "dict":
|
1220
1119
|
"""
|
1221
1120
|
Get the configuration of the widget.
|
1222
1121
|
|
@@ -1307,7 +1206,7 @@ class BECMotorMap(RPCBase):
|
|
1307
1206
|
class BECPlotBase(RPCBase):
|
1308
1207
|
@property
|
1309
1208
|
@rpc_call
|
1310
|
-
def
|
1209
|
+
def _config_dict(self) -> "dict":
|
1311
1210
|
"""
|
1312
1211
|
Get the configuration of the widget.
|
1313
1212
|
|
@@ -1450,7 +1349,7 @@ class BECPlotBase(RPCBase):
|
|
1450
1349
|
class BECQueue(RPCBase):
|
1451
1350
|
@property
|
1452
1351
|
@rpc_call
|
1453
|
-
def
|
1352
|
+
def _config_dict(self) -> "dict":
|
1454
1353
|
"""
|
1455
1354
|
Get the configuration of the widget.
|
1456
1355
|
|
@@ -1459,7 +1358,7 @@ class BECQueue(RPCBase):
|
|
1459
1358
|
"""
|
1460
1359
|
|
1461
1360
|
@rpc_call
|
1462
|
-
def
|
1361
|
+
def _get_all_rpc(self) -> "dict":
|
1463
1362
|
"""
|
1464
1363
|
Get all registered RPC objects.
|
1465
1364
|
"""
|
@@ -1468,7 +1367,7 @@ class BECQueue(RPCBase):
|
|
1468
1367
|
class BECStatusBox(RPCBase):
|
1469
1368
|
@property
|
1470
1369
|
@rpc_call
|
1471
|
-
def
|
1370
|
+
def _config_dict(self) -> "dict":
|
1472
1371
|
"""
|
1473
1372
|
Get the configuration of the widget.
|
1474
1373
|
|
@@ -1477,7 +1376,7 @@ class BECStatusBox(RPCBase):
|
|
1477
1376
|
"""
|
1478
1377
|
|
1479
1378
|
@rpc_call
|
1480
|
-
def
|
1379
|
+
def _get_all_rpc(self) -> "dict":
|
1481
1380
|
"""
|
1482
1381
|
Get all registered RPC objects.
|
1483
1382
|
"""
|
@@ -1486,14 +1385,14 @@ class BECStatusBox(RPCBase):
|
|
1486
1385
|
class BECWaveform(RPCBase):
|
1487
1386
|
@property
|
1488
1387
|
@rpc_call
|
1489
|
-
def
|
1388
|
+
def _rpc_id(self) -> "str":
|
1490
1389
|
"""
|
1491
1390
|
Get the RPC ID of the widget.
|
1492
1391
|
"""
|
1493
1392
|
|
1494
1393
|
@property
|
1495
1394
|
@rpc_call
|
1496
|
-
def
|
1395
|
+
def _config_dict(self) -> "dict":
|
1497
1396
|
"""
|
1498
1397
|
Get the configuration of the widget.
|
1499
1398
|
|
@@ -1618,28 +1517,6 @@ class BECWaveform(RPCBase):
|
|
1618
1517
|
BECCurve: The curve object.
|
1619
1518
|
"""
|
1620
1519
|
|
1621
|
-
@rpc_call
|
1622
|
-
def get_curve_config(self, curve_id: "str", dict_output: "bool" = True) -> "CurveConfig | dict":
|
1623
|
-
"""
|
1624
|
-
Get the configuration of a curve by its ID.
|
1625
|
-
|
1626
|
-
Args:
|
1627
|
-
curve_id(str): ID of the curve.
|
1628
|
-
|
1629
|
-
Returns:
|
1630
|
-
CurveConfig|dict: Configuration of the curve.
|
1631
|
-
"""
|
1632
|
-
|
1633
|
-
@rpc_call
|
1634
|
-
def apply_config(self, config: "dict | SubplotConfig", replot_last_scan: "bool" = False):
|
1635
|
-
"""
|
1636
|
-
Apply the configuration to the 1D waveform widget.
|
1637
|
-
|
1638
|
-
Args:
|
1639
|
-
config(dict|SubplotConfig): Configuration settings.
|
1640
|
-
replot_last_scan(bool, optional): If True, replot the last scan. Defaults to False.
|
1641
|
-
"""
|
1642
|
-
|
1643
1520
|
@rpc_call
|
1644
1521
|
def get_all_data(self, output: "Literal['dict', 'pandas']" = "dict") -> "dict | pd.DataFrame":
|
1645
1522
|
"""
|
@@ -1787,7 +1664,7 @@ class BECWaveform(RPCBase):
|
|
1787
1664
|
class DeviceComboBox(RPCBase):
|
1788
1665
|
@property
|
1789
1666
|
@rpc_call
|
1790
|
-
def
|
1667
|
+
def _config_dict(self) -> "dict":
|
1791
1668
|
"""
|
1792
1669
|
Get the configuration of the widget.
|
1793
1670
|
|
@@ -1796,7 +1673,7 @@ class DeviceComboBox(RPCBase):
|
|
1796
1673
|
"""
|
1797
1674
|
|
1798
1675
|
@rpc_call
|
1799
|
-
def
|
1676
|
+
def _get_all_rpc(self) -> "dict":
|
1800
1677
|
"""
|
1801
1678
|
Get all registered RPC objects.
|
1802
1679
|
"""
|
@@ -1805,7 +1682,7 @@ class DeviceComboBox(RPCBase):
|
|
1805
1682
|
class DeviceInputBase(RPCBase):
|
1806
1683
|
@property
|
1807
1684
|
@rpc_call
|
1808
|
-
def
|
1685
|
+
def _config_dict(self) -> "dict":
|
1809
1686
|
"""
|
1810
1687
|
Get the configuration of the widget.
|
1811
1688
|
|
@@ -1814,7 +1691,7 @@ class DeviceInputBase(RPCBase):
|
|
1814
1691
|
"""
|
1815
1692
|
|
1816
1693
|
@rpc_call
|
1817
|
-
def
|
1694
|
+
def _get_all_rpc(self) -> "dict":
|
1818
1695
|
"""
|
1819
1696
|
Get all registered RPC objects.
|
1820
1697
|
"""
|
@@ -1823,7 +1700,7 @@ class DeviceInputBase(RPCBase):
|
|
1823
1700
|
class DeviceLineEdit(RPCBase):
|
1824
1701
|
@property
|
1825
1702
|
@rpc_call
|
1826
|
-
def
|
1703
|
+
def _config_dict(self) -> "dict":
|
1827
1704
|
"""
|
1828
1705
|
Get the configuration of the widget.
|
1829
1706
|
|
@@ -1832,7 +1709,7 @@ class DeviceLineEdit(RPCBase):
|
|
1832
1709
|
"""
|
1833
1710
|
|
1834
1711
|
@rpc_call
|
1835
|
-
def
|
1712
|
+
def _get_all_rpc(self) -> "dict":
|
1836
1713
|
"""
|
1837
1714
|
Get all registered RPC objects.
|
1838
1715
|
"""
|
@@ -1840,21 +1717,21 @@ class DeviceLineEdit(RPCBase):
|
|
1840
1717
|
|
1841
1718
|
class Ring(RPCBase):
|
1842
1719
|
@rpc_call
|
1843
|
-
def
|
1720
|
+
def _get_all_rpc(self) -> "dict":
|
1844
1721
|
"""
|
1845
1722
|
Get all registered RPC objects.
|
1846
1723
|
"""
|
1847
1724
|
|
1848
1725
|
@property
|
1849
1726
|
@rpc_call
|
1850
|
-
def
|
1727
|
+
def _rpc_id(self) -> "str":
|
1851
1728
|
"""
|
1852
1729
|
Get the RPC ID of the widget.
|
1853
1730
|
"""
|
1854
1731
|
|
1855
1732
|
@property
|
1856
1733
|
@rpc_call
|
1857
|
-
def
|
1734
|
+
def _config_dict(self) -> "dict":
|
1858
1735
|
"""
|
1859
1736
|
Get the configuration of the widget.
|
1860
1737
|
|
@@ -1940,21 +1817,21 @@ class Ring(RPCBase):
|
|
1940
1817
|
|
1941
1818
|
class RingProgressBar(RPCBase):
|
1942
1819
|
@rpc_call
|
1943
|
-
def
|
1820
|
+
def _get_all_rpc(self) -> "dict":
|
1944
1821
|
"""
|
1945
1822
|
Get all registered RPC objects.
|
1946
1823
|
"""
|
1947
1824
|
|
1948
1825
|
@property
|
1949
1826
|
@rpc_call
|
1950
|
-
def
|
1827
|
+
def _rpc_id(self) -> "str":
|
1951
1828
|
"""
|
1952
1829
|
Get the RPC ID of the widget.
|
1953
1830
|
"""
|
1954
1831
|
|
1955
1832
|
@property
|
1956
1833
|
@rpc_call
|
1957
|
-
def
|
1834
|
+
def _config_dict(self) -> "dict":
|
1958
1835
|
"""
|
1959
1836
|
Get the configuration of the widget.
|
1960
1837
|
|
@@ -2120,7 +1997,7 @@ class RingProgressBar(RPCBase):
|
|
2120
1997
|
class ScanControl(RPCBase):
|
2121
1998
|
@property
|
2122
1999
|
@rpc_call
|
2123
|
-
def
|
2000
|
+
def _config_dict(self) -> "dict":
|
2124
2001
|
"""
|
2125
2002
|
Get the configuration of the widget.
|
2126
2003
|
|
@@ -2129,7 +2006,7 @@ class ScanControl(RPCBase):
|
|
2129
2006
|
"""
|
2130
2007
|
|
2131
2008
|
@rpc_call
|
2132
|
-
def
|
2009
|
+
def _get_all_rpc(self) -> "dict":
|
2133
2010
|
"""
|
2134
2011
|
Get all registered RPC objects.
|
2135
2012
|
"""
|
@@ -2138,7 +2015,7 @@ class ScanControl(RPCBase):
|
|
2138
2015
|
class StopButton(RPCBase):
|
2139
2016
|
@property
|
2140
2017
|
@rpc_call
|
2141
|
-
def
|
2018
|
+
def _config_dict(self) -> "dict":
|
2142
2019
|
"""
|
2143
2020
|
Get the configuration of the widget.
|
2144
2021
|
|
@@ -2147,7 +2024,7 @@ class StopButton(RPCBase):
|
|
2147
2024
|
"""
|
2148
2025
|
|
2149
2026
|
@rpc_call
|
2150
|
-
def
|
2027
|
+
def _get_all_rpc(self) -> "dict":
|
2151
2028
|
"""
|
2152
2029
|
Get all registered RPC objects.
|
2153
2030
|
"""
|
@@ -40,12 +40,13 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
|
|
40
40
|
"w1": self.w1,
|
41
41
|
"w2": self.w2,
|
42
42
|
"w3": self.w3,
|
43
|
+
"w1_c": self.w1_c,
|
44
|
+
"w2_c": self.w2_c,
|
45
|
+
"w3_c": self.w3_c,
|
46
|
+
"w4": self.w4,
|
43
47
|
"d0": self.d0,
|
44
48
|
"d1": self.d1,
|
45
49
|
"d2": self.d2,
|
46
|
-
"fig0": self.fig0,
|
47
|
-
"fig1": self.fig1,
|
48
|
-
"fig2": self.fig2,
|
49
50
|
"plt": self.plt,
|
50
51
|
"bar": self.bar,
|
51
52
|
}
|
@@ -75,17 +76,37 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
|
|
75
76
|
self.figure.plot(x_name="samx", y_name="samy", z_name="bpm4i", color_map_z="cividis")
|
76
77
|
self.figure.motor_map("samx", "samy")
|
77
78
|
self.figure.image("eiger", color_map="viridis", vrange=(0, 100))
|
78
|
-
self.figure.
|
79
|
+
self.figure.plot(
|
80
|
+
x_name="samx", y_name="samy", z_name="bpm4i", color_map_z="magma", new=True
|
81
|
+
)
|
79
82
|
|
80
83
|
self.figure.change_layout(2, 2)
|
81
84
|
|
82
85
|
self.w1 = self.figure[0, 0]
|
83
86
|
self.w2 = self.figure[0, 1]
|
84
87
|
self.w3 = self.figure[1, 0]
|
88
|
+
self.w4 = self.figure[1, 1]
|
89
|
+
|
90
|
+
# Plot Customisation
|
91
|
+
self.w1.set_title("Waveform 1")
|
92
|
+
self.w1.set_x_label("Motor Position (samx)")
|
93
|
+
self.w1.set_y_label("Intensity A.U.")
|
94
|
+
|
95
|
+
# Image Customisation
|
96
|
+
self.w3.set_title("Eiger Image")
|
97
|
+
self.w3.set_x_label("X")
|
98
|
+
self.w3.set_y_label("Y")
|
99
|
+
|
100
|
+
# Configs to try to pass
|
101
|
+
self.w1_c = self.w1._config_dict
|
102
|
+
self.w2_c = self.w2._config_dict
|
103
|
+
self.w3_c = self.w3._config_dict
|
85
104
|
|
86
105
|
# curves for w1
|
87
106
|
self.c1 = self.w1.get_config()
|
88
107
|
|
108
|
+
self.fig_c = self.figure._config_dict
|
109
|
+
|
89
110
|
def _init_dock(self):
|
90
111
|
|
91
112
|
self.d0 = self.dock.add_dock(name="dock_0")
|