Fixed selection columns for variants.
See original GitHub issueIt would be usefull to preload some columns with fixed selection values based on variants.
There is already --variants-whitelist
and --variants-blacklist
but these do not create columns, and they are not regex.
Context:
I use KiCAD with KiCost to manage variants.
KiCost allows use to specify a regex that helps filter all the variants. The dnp and variant fields determine together which components are ultimately present.
The contents of most other fields (description, value, …) can also be changed through the variant expression.
So when I add --variant '^(screen3v|button3)$'
, the screen3v
and button3
variants are selected.
Proposal
My proposal is that InteractiveHtmlBom also understand a variant option that is based on regex and allows the generation of named columns with tickboxes.
Example:
Repeat the same option multiple times
generate_interactive_bom.py --variant '3btn3Vscreen=^(screen3v|button3)$' --variant '2btn5Vscreen=^(screen5v)$' <otheroptions>
or
to be similar to the existing variant options, using space as a separator:
generate_interactive_bom.py --variant-regex '3btn3Vscreen=^(screen3v|button3)$ '2btn5Vscreen=^(screen5v)$' <otheroptions>
(when the equal sign is missing, this could be considered as a nameless field or only as a regex selector complementing the variants whitelist and blacklist options).
Regex is useful with buttons for example, use button.*
to select all buttons.
The suggested examples would add two columns ‘3btn3Vscreen’ and ‘2btn5Vscreen’ to the HTML file much like the default Sourced and Placed columns. They may be modifiable, but the modfications may/(should) be suppressed on reload (which could be an option).
Applying the other impacts of the variant selection (component value) would be nice, but only applicable when only one variant is added (simpliest case because this value is the only one in the HTML file) or selected (more complex case because this adds logic to the HTML file).
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (8 by maintainers)
Top GitHub Comments
Hi @mdeweerd !
This is the feature I mentioned in INTI-CMNB/KiBot#279 😉
@set-soft