Interactive Html Bom Plugin for KiCad

I wasn’t able to reproduce this. Please add repro steps in the bug.

I just implemented dark mode in html. I know I was tired of staring at mostly white screen :slight_smile:

Also recorded a screen capture to showcase the plugin, added it to first post and the demo page for whoever finds this in the future.

Last beta before stable release:

Again, bunch of fixes and few cool features: dark mode, keyboard shortcuts, optimized render and reverse lookup by clicking on component drawing!

3 Likes

Nice update. Waiting for the stable release with more features.

Hi @qu1ck
I would like to use the toolbar button technique to add an other button to pcbnew toolbar (i.e. annular action plugin) and I noticed that if I simply add the button with a function similar to your check_for_bom_button() routine, sometimes pcbnew get stuck or starts with a messed toolbar…
At the moment I delayed my adding function in init to let your script add its iBOM btn, but I would like to have something more flexible…
Do you think it would be possible to handle the event to add more than a button from different plugins? Have you any suggestion?
Thanks
Maurice

Hi @maui,
The button code in my plugin is probably the dirtiest hack I ever wrote. It just plain doesn’t work on linux because it tries to issue draw calls from wrong thread, which X11 doesn’t like, it is not thread safe and will likely not work well if many buttons are added in different threads.
There is no way to do this properly right now, support needs to be added in pcbnew plugin system. I have some ideas about that and will work with KiCad devs to make it reality when I get to write them down.

In the meantime make sure that you launch the function in a separate daemon thread in your plugin. It has to work asynchronously and try to add the button with a delay. Pcbnew window has to finish loading before button is added, otherwise pcbnew will get messed up or just overwrite the toolbar state.

Also try increasing and varying the delay in your button adding thread to minimize the chances of it racing against ibom button thread.

If nothing works then, well you have to chose which button you want in pcbnew. Disabling button code is as simple as commenting out last 3 lines of __init__.py. The plugin will still show up in tools -> external plugins.

@qu1ck
thanks a lot for your clarifications… I’m using already the two buttons in my personal repo… I will wait for your code in kicad’s main branch for a full btn support :slight_smile:
Maurice

I just sent devs a patch. Let’s see how it goes :slight_smile:

1 Like

I ended up implementing this myself.

In recent nightlies you can now have buttons on the toolbar with custom icons. See plugin documentation on how to do that. Users can show/hide and reorder them at will.

This is good news for my plugin too as it unblocks installs for linux. That will be available soon.

5 Likes

Sweet! Thank you for all your work.

I just pushed to master update that should fix crashes on Linux. If you use KiCad nightlies on linux please test this, you can install the plugin in ~/.kicad/scripting/plugins or ~/.kicad_plugins.
Ubuntu nightlies have scripting turned off for whatever reason. I hope other distributions have it enabled so it should work. I tested this on debian 8 and 10 with kicad built from source.

If I will not get any bug reports I’ll tag current revision as V1.

Edit: you can install on stable 5.0 in linux as well, there just will be no button and you should be able to use it from tools menu.

1 Like

Would you look at that, its featured on hackaday

BTW v1 is out.

8 Likes

I have created .kicad_plugin and extracted the plugin, I then restarted KiCAD but I can’t find the plugin in tools menu.

I am using:

Application: kicad
Version: 5.0.0-fee4fd1~66~ubuntu16.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.0.2n zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-33-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
Boost: 1.58.0
OpenCASCADE Community Edition: 6.8.0
Curl: 7.47.0
Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

It should be .kicad_plugins. Also make sure you don’t have any intermediate folders. It should be .kicad_plugins/InteractiveHtmlBom/__init__.py

1 Like

Thanks, there was an intermediate folder.
I removed it and opened the PCBnew, when I tried to refresh plugins in tools menu it freezes, then I restart KiCAD but when I try to open PCBnew, KiCAD is crushing.

Note: recently I have upgrade ubuntu from 16.04 to 18.04 but KiCAD shows the version as of ubuntu 16.04.

Ubuntu 18.04 and derivatives (mint 19) have known issue with mismatch of wxwidgets and wxpython gtk versions. I’m sorry but there is nothing I can do about it, you have to use the plugin from command line.
KiCad devs are aware of this and are working to fix this in 5.1.

On Debian testing I was able to work around this by downgrading python-wxgtk3.0 version to 3.0.2.0+dfsg-6 which is build against gtk2. If you know what you are doing you might be able to do the same on ubuntu.

2 Likes

Thanks you, just I will use the command.

v1.1 is out!

As usual, aside from bugfixes there are some cool new features:

  • Highlight first pin of all components (option in settings)
  • All bom columns are sortable by clicking on header.
  • Checkbox columns can be cleared/set for all displayed rows by double clicking header.
  • Board rotation (option in settings)
  • Pixel perfect text rendering with native kicad font.
6 Likes

What is your used pin number list for that?

Right now just “1” or “A1”. Are there other common names I should check?