[5.99] Selective inclusion in BOM. Visual feedback tests, screenshots

(Screenshots ahead ! :sunglasses:)

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 :

  1. Red = Not in BOM
  2. Green = Not in Board
  3. 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”.

image

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…
.

1 Like

Did you read https://gitlab.com/kicad/code/kicad/-/issues/2131 which I already linked to from the other thread?

Yes, I did.

At the time, the more technical aspects of this thread made little sense to me, as I hadn’t seen a single line of code yet.
But it was also clear that the specs, and the associated workflow, of a variants system are still to be defined. And won’t be there before v7.

I share my weekend’s experiments, should be fine with everybody.

And indeed, being new to this code, I’m in no way able to contribute to the “real v.6”.
But this doesn’t mean I’m not an experienced product designer.

I’m pretty sure that in these very early experiments I already got a first feel of future implementation “goodies”. : back annotations, shared sub-sheets or self-contained projects that doesn’t require external libs, to name a few.

If I happen to contribute to v7.x one day, it all started there.

Now, I’m still quite happy with what I’ve done in less that 4 days, starting from zero.
Most part being spent navigating Doxigen links and fighting Eclipse and Cmake lake of cooperation on files locations… :sunglasses:

And, mind you, I will not top playing with the source code (indeed…)
Stay tuned for the next chapter, freak show ahead ! :rofl:

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.