part-rnd - design

1. Data sets

part-rnd looks at types of datasets:

The user drawn part of the schematics contain requirements. There's an extra non-graphical part selection sheet (PSS for short) edited by part-rnd, which contains the actual part and the attributes dictated by the actual part, with the possible sourced part(s) as paired by the user via part-rnd.

2. Typical workflows

2.1. requirement-selection

Used for the simplest and most common parts that are manufactured by many manufacturers as compatible, drop-in replacements. Typical examples are resistors, capacitors, discrete transistors, standard analog ICs (e.g. opamps, comparators), standard digital ICs (e.g. the 74xx series).

The workflow is requirements -> actual -> sourced.

The user places a light symbol on the sheet and configures vague requirements. Once the schematics is finished, part-rnd is used to collect matching parts and provides an UI for the user to do the part selection of known, matching actual parts. Finally, for each actual part the user can browse inventory options and select a source. All the selections made in part-rnd are edited into the PSS.

In this workflow, the user chooses a symbol first, manually, and that may also become a requirement that narrows down available (matching/compatible) parts.

2.2. part-selection first

In case of critical and more complex parts, like MCUs, the user may skip the requirements step and specify the actual part directly to part-rnd which will provide the matching/compatible symbol and fills in the actual part into the PSS. Finally the usual source selection is done at the end, the same way in with 2.1.

The workflow is actual -> sourced.

3. Implementation details

3.1. static part files

A static part file describes a single part in form of a devmap. It is keyed by the manufacturer part number. It contains at least the following attributes:

3.2. programmed part files

Programmed part files (PPF for short) are essentially parametric devmaps. A PPF is an executable that gets the set of requirements part-rnd is dealing with and spits out zero or more devmap trees on stdout matching the requirements.

PPF is most useful with part families. For example a ceramic capacitor family from a given vendor typically covers a massive matrix of specific parts, each different in their dielectric material, capacitance value and voltage rating. Each part has a corresponding footprint and 3d model too. The PPF evaluates requirements and generates the exact part numbers that match, among with the corresponding footprint/3d attributes.

Another typical example is connectors: a family of connectors come with different, discrete number of pins, each with its own part number. It may be that a family offers 8, 9, 10 and 12 pin connectors but not a 11 pin connector. One of the most important user requirement is the number of pins.

3.3. Inventory/sourcing APIs

Part-rnd calls external executables to query for availability and price of actual parts. The query consists of the exact manufacturer part number and may contain per vendor part number (e.g. the C-number for lcsc or the digikey part number) if that attribute was present in the actual part. Requests are sent in batches.

The external query program then does whatever it needs to do (e.g. look at local databases or use web APIs) and return stock status (how many parts are available) and a list of prices entry (e.g. depending on number of parts bought). Local inventory typically returns a single price entry that covers from anything between 0 and infinite and has zero cost.