pub enum Signal {
Block(String),
BlockPrev(String),
}Expand description
Where a block’s input value comes from: another block’s output this same step, or that (or
any) block’s own output from the previous step. There is deliberately no variant that
reads a circuit quantity (V(node)/I(branch)) directly — that crossing from the physical
domain into the signal domain must go through an explicit, named BlockKind::Phys2Sig block
instead (referenced afterward like any other block, via Signal::Block). See
BlockKind::Phys2Sig’s own doc comment for why this boundary is enforced rather than
implicit, the same way a real block-diagram tool requires an explicit physical/signal
converter block between a physical port and a signal port instead of wiring them together
directly.
Variants§
Block(String)
Another block’s output this step — may name any block in the same slice, declared
before or after this one: topological_order derives each step’s actual evaluation
order from the full Signal::Block dependency graph, not declaration position, so
“before/after” in the source text no longer has to match causal order (see that
function). A genuine same-step cycle among these edges (A depends on B depends on
A, however indirectly, including a block naming itself) is a model error reported as
DaeError::AlgebraicLoop before any step is solved — see BlockInstance’s own doc
comment.
BlockPrev(String)
A named block’s own output from the previous step (0.0 before the first step,
matching every dynamic block’s own “starts at rest” convention). Unlike Signal::Block,
this is not a same-step dependency at all — it reads state fixed before this step even
starts — so it never contributes an edge to the dependency graph topological_order
(in dae-runtime) builds, and is consequently the sanctioned way to close what would otherwise be a
same-step cycle (e.g. a current controller regulating a BlockKind::Pmsm’s own
id/iq outputs, or a PLL’s angle estimate feeding the very
BlockKind::CoordinateTransform Park block that produced its own error signal): the
one-sample delay every real digital controller reading its own last output already has.