(Screenshots ahead ! )
Recently, I discussed the “ExcludeFromBom” and “ExcludeFromBoard” flags in the library editor (and ).
This kind of flag is usually here to assess the nature of a component, not for user adjustment of the BOM.
e.g. : a graphics symbol, which, by nature, is not included in the BOM.
This is really different from the per-component usage management (BOM exclusion, alternate values), like Altium’s “Variants”, with proper project-wide, spreadsheet-like dialogs.
Even worst: Kicad’s “ExcludeFromBom” and “ExcludeFromBoard” flags are not local to each sheet instances, but propagated into all instances. This is a serious drawback for the use of these flags as a BOM management tool!
But for the time being, there is no other option to control the BOM content, so let’s use it !
I began to ramble in the source code a few days ago : huge code base, no documentation except Doxygen files (nicely made, BTW). Complex code and a few advances C++ features.
I decided to do some hands-on training by adding a Visual Feedback of the BOM inclusion/Exclusion status.
As I was only 4 days into my Kicad’s code exploration, I admit that the result, although a bit lacking on the cosmetics side, went quite well…
Here was the plan :
- I wanted to mimic Altium Designer 's big red crosses printed across components excluded from the BOM.
- I also wanted similar green crosses for the “Excluded from Board” components (although I can’t see any good usage of this flag into the schematics).
- I also wanted to “Grey Out” these excluded components, while preserving most of the color theme preferences (I finally had to write the function).
- And finally, I introduced a feature missing in Altium. It is very useful to know at a glance if a sheet instance is unmodified or has variations, like BOM exclusions.
- The final requirement was to look equally well against light or dark backgrounds, and to preserve the user’s color theme.
Some Screenshots.
The way to edit the flags don’t change, and is in done the component editor :
First, a basic dark theme .
The color code of the overlays :
- Red = Not in BOM
- Green = Not in Board
- Red + Green = both…
The line width is adapted for small items (test points) vs large ones, and is set 1.5 times wider if the component is selected.
Greyd-out components.
The function produces a black and white image, with some nonlinear “gain” to visually “Dim” the symbol : i.e. darker if dark background or brighter if light background.
At the upper level, the sheet symbol show the sheet instance status : if there is at least one “Not in BOM” component, a red sign is added, and a Green for “Not On Board”.
The code actually scans the sheet’s components instances and checks the presence of specific flags.
The centered position of these markers shouldn’t interfere with the sheet’s pins.
A nifty icon is indeed expected to replace this primitive “artwork”.
If there is only on kind of exclusion found, only on cross is drawn (indeed).
Light background, inspired by Altium.
This wLight theme, along many others, is here : https://github.com/pointhi/kicad-color-schemes.
Technically, the code doesn’t handle printing or tracing. The Kicad base code requires specific functions for each. I have devised a way to simply this requirement in this particular case.
This would lead to a more generic “Decorations Overlays” framework concept. Basically, dynamically add or remove graphics elements to a symbol instance “drawing list”, as needed. It would then be drawn, printed or plotted identically, without any special code.
But first steps first…
.