pySimBlocks.gui.models.block_instance

class pySimBlocks.gui.models.block_instance.BlockInstance(meta: BlockMeta)[source]

Bases: object

Represent a mutable GUI-side instance of a block.

uid

Unique identifier for this instance.

meta

Immutable block metadata definition.

name

Editable block instance name.

parameters

Current parameter values for the instance.

ports

Resolved input and output ports for the instance.

classmethod copy(block: Self) Self[source]

Create a shallow copy of a block instance.

Parameters:

block – Block instance to copy.

Returns:

Copied block instance with duplicated parameters.

update_params(params: dict[str, Any])[source]

Update existing parameter values from a mapping.

Parameters:

params – Parameter values keyed by parameter name.

resolve_ports() None[source]

Rebuild ports while preserving existing instances when possible.

active_parameters() dict[str, Any][source]

Return only the parameters active under the current configuration.

Returns:

Active parameters keyed by parameter name.