Scope

class gpype.frontend.widgets.base.scope.Scope(input_ports=None, update_rule=None, line_color=None, axis_color=None, name='Scope', **kwargs)[source]

Bases: INode, Widget

Base class for oscilloscope-style visualization widgets.

Combines INode data processing with Widget visualization for real-time plotting of BCI signals. Uses PyQtGraph for high-performance plotting with configurable appearance and multiple curve support.

Parameters:
  • input_ports (list[IPort.Configuration], optional) – Input port configurations for data connections.

  • update_rule (INode.UpdateRule, optional) – Update rule for the node.

  • line_color (tuple[int, int, int], optional) – RGB color for plot lines. Defaults to system text color.

  • axis_color (tuple[int, int, int], optional) – RGB color for plot background. Defaults to system window color.

  • name (str) – Name for the widget group box. Defaults to “Scope”.

  • **kwargs – Additional arguments passed to parent classes.

Note

Subclasses must implement the _update() method.

class Configuration(input_ports=None, **kwargs)[source]

Bases: Configuration

Configuration class for Scope parameters.

Parameters:

input_ports (list)

class Keys[source]

Bases: Keys

Configuration key constants for the Scope.

LINE_COLOR = 'line_color'
AXIS_COLOR = 'axis_color'
__init__(input_ports=None, update_rule=None, line_color=None, axis_color=None, name='Scope', **kwargs)[source]

Initialize the Scope widget with plot setup and color configuration.

Parameters:
  • input_ports (list[IPort.Configuration], optional) – Input port configurations for pipeline connections.

  • update_rule (INode.UpdateRule, optional) – Node update rule.

  • line_color (tuple[int, int, int], optional) – RGB values for plot line color. Uses system text color if None.

  • axis_color (tuple[int, int, int], optional) – RGB values for plot background color. Uses system window color if None.

  • name (str) – Widget group box title.

  • **kwargs – Additional configuration passed to parent classes.

set_labels(x_label, y_label)[source]

Set axis labels for the plot.

Parameters:
  • x_label (str) – Label text for the x-axis (horizontal).

  • y_label (str) – Label text for the y-axis (vertical).

add_curve(pen=None)[source]

Add a new plot curve for displaying data.

Parameters:

pen – PyQtGraph pen object for curve styling. Uses default pen if None.

Returns:

The newly created curve item for data updates.

Return type:

pg.PlotCurveItem

setup(data, port_context_in)[source]

Set up the scope widget and make the plot visible.

Parameters:
  • data (dict) – Initial data dictionary for setup.

  • port_context_in (dict) – Input port context information.

Returns:

Output port context from parent setup.

Return type:

dict