Components
Sections
High Level Part Query
We can query actual parts from the JITX database that can be bought. Our database contains resistors, inductors, capacitors and STM micro-controllers.
Check the properties reference for a description of supported attributes.
Read about the Low Level Part Query API to learn about the syntax of the query requirements.
The high level functions in ocdb/utils/generic-components
such as chip-resistor make calls to less specialized functions
in ocdb/utils/parts
such as Resistor that make calls to the low level API such as dbquery-first
.
Supported parameters
The supported special query parameters are:
- _exist : List of attributes that the returned documents must contain.
- _sort : The returned documents will be sort according to the list of attributes specified
by this parameter, applied in the order they appear. Sorting in descending fashion can
be obtained by starting a sorting attribute by a minus sign "−". This can take 2 additional value besides
the list of existing properties:
area
is an alias fordimensions.area
andcost
is an alias forprice
.
Regular filter properties:
- We can filter on a part attribute :
{"category": "resistor"}
. - For filtering over capacitance, resistance and inductance, those constraints are replaced by interval allowing for queries with a precision of 0.0005Ω, 0.01A and 0.01F respectively.
- For filtering over the tolerance :
{"tolerance": 0.05}
will constrain the actual tolerance range to be included in the interval[-5%, 5%]
. Returns 500 Bas Request if this is not a positive double - We can filter on a nested parameter using
.
:{"dimensions.x": 11}
- We can filter on a list of values giving a list :
{"case": ["Axial", "0402"]}
- We can filter with an inequality prepending
min-
ormax-
:{"max−rated-power": 0.05}
.max-x
,max-y
andmax-z
are shorthands formax-dimensions.x
,max-dimensions.y
,max-dimensions.z
- We interpret
minimum_quantity
as a floor on bulk purchase size; we automatically convertminimum_quantity
tomax-minimum_quantity
.
Example:
#use-added-syntax(jitx)
defpackage my-design :
import ocdb/utils/generic-components
pcb-module my-module :
inst res : chip-resistor(["max-z" => 0.5, "_sort" => ["-rated-power"], "_exist" => ["tolerance"]])