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