pub struct ElementOverlay {
pub refdes: String,
pub shapes: Range<usize>,
pub pins: Vec<PinOverlay>,
pub value: Option<ValueSpanOverlay>,
pub params: Vec<ParamSpanOverlay>,
pub principal: Option<String>,
}Expand description
One element’s shapes in the compiled drawing (ids sN of the SVG).
Fields§
§refdes: String§shapes: Range<usize>Half-open range of shape indices of the element’s block.
pins: Vec<PinOverlay>The element’s terminals, in card order (the nodes of its card);
empty for a K, which has none.
value: Option<ValueSpanOverlay>Where the element’s value/model argument is in the user’s source — the text an editor replaces to write a new value back (issue #17).
Some only when the card’s value is that argument of a call to
one of the prelude’s own element macros (R1: resistor(A, B, 1k)), written in the user’s figure. None when there is none
to point at: an element without a value argument (vsource(A, B)), a K (coupling(L1, L2, k) spreads its card over three
arguments), an inline block, and every element whose outermost
call is a user wrapper macro — the value then comes from the
drawn fallback or from a wrapper argument, and neither is a span
an edit can be trusted to land in. A display text (the argument
after the value) never changes this: the span stays the value’s.
params: Vec<ParamSpanOverlay>The alterable parameters spelled inside Self::value, in
source order, named as alter(refdes, param, …) names them
(dune_core::Circuit::alter): for V/I sources dc,
acmag, acphase (each the span of its number only: AC 1 90
gives acmag = 1 and acphase = 90) and the transient
functions pulse, sin, exp, pwl, sffm, trnoise,
trrandom (each the whole spelling, keyword and parentheses
included: PULSE(0 5 0 1u 1u 10m 20m)); for R/C/L/E/G
the principal value (the leading number) and ic (IC=…,
C/L); gain of an F/H (Vname gain); area (the
number after the model, or AREA=) and temp (TEMP=) of a
D/Q/J; area of a Z; w, l, temp (W=…) of an M. Only what is
spelled is listed (a source with no DC field has no dc
entry), and a parameter spelled twice is listed once, at its
last spelling (the one SPICE keeps). Empty when
Self::value is None.
principal: Option<String>The parameter alter(refdes, value) (empty parameter name)
changes for this element’s letter: resistance, capacitance,
inductance, dc (V/I), gain (E/F/G/H), area
(D/Q/J/Z); None for letters alter has no principal for
(M, S, W, X, T, O, K). Independent of
Self::value.