symbol module#
Schematic Symbols#
This module provides classes for defining schematic symbols, pins, and symbol mappings for components. You attach a symbol to a component by assigning it to a member field. The name of the field is not important, and multiple symbols can be attached to the same component to provide multiple symbol units.
- class Symbol[source]#
Bases:
StructuralSymbols are a structural element in JITX encoding the schematic representation of a part. Symbols often contain electrical connection points represented by
Pin, geometric artwork, andTextannotations. Symbols are linked to a design through aComponentwhere a symbol’sPinobjects are mapped toPortobjects.- Valid elements in a symbol are:
If a symbol is defined inside another symbol, they will be treated together as one symbol in the design.
For a rectangular symbol with automatic or configurable pin layout, use
BoxSymbol.>>> class MySymbol(Symbol): ... a = Pin(at=(1, 0), length=1, direction=Direction.Right) ... b = Pin(at=(-1, 0), length=1, direction=Direction.Left) ... pin_name_size = 0.3 ... pad_name_size = 0.3 ... orientation = SymbolOrientation(0) ... rect = rectangle(2, 2)
>>> class MyComponent(Component): ... ports = [Port() for _ in range(2)] ... symbol = BoxSymbol()
- pin_name_size: float | None = None#
Font size of pin name text of
Pinobjects in this symbol, in grid units. If unset, defers to a parentSymbol, if a parent exists. This can be overriden at thePinlevel by setting itspin_name_sizeattribute.
- pad_name_size: float | None = None#
Font size of pad name text of
Pinobjects in this symbol, in grid units. If unset, defers to a parentSymbol, if a parent exists. This can be overriden at thePinlevel by setting itspad_name_sizeattribute.
- class Direction(*values)[source]#
Bases:
EnumPin direction on schematic symbols.
- Left = 'left'#
- Right = 'right'#
- Up = 'up'#
- Down = 'down'#
- class Pin(at, length=0, direction=Direction.Left, pin_name_size=None, pad_name_size=None)[source]#
Bases:
StructuralSchematic symbol pin definition.
- Parameters:
- at: GridPoint#
The position of the pin in grid units.
- length: int = 0#
The length of the pin in grid units.
- direction: Direction = 'left'#
The direction of the pin.
- pin_name_size: float | None = None#
Font size of the pin’s pin name text in grid units, overriding the parent
Symbol’spin_name_sizeattribute.
- pad_name_size: float | None = None#
Font size of the pin’s pad name text in grid units, overriding the parent
Symbol’spad_name_sizeattribute.
- class SymbolMapping(entries)[source]#
Bases:
Structural,RefMapping between component ports and schematic symbol pins.
If no symbol mapping is provided, a default mapping will be created that maps ports to symbol pins in declaration order.
>>> class MyComponent(Component): ... GND = Power() ... VIN = Power() ... VOUT = Power() ... ... symbol = MySymbol() ... mappings = SymbolMapping({ ... GND: symbol.gnd, ... VIN: symbol.vin, ... VOUT: symbol.vout, ... })