Length stats: action plugin


#1

I am announcing a release of Length stats action plugin.

The plugin is run within pcbnew and will show cumulative length of all traces on a list of nets. The nets are selected either by selecting a pad or a trace which is bound to the net. The plugin should ease the routing of high speed interfaces (e.g. DDR3). The plugin was inspired by HorizonEDA functionality.

As always any comments and/or bug reports are always welcome.


#2

Looks useful. I’m concerned about performance, have you tried this on a large board?
Maybe add a “refresh” button and a switch to disable autorefresh so that it would be possible to trigger recalculation manually if needed.


#3

Also couple coding hints, feel free to incorporate them or not:

  • Since 5.1 KiCad supports toolbar buttons with custom icons for plugins. You can look at InteractiveHtmlBom for example or follow the updated plugin docs.
  • Combining wxFormBuilder generated code with your application logic makes it inconvenient to regenerate form code from the builder. Why not keep generated code separate and override that class in your file that will not be overwritten? Again you can look at InteractiveHtmlBom for examples.

#4

Any way to set it up to show the length between 2 pads? DDR3 is all good, but generally you don’t just have 1 memory chip, but multiple that you have to match lengths between certain things,


#5

The plugin was created to skratch my programing itch. Mostly to see how to create non modal dialog and to see how it behaves. So I did not really test for the performance. I can see that with large board the performance will take a hit. Thanks for the concern and for an idea how to prevent side effects.


#6

Regarding icons, I was just browsing the Kicad source code for icons to reuse, so it is on my to-do list for all my plugins. Thanks for implementing this feature.

As for wxform code I agree that machine generated code should not be modified and should thus be left in its own file. I was familiar with the approach from Qt. But when I started I had some problems with WxFormbuilder generated code which was not compatible with wxpython version used in KiCad. As I had to manually modify the code anyway I moved into the plugin. But back then I didn’t had the slightest idea how complex or how many plugins I’d write. Looking back I should have resolved the WxFormBuilder issues back then. I might refactor this but it is not high on my todo list.


#7

You probably ran into same issue I did. Check out this small hack:

Add this method to your derived frame/dialog class and it should make it work with wxpython3 and 4.


#8

If you are only looking for distance between to pads, this ia already done in pad2pad plugin. As for multiple pair pads distance it ia doable. I’d have to merge pad2pad code with length stats. But as the pad2pad algorithm is implemented now the performace would be a serious issue. So somebody with more CS background could probably improve things (get rid of recursion, …).

Unless I get the idea how to improve the basic algo in pad2pad, I will certainly not work on it.


#9

Thanks. I really appreciate it.