Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal
opalone._internal.widget_signals.WidgetSignal
class opalone._internal.widget_signals.WidgetSignal(signal_id, panel_id, project_id, signal_type=None, data_type=None, path=None)
Panel
bgColorunset

Bases: Signal

A widget signal is a signal that is owned by a Widget.

Parameters:
  • signal_id (str) – The ID of the signal.

  • panel_id (str) – The ID of the Panel that contains the widget that owns this signal.

  • project_id (str) – The ID of the Project that owns the signal.

  • signal_type (str | DatapointType) – The type of signal.

  • data_type (Data) – A data value holder.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.connect_to
opalone._internal.widget_signals.WidgetSignal.connect_to
connect_to(datapoint, is_enabled=True, force_enable=False)
Panel
bgColorunset

Connect the current datapoint to another datapoint.

If the connection to create is enabled, i.e. is_enabled=True, and any datapoint in this new connection is actively connected to another datapoint, then some connection rules will apply and the new connection might be declared invalid. If force_enable=True, conflicting connections will be disabled in favor of the new connection.

Some data types are incompatibles between one another, so that might result in an invalid connection. For example, a STRING data type cannot connect to a NUMERIC data type.

If the backend reports the connection to be invalid, this method will attempt to connect the other way around. For example, if A.connect_to(B) fails on the backend, this method will attempt the equivalent of B.connect_to(A). If this connection also fails, the first failure will be reported to the user.

Parameters:
  • datapoint (str | Datapoint) – The datapoint to connect to, either an ID or a datapoint object..

  • is_enabled (bool) – A flag to enable (True) or disable (False) the connection to create.

  • force_enable (bool) – A flag to drop (True) or not (False) any conflicting connections that already exist in the system.

Returns:

A new connection instance

Return type:
Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.delete
opalone._internal.widget_signals.WidgetSignal.delete
delete()
Panel
bgColorunset

Delete the signal.

This function does nothing for now, since a signal deletion is not supported. To delete a signal, the user must delete the Block or Widget owning this signal.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.to_json
opalone._internal.widget_signals.WidgetSignal.to_json
to_json(fields, values)
Panel
bgColorunset

Convert this resource to a serialized JSON representation.

Parameters:
  • fields (tuple[str] | list[str]) – Fields to include.

  • values (tuple[object] | list[object]) – The value of each field

Returns:

The serialized JSON representation.

Return type:

str

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.alias
opalone._internal.widget_signals.WidgetSignal.alias
property alias: str
Panel
bgColorunset

Get the alias of the datapoint.

This property returns an AliasWrapper, which behaves like a string but also provides additional methods like generate(). If the alias is not set, it initializes with an empty AliasWrapper.

Returns:

The alias of the datapoint.

Return type:

AliasWrapper | None

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.connections
opalone._internal.widget_signals.WidgetSignal.connections
property connections: tuple[Connection]
Panel
bgColorunset

The connections going to this datapoint.

A connection allows describing a transfer of data between two datapoints.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.data_type
opalone._internal.widget_signals.WidgetSignal.data_type
property data_type: DataType
Panel
bgColorunset

The data type of the datapoint.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.default_value
opalone._internal.widget_signals.WidgetSignal.default_value
property default_value: bool | str | float | dict
Panel
bgColorunset

The default value of this datapoint.

The default value’s type is determined at runtime and depends on the Data type of the datapoint.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.id
opalone._internal.widget_signals.WidgetSignal.id
property id: str
Panel
bgColorunset

The ID of the resource.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.is_displayed_on_canvas
opalone._internal.widget_signals.WidgetSignal.is_displayed_on_canvas
property is_displayed_on_canvas: bool
Panel
bgColorunset

Indicates if this datapoint is displayed on canvas (True) or not (False). If True, the datapoint and its value are displayed on the UI next to the block.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.is_favorite
opalone._internal.widget_signals.WidgetSignal.is_favorite
property is_favorite: bool
Panel
bgColorunset

Indicates if this datapoint is a favorite (True) or not (False). If True, the datapoint is displayed in the favorite section in the UI.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.is_model_port
opalone._internal.widget_signals.WidgetSignal.is_model_port
property is_model_port: bool
Panel
bgColorunset

Indicates that the datapoint is exposed on the root view of the model to be linked to other models (True) or not (False).

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.is_visible
opalone._internal.widget_signals.WidgetSignal.is_visible
property is_visible: bool
Panel
bgColorunset

Indicates if this datapoint is visible (True) or not (False).

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.name
opalone._internal.widget_signals.WidgetSignal.name
property name: str
Panel
bgColorunset

The name of the datapoint.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.path
opalone._internal.widget_signals.WidgetSignal.path
property path: str
Panel
bgColorunset

Path of a Datapoint in the model, seperated with “/”

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.port_ref_id
opalone._internal.widget_signals.WidgetSignal.port_ref_id
property port_ref_id: str
Panel
bgColorunset

The reference ID of the Port on which this signal is attached.

This ID is only useful to lookup the port’s library data.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.ref_id
opalone._internal.widget_signals.WidgetSignal.ref_id
property ref_id: str
Panel
bgColorunset

The reference ID of the datapoint.

This ID is only useful to lookup the datapoint’s library data.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.size
opalone._internal.widget_signals.WidgetSignal.size
property size: tuple[int]
Panel
bgColorunset

Array of values describing the size of multidimensional datapoints. Equals to (1) for scalars, (1, N) for row vectors, (M, 1) for column vectors, (M, N) for matrices and (D1, D2…, Dn) more generally.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.type
opalone._internal.widget_signals.WidgetSignal.type
property type: DatapointType
Panel
bgColorunset

The type of the datapoint.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.unit
opalone._internal.widget_signals.WidgetSignal.unit
property unit: str
Panel
bgColorunset

The units of the datapoint.

Example units: Volts, Amperes, seconds, etc.

This property is read-only, it cannot be modified.

Panel
bgColorunset
Anchor
opalone._internal.widget_signals.WidgetSignal.value
opalone._internal.widget_signals.WidgetSignal.value
property value: bool | str | float
Panel
bgColorunset

The current value for this signal.

NOT IMPLEMENTED YET

The value’s type is determined at runtime and depends on the Data type of the signal.