lynx.blocks.GainBlock¶
- class lynx.blocks.GainBlock[source]¶
Bases:
BlockGain block with scalar multiplier K.
Implements: y(t) = K * u(t)
- K¶
Scalar gain value
Methods
__init__(id, K[, position, label, custom_latex])Initialize Gain block.
add_parameter(name, value[, expression])Add a parameter to the block.
add_port(port_id, port_type[, label])Add a port to the block.
get_parameter(name)Get parameter value by name.
get_ports()Get all ports as dictionaries.
is_input_marker()Check if this is an input marker block.
is_output_marker()Check if this is an output marker block.
set_parameter(param_name, value)Update block parameter and sync to parent diagram.
to_dict()Serialize block to dictionary for JSON export.
- __init__(id: str, K: float, position: Dict[str, float] | None = None, label: str | None = None, custom_latex: str | None = None) None[source]¶
Initialize Gain block.
- Parameters:
id – Unique block identifier
K – Scalar gain value (required)
position – Optional canvas position
label – Optional user-facing label (defaults to id)
custom_latex – Optional custom LaTeX override for block rendering