mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
refactor(rpc/client): changed path to client.py to relative one
This commit is contained in:
@ -1,146 +1,85 @@
|
||||
# This file was automatically generated by generate_cli.py
|
||||
|
||||
from bec_widgets.cli.client_utils import rpc_call, RPCBase, BECFigureClientMixin
|
||||
from typing import Literal, Optional, overload
|
||||
|
||||
from bec_widgets.cli.client_utils import BECFigureClientMixin, RPCBase, rpc_call
|
||||
|
||||
|
||||
class BECWaveform1D(RPCBase):
|
||||
@rpc_call
|
||||
def set_x_label(self, label: "str"):
|
||||
"""
|
||||
Set the label of the x-axis.
|
||||
Args:
|
||||
label(str): Label of the x-axis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_y_label(self, label: "str"):
|
||||
"""
|
||||
Set the label of the y-axis.
|
||||
Args:
|
||||
label(str): Label of the y-axis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
||||
"""
|
||||
Set the scale of the x-axis.
|
||||
Args:
|
||||
scale(Literal["linear", "log"]): Scale of the x-axis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
|
||||
"""
|
||||
Set the scale of the y-axis.
|
||||
Args:
|
||||
scale(Literal["linear", "log"]): Scale of the y-axis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_x_lim(self, x_lim: "tuple") -> "None":
|
||||
"""
|
||||
Set the limits of the x-axis.
|
||||
Args:
|
||||
x_lim(tuple): Limits of the x-axis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_y_lim(self, y_lim: "tuple") -> "None":
|
||||
"""
|
||||
Set the limits of the y-axis.
|
||||
Args:
|
||||
y_lim(tuple): Limits of the y-axis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_grid(self, x: "bool" = False, y: "bool" = False):
|
||||
"""
|
||||
Set the grid of the plot widget.
|
||||
Args:
|
||||
x(bool): Show grid on the x-axis.
|
||||
y(bool): Show grid on the y-axis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def plot_data(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
|
||||
"""
|
||||
Plot custom data on the plot widget. These data are not saved in config.
|
||||
Args:
|
||||
data_x(list|np.ndarray): x-axis data
|
||||
data_y(list|np.ndarray): y-axis data
|
||||
**kwargs: Keyword arguments for the plot.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def remove(self):
|
||||
"""
|
||||
Remove the plot widget from the figure.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def add_scan(
|
||||
self,
|
||||
x_name: str,
|
||||
x_entry: str,
|
||||
y_name: str,
|
||||
y_entry: str,
|
||||
color: Optional[str] = None,
|
||||
label: Optional[str] = None,
|
||||
symbol: Optional[str] = None,
|
||||
symbol_size: Optional[int] = None,
|
||||
symbol_color: Optional[str] = None,
|
||||
pen_width: Optional[int] = None,
|
||||
pen_style: Optional[Literal["solid", "dash", "dot", "dashdot"]] = None,
|
||||
x_name: "str",
|
||||
x_entry: "str",
|
||||
y_name: "str",
|
||||
y_entry: "str",
|
||||
color: "Optional[str]" = None,
|
||||
label: "Optional[str]" = None,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
None
|
||||
"""
|
||||
|
||||
|
||||
class BECFigure(RPCBase, BECFigureClientMixin):
|
||||
@overload
|
||||
def add_widget(
|
||||
@rpc_call
|
||||
def add_curve(
|
||||
self,
|
||||
widget_type: "Literal['Waveform1D']" = "Waveform1D",
|
||||
widget_id: "str" = Ellipsis,
|
||||
row: "int" = Ellipsis,
|
||||
col: "int" = Ellipsis,
|
||||
config: "dict" = Ellipsis,
|
||||
**axis_kwargs
|
||||
) -> "BECWaveform1D": ...
|
||||
|
||||
@overload
|
||||
def add_widget(
|
||||
self,
|
||||
widget_type: "Literal['PlotBase']" = "PlotBase",
|
||||
widget_id: "str" = Ellipsis,
|
||||
row: "int" = Ellipsis,
|
||||
col: "int" = Ellipsis,
|
||||
config: "dict" = Ellipsis,
|
||||
**axis_kwargs
|
||||
) -> "BECPlotBase": ...
|
||||
x: "list | np.ndarray",
|
||||
y: "list | np.ndarray",
|
||||
label: "str" = None,
|
||||
color: "str" = None,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
None
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def add_widget(
|
||||
def remove_curve(self, *identifiers):
|
||||
"""
|
||||
Remove a curve from the plot widget.
|
||||
Args:
|
||||
*identifiers: Identifier of the curve to be removed. Can be either an integer (index) or a string (curve_id).
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def update_scan_curve_history(self, scanID: "str" = None, scan_index: "int" = None):
|
||||
"""
|
||||
Update the scan curves with the data from the scan storage.
|
||||
Provide only one of scanID or scan_index.
|
||||
Args:
|
||||
scanID(str, optional): ScanID of the scan to be updated. Defaults to None.
|
||||
scan_index(int, optional): Index of the scan to be updated. Defaults to None.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def curves(self) -> "list":
|
||||
"""
|
||||
Get the curves of the plot widget as a list
|
||||
Returns:
|
||||
list: List of curves.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def curves_data(self) -> "dict":
|
||||
"""
|
||||
Get the curves data of the plot widget as a dictionary
|
||||
Returns:
|
||||
dict: Dictionary of curves data.
|
||||
"""
|
||||
|
||||
|
||||
class BECFigure(RPCBase, BECFigureClientMixin):
|
||||
@rpc_call
|
||||
def add_plot(
|
||||
self,
|
||||
widget_type: "Literal['PlotBase', 'Waveform1D']" = "PlotBase",
|
||||
widget_id: "str" = None,
|
||||
row: "int" = None,
|
||||
col: "int" = None,
|
||||
config: "dict" = None,
|
||||
config=None,
|
||||
**axis_kwargs
|
||||
) -> "BECPlotBase":
|
||||
) -> "BECWaveform1D":
|
||||
"""
|
||||
Add a widget to the figure at the specified position.
|
||||
Args:
|
||||
widget_type(Literal["PlotBase","Waveform1D"]): The type of the widget to add.
|
||||
widget_id(str): The unique identifier of the widget. If not provided, a unique ID will be generated.
|
||||
row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
|
||||
col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
|
||||
config(dict): Additional configuration for the widget.
|
||||
**axis_kwargs(dict): Additional axis properties to set on the widget after creation.
|
||||
None
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
|
Reference in New Issue
Block a user