jsl/symbols/box-symbol¶
Package name: jsl/symbols/box-symbol
Summary¶
Data Types¶
BoxSymbolParams¶
Parameters for Box Symbol Glyph Construction
Constructors¶
Function | Description |
---|---|
BoxSymbolParams (+ 1) | Constructor for defstruct BoxSymbolParams |
Functions¶
Function | Description |
---|---|
set-default-box-symbol-params | |
BoxSymbol | |
get-default-box-symbol-params |
BoxSymbol¶
Functions¶
Function | Description |
---|---|
set-head-margin | |
set-tail-margin | |
get-rows (+ 1) | Get the total number of rows in the pin grid. |
set-grid (+ 1) | Set the grid for a component |
BoxSymbol | |
has-grid? | Check for an active grid |
pins-in-group | |
get-columns (+ 1) | Get the total number of columns in the pin grid. |
create-symbol | |
find-pins-by-regex | Find a set of pins that match a particular query |
add-decorator (+ 1) | Add a particular decorator[s] to the passed pins. |
UnitSymbol¶
General Definitions¶
Function | Description |
---|---|
set-head-margin (+ 1) | |
set-tail-margin (+ 1) | |
set-column (+ 1) | Set the Column assignment for these pins |
set-side (+ 1) | Set the side of the box symbol to assign to a pin or set of pins |
set-group (+ 1) | |
set-bank (+ 1) | |
set-alignment (+ 1) | |
set-grid-edge | Set the pin grid position for a pin or set of pins. |
assign-symbols (+ 1) | |
reset-default-box-symbol-params | |
set-row (+ 1) | Set the Row assignment for these pins |
Definitions¶
BoxSymbolParams¶
Parameters for Box Symbol Glyph Construction
public defstruct BoxSymbolParams <: SymbolParams :
line-width: Double
min-col-width: Int
min-row-width: Int
pad-ref-size: Double
pin-length: Double
pin-name-size: Double
pin-pitch: Double
show-grid: True|False
-
line-width: Double
-
min-col-width: Int
-
min-row-width: Int
-
pad-ref-size: Double
- Font size for pad names that appear on the symbol. -
pin-length: Double
-
pin-name-size: Double
- Font size for pin names that appear on the symbol. -
pin-pitch: Double
- Spacing between input pins. This value is in symbol grid units. The best values are whole numbers or half-numbers (0.5, 1.5, etc). -
show-grid: True|False
- Show row/col grid lines for debugging.
This type contains various parmaeters that we may want to apply to all box symbols. We provide default values for a sane consistent default look.
Constructors¶
BoxSymbolParams¶
Constructor for defstruct BoxSymbolParams
public defn BoxSymbolParams (min-col-width:Int, min-row-width:Int = ?, line-width:Double = ?, pin-length:Double = ?, pad-ref-size:Double = ?, pin-pitch:Double = ?, pin-name-size:Double = ?, show-grid:True|False = ?, label-params?:Maybe<SymbolLabelParams> = ?)
BoxSymbolParams¶
Constructor for defstruct BoxSymbolParams
public defn BoxSymbolParams ( -- min-col-width:Int = ?, min-row-width:Int = ?, line-width:Double = ?, pin-length:Double = ?, pad-ref-size:Double = ?, pin-pitch:Double = ?, pin-name-size:Double = ?, show-grid:True|False = ?, label-params?:Maybe<SymbolLabelParams> = ?)
Functions¶
set-default-box-symbol-params¶
public defn set-default-box-symbol-params (v:BoxSymbolParams) -> False
- Returns
False
BoxSymbol¶
public defn BoxSymbol (obj:Instantiable|Self -- params:BoxSymbolParams = ?) -> BoxSymbol
- Returns
BoxSymbol
get-default-box-symbol-params¶
public defn get-default-box-symbol-params () -> BoxSymbolParams
- Returns
BoxSymbolParams
BoxSymbol¶
public defstruct BoxSymbol <: SymbolDefn :
banks: HashTable<Int|Ref, GridInfo>
decorator-by-pin: HashTable<Ref, Vector<PinDecorator>>
grid: GridInfo
obj: Instantiable|Self
params: Maybe<BoxSymbolParams>
prop-by-group: HashTable<String, HashTable<Symbol, ?>>
-
banks: HashTable<Int|Ref, GridInfo>
-
decorator-by-pin: HashTable<Ref, Vector<PinDecorator>>
-
grid: GridInfo
-
obj: Instantiable|Self
- This is the component from which we are building this symbol This component object will provide the pins and pin properties needed to construct the box symbol. -
params: Maybe<BoxSymbolParams>
- Optional Explicit Parameters for this Box Symbol This is useful for testing or explicitly overriding the defaults without changing them for the rest of the schematic. -
prop-by-group: HashTable<String, HashTable<Symbol, ?>>
Functions¶
set-head-margin¶
public defn set-head-margin (box:BoxSymbol, margin:Double, group:String)
set-tail-margin¶
public defn set-tail-margin (box:BoxSymbol, margin:Double, group:String)
get-rows¶
Get the total number of rows in the pin grid.
public defn get-rows (b:BoxSymbol) -> Int
b: BoxSymbol
- Box Symbol object- Returns
Int
- number of rows in the pin grid of the givenbank
. If no pin grid is active for this bank, this function returns 0.
This function is for components with only one symbol unit.
get-rows¶
Get the total number of rows in the pin grid of a particular symbol unit.
public defn get-rows (b:BoxSymbol, bank:Int|Ref) -> Int
b: BoxSymbol
- Box Symbol objectbank: Int|Ref
- Selects for a particular symbol unit.- Returns
Int
- number of rows in the pin grid of the givenbank
. If no pin grid is active for this bank, this function returns 0.
set-grid¶
Set the grid for a component
public defn set-grid (b:BoxSymbol, dims:[Int, Int])
b: BoxSymbol
- Box Symbol objectdims: [Int, Int]
- Tuple of [row,column] where row & column must be greater than zero.
set-grid¶
public defn set-grid (b:BoxSymbol, dims:[Int, Int], bank:Int|Ref)
BoxSymbol¶
public defn BoxSymbol (obj:Instantiable|Self -- params:BoxSymbolParams = ?) -> BoxSymbol
- Returns
BoxSymbol
has-grid?¶
Check for an active grid
public defn has-grid? (b:BoxSymbol) -> True|False
b: BoxSymbol
- Box Symbol object- Returns
True|False
- boolean that indicates of a grid is present on this symbol or not.
Components like resistors, capacitors, etc might not have an active grid.
pins-in-group¶
public defn pins-in-group (b:BoxSymbol, group:String) -> Tuple<JITXObject>
- Returns
Tuple<JITXObject>
get-columns¶
Get the total number of columns in the pin grid.
public defn get-columns (b:BoxSymbol) -> Int
b: BoxSymbol
- Box Symbol object- Returns
Int
- number of columns in the pin grid of component symbol. If no pin grid is active, this function returns 0.
This function is for components that have only one symbol unit.
get-columns¶
Get the total number of columns in the pin grid of a particular symbol unit.
public defn get-columns (b:BoxSymbol, bank:Int|Ref) -> Int
b: BoxSymbol
- Box Symbol objectbank: Int|Ref
- Selects for a particular symbol unit.- Returns
Int
- number of columns in the pin grid of the givenbank
. If no pin grid is active for this bank, this function returns 0.
create-symbol¶
public defn create-symbol (x:BoxSymbol, bank:Int|Ref|False -- pose:Pose = ?, scale:Double = ?, description:String = ?) -> SchematicSymbol
- Returns
SchematicSymbol
find-pins-by-regex¶
Find a set of pins that match a particular query
public defn find-pins-by-regex (b:BoxSymbol, pattern:String -- bank:Int|Ref = ?, row:Int|Ref = ?, column:Int|Ref = ?) -> Vector<JITXObject>
b: BoxSymbol
- Box Symbol objectpattern: String
- Glob pattern used to find specific pins by the string variant of the pin reference. For example, if the there is a pinD.p[0]
,D.p[1]
,D.p[2]
,M.p[0]
,M.p[1]
andM.p[2]
The user could use a glob patternD.p[*]
to selectD.p[0]
,D.p[1]
,D.p[2]
bank: Int|Ref
- Optional bank selector so that will limit query to selecting only pins from this particular bank (symbol unit).row: Int|Ref
- Optional row selector that will limit query to selecting only pins from this particular row of the box grid.column: Int|Ref
- Optional column selector that will limit query to selecting only pins from this particular column of the box grid.- Returns
Vector<JITXObject>
- Tuple of Pins that match the given criteria.
add-decorator¶
Add a particular decorator[s] to the passed pins.
public defn add-decorator (b:BoxSymbol, pin-set:Seqable<JITXObject>, decorators:Seqable<PinDecorator>)
b: BoxSymbol
- Box Symbol Objectpin-set: Seqable<JITXObject>
- Pin or Set of Pins to add the decorator to.decorators: Seqable<PinDecorator>
- One or More decorators to add to these pins.
NOTE: Multiple decorators may not stack well yet - WIP.
add-decorator¶
public defn add-decorator (b:BoxSymbol, p:JITXObject, decorator:PinDecorator)
UnitSymbol¶
public deftype UnitSymbol
General Definitions¶
set-head-margin¶
public defn set-head-margin (margin:Double, pins:JITXObject ...)
set-head-margin¶
public defn set-head-margin (margin:Double, pins:Seqable<JITXObject>)
set-tail-margin¶
public defn set-tail-margin (margin:Double, pins:JITXObject ...)
set-tail-margin¶
public defn set-tail-margin (margin:Double, pins:Seqable<JITXObject>)
set-column¶
Set the Column assignment for these pins
public defn set-column (col:Int, pins:JITXObject ...)
Typically this would be used when the side
parameter had already
been set on these pins to Up
or Down
. The side
parameter would
then drive the row assignment to 0
or M-1
where M is the number of rows.
set-column¶
public defn set-column (col:Int, pins:Seqable<JITXObject>)
set-side¶
Set the side of the box symbol to assign to a pin or set of pins
public defn set-side (side:Dir, pins:JITXObject ...)
side: Dir
- Selects the edge of a box symbol on to which the pins will be drawnpins: JITXObject
- One Pin or a Tuple of Pins present onobj
that will be added to a side.
This function will set the direction and side of the passed pins.
If a grid
exists - then the appropriate column/row will be selected. For example,
The Top
side would be given row 0. The Left
side would be given column 0.
A Right
side would be given column N-1 where N is the number of columns.
If the grid
does not exist, then adding a side parameter for a set of pins would begin
constructing the grid. For example, Adding a set of pins on the Right
and Left
would
construct a grid of 1 row and 2 columns. Subsequent operations might increase the number of
rows if Top
and Bottom
pin sets were added. In this case, the row & column indices for the first group
of Right
and Left
pins would need to be modified. They would move from row index 0 to row index 1. The Right
side pins would move to column index 2. The Top
side pins would be in row index 0 and column index 1.
NOTE: If this is too complex - we can add the constraint that the user must add the grid
first, but in order to
match the existing functionality, I think we would need to support this.
set-side¶
public defn set-side (side:Dir, pins:Seqable<JITXObject>)
set-group¶
public defn set-group (group:String, pins:JITXObject ...)
set-group¶
public defn set-group (group:String, pins:Seqable<JITXObject>)
set-bank¶
public defn set-bank (bank:Int|Ref, pins:JITXObject ...)
set-bank¶
public defn set-bank (bank:Int|Ref, pins:Seqable<JITXObject>)
set-alignment¶
public defn set-alignment (pos:Anchor, pins:JITXObject ...)
set-alignment¶
public defn set-alignment (pos:Anchor, pins:Seqable<JITXObject>)
set-grid-edge¶
Set the pin grid position for a pin or set of pins.
public defn set-grid-edge (row:Int, column:Int, pins:JITXObject ...)
row: Int
- Row index into the pin grid.column: Int
- Column index into the pin grid.pins: JITXObject
- One Pin or a Tuple of Pins present onobj
that will be added to a group.- Throws
IndexError
- If either therow
orcolumn
are outside the active grid cells
If the grid does not exist yet - this is an error and this function should throw an exception.
There are only a limited set of valid row/column combinations based on the edges of the box symbol.
assign-symbols¶
public defn assign-symbols (banks:KeyValue<Int|Ref, UnitSymbol> ...) -> False
- Returns
False
assign-symbols¶
public defn assign-symbols (banks:Seqable<KeyValue<Int|Ref, UnitSymbol>>) -> False
- Returns
False
reset-default-box-symbol-params¶
public defn reset-default-box-symbol-params () -> False
- Returns
False
set-row¶
Set the Row assignment for these pins
public defn set-row (row:Int, pins:JITXObject ...)
Typically this would be used when the side
parameter had already
been set on these pins to Left
or Right
. The side
parameter would
then drive the column assignment to either 0
or N-1
where N is the number of columns .
set-row¶
public defn set-row (row:Int, pins:Seqable<JITXObject>)
Related Packages¶
Forwarded by packages: jsl/symbols/generators, jsl/symbols