bec_widgets.widgets.plots.waveform.curve#

Classes#

Curve

Connection mixin class to handle BEC client and device manager

CurveConfig

Configuration for BECConnector mixin class

DeviceSignal

The configuration of a signal in the 1D waveform widget.

Module Contents#

class Curve(name: str | None = None, config: CurveConfig | None = None, gui_id: str | None = None, parent_item: bec_widgets.widgets.plots.waveform.waveform.Waveform | None = None, **kwargs)#

Bases: bec_widgets.utils.BECConnector, pyqtgraph.PlotDataItem

Connection mixin class to handle BEC client and device manager

BECConnector mixin class to handle BEC client and device manager.

Parameters:
  • client (BECClient, optional) – The BEC client.

  • config (ConnectionConfig, optional) – The connection configuration with specific gui id.

  • gui_id (str, optional) – The GUI ID.

  • object_name (str, optional) – The object name.

  • root_widget (bool, optional) – If set to True, the parent_id will be always set to None, thus enforcing that the widget is accessible as a root widget of the BECGuiClient object.

  • rpc_exposed (bool, optional) – If set to False, this instance is excluded from RPC registry broadcast and CLI namespace discovery.

  • rpc_passthrough_children (bool, optional) – Only relevant when rpc_exposed=False. If True, RPC-visible children rebind to the next visible ancestor. If False (default), children stay hidden behind this widget.

  • **kwargs

_get_displayed_data() tuple[numpy.ndarray, numpy.ndarray]#

Get the displayed data of the curve.

Returns:

The x and y data of the curve.

Return type:

tuple[np.ndarray, np.ndarray]

apply_config(config: dict | CurveConfig | None = None, **kwargs) None#

Apply the configuration to the curve.

Parameters:

config (dict|CurveConfig, optional) – The configuration to apply.

clear_data()#

Clear the data of the curve.

get_data() tuple[numpy.ndarray | None, numpy.ndarray | None]#

Get the data of the curve. :returns: X and Y data of the curve. :rtype: tuple[np.ndarray,np.ndarray]

parent()#
remove()#

Remove the curve from the plot.

set(**kwargs)#

Set the properties of the curve.

Parameters:

**kwargs – Keyword arguments for the properties to be set.

Possible properties:
  • color: str

  • symbol: str

  • symbol_color: str

  • symbol_size: int

  • pen_width: int

  • pen_style: Literal[“solid”, “dash”, “dot”, “dashdot”]

set_color(color: str, symbol_color: str | None = None)#

Change the color of the curve.

Parameters:
  • color (str) – Color of the curve.

  • symbol_color (str, optional) – Color of the symbol. Defaults to None.

set_color_map_z(colormap: str)#

Set the colormap for the scatter plot z gradient.

Parameters:

colormap (str) – Colormap for the scatter plot.

set_data(x: list | numpy.ndarray, y: list | numpy.ndarray)#

Set the data of the curve.

Parameters:
  • x (list|np.ndarray) – The x data.

  • y (list|np.ndarray) – The y data.

Raises:

ValueError – If the source is not custom.

set_pen_style(pen_style: Literal['solid', 'dash', 'dot', 'dashdot'])#

Change the pen style of the curve.

Parameters:

pen_style (Literal["solid", "dash", "dot", "dashdot"]) – Style of the pen.

set_pen_width(pen_width: int)#

Change the pen width of the curve.

Parameters:

pen_width (int) – Width of the pen.

set_symbol(symbol: str)#

Change the symbol of the curve.

Parameters:

symbol (str) – Symbol of the curve.

set_symbol_color(symbol_color: str)#

Change the symbol color of the curve.

Parameters:

symbol_color (str) – Color of the symbol.

set_symbol_size(symbol_size: int)#

Change the symbol size of the curve.

Parameters:

symbol_size (int) – Size of the symbol.

USER_ACCESS = ['remove', '_rpc_id', '_config_dict', '_get_displayed_data', 'set', 'set_data', 'set_color',...#
property dap_oversample#

Get the dap oversample.

property dap_params#

Get the dap parameters.

property dap_summary#

Get the dap summary.

parent_item = None#
slice_index = None#
class CurveConfig(/, **data: Any)#

Bases: bec_widgets.utils.ConnectionConfig

Configuration for BECConnector mixin class

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

color: str | tuple | None = None#
current_x_mode: str | None = None#
label: str | None = None#
model_config: dict#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parent_id: str | None = None#
parent_label: str | None = None#
pen_style: Literal['solid', 'dash', 'dot', 'dashdot'] | None = None#
pen_width: int | None = None#
scan_id: str | None = None#
scan_number: int | None = None#
signal: DeviceSignal | None = None#
source: Literal['device', 'dap', 'custom', 'history'] = None#
symbol: str | None = None#
symbol_color: str | tuple | None = None#
symbol_size: int | None = None#
class DeviceSignal(/, **data: Any)#

Bases: pydantic.BaseModel

The configuration of a signal in the 1D waveform widget.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

dap: str | list[str] | None = None#
dap_oversample: int = 1#
dap_parameters: dict | list | None = None#
device: str#
model_config: dict#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

signal: str#