Documentation Home Page OPAL-RT Dashboard Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


class opalone._internal.widgets.Widget(widget_id, panel_id)

Bases: BlockBase

A widget is a component of a panel that is used to control values in the simulation and display values from it.

A widget has a given number of Parameters.

A widget also has input and output Signals. However, contrary to Blocks, widgets have no Ports because they cannot link to one another within the same panel like regular blocks in a model.

Parameters:
  • widget_id (str) – the ID of the widget.

  • panel_id (str) – the ID of the panel that owns this widget.

delete()

Delete the current resource, which is done by suppressing its ID.

to_json(fields, values)

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

property angle: float

The angle of the block.

The value is between 0 and 360 degrees.

property comment_state: str

The comment state of the block.

The default value is NONE.

If COMMENT_OUT, the block is not considered by the simulation.

If COMMENT_THROUGH, the block is considered as a link between its input ports and output ports.

property datapoints: dict[str, Datapoint]

The datapoints of the block, in the form of a mapping name = datapoint. Datapoint names are unique within a given block.

Datapoints are a concatenation of parameters and signals, and could include other elements in the future.

This property is read-only, it cannot be modified. However, each datapoint might have alterable properties.

property description: str

The description of the block.

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

property dimensions: str

Dimensions (width and height) of the block.

The format of the location is x y where x and y are integer values (no decimal).

property flip_state: str

The flip state of the block.

The default value is NONE.

If HORIZONTAL, the block is flipped horizontally (the flip axis is vertical).

If VERTICAL, the block is flipped vertically (the flip axis is horizontal).

If BOTH, both axes are used.

property id: str

The ID of the resource.

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

property is_label_visible: bool

Indicates if this block’s label is visible (True) or not (False).

property is_locked: bool

Indicates if this block can be moved in the diagram and if it can be resized. (True) or not (False).

property location: str

The location of the block within a diagram.

The format of the location is (x,y) where x and y are integer values (no decimal).

property name: str

The name of the block. Block names must be unique within a Subsystem. A widget name must be unique within a Panel.

property parameters: dict[any, Datapoint]

The parameters of the widget, in the form of a mapping name = parameter. Parameter names are unique within a given widget.

This property is read-only, it cannot be modified. However, each parameter might have alterable properties.

property ref_id: str

The reference ID of the block.

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

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

property signals

The signals of the widget, in the form of a mapping name = signal. Signal names are unique within a given widget.

This property is read-only, it cannot be modified. However, each signal might have alterable properties.

property type: BlockType

The type of the block.

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

  • No labels