CGrassin / kicad-pinout-generator

This KiCad plugin generates pinouts from the PCB file to various formats.
MIT License
32 stars 6 forks source link

Use Pin Name instead of Pad number #6

Closed PumaFPV closed 1 year ago

PumaFPV commented 2 years ago

It would be great to add the possibility of using Pin Name instead of Pad number (in some cases they do not match and the correct one is the Pin Name) It might also need some kind of filtering as Pin Name could be "GPIO26" and we only want "26". It could be implemented as a checkbox next to the dropdown menu. I'm not quite sure how to do it, but I'd love to help. You can contact me on Discord at PumaFPV#7895

CGrassin commented 2 years ago

Thank you for this issue! By Pin Name, you mean the pin name in the schematic? Assuming my understanding is correct, I completely agree with the necessity. A quick research revealed that pad.GetPinFunction() does exactly what we need for this.

The big question, however, is the UI. I agree with adding a checkbox "Use pin name instead of number". But the filtering part is a bit more annoying to implement in a way that keeps the UX simple. I will implement the first part ASAP, and will think about the rest later.

Note: don't worry about contributing to the code base yet, it is currently in active development. Opening an issue to request features is already a big contribution!

PumaFPV commented 2 years ago

Yup, the one that is inside of the part schematic. Nice! I dont know where to find the availabe functions... Maybe you could make a dropdown menu appear when the checkbox is checked, which would allow you to select what kind of filtering you want (none, only keep numbers, only keed what's in front of the "/", what's behind...) Attached is a picture of the component I'm thinking about image In my case I would like to obtain: #define NET_NAME 14 instead of #define NET_NAME 17 nor #define NET_NAME MTMS/GPIO14 Btw it could also be great to be able to not write the power/unused pins instead of commenting them. (Maybe new issue?)

CGrassin commented 1 year ago

I finally got to implementing this feature as of https://github.com/CGrassin/kicad-pinout-generator/commit/851d7c9376290438e7e7dc71694ae605f44f4056. It was a bit tricky to make it not too confusing for the user, and there might be some rework in the future to make it more understandable... image

There are now two additional controls in the interface: