Bouni / kicad-jlcpcb-tools

Plugin to generate BOM + CPL files for JLCPCB, assigning LCSC part numbers directly from the plugin, query the JLCPCB parts database, lookup datasheets and much more.
MIT License
1.2k stars 109 forks source link

Show component values in list (+ other minor conveniences) #551

Open wrs opened 2 weeks ago

wrs commented 2 weeks ago

There are several commits in this PR, sorry. However, they are all independent, so you can apply whichever you approve of.

They're all small conveniences except the "Show parameters derived from LCSC description" commit, which addresses the following pain points:

  1. LCSC often buries the most important data (like the resistance of a resistor) at the end of the description field. For example: "50mW Thick Film Resistors ±200ppm/℃ ±1% 234kΩ". The "234kΩ" is past the point where the part details dialog truncates the description. (And that dialog is not resizable, which is one of the minor fixes.)

  2. When choosing a part, the values aren't visible in the list. If you search for "5kΩ" you'll also get "25kΩ", "1.5kΩ", etc. and you can't see which is which without opening the details dialog.

  3. When double-checking the assignments, you can't just look down the footprint list to be sure the values are sane, because you can't see the values.

This commit tries to address this by implementing heuristics to pull the important data out of the LCSC description field and show it in the footprint and parts lists. For example:

image image

You can easily scan the list to make sure the values and footprints match.

In part selection:

image

It's easy to tell the 5.1k from the 51k from the 1k.

This (in addition to implementing double-click in another commit) has vastly accelerated my workflow.

There's one other minor change to note: I altered the default setting of lcsc_priority. With the current setting, my experience as a new user was that I put in 15 minutes of work assigning parts, closed the dialog, and immediately lost all my work because I didn't know to click the "export" button. It seems safer to default the other way.

Bouni commented 1 week ago

I tested your PR, and I like it so far. There were some ruff formatter issues that I fixed.

The double click event on the part selector is not working (at least on Windows 11). That seems to be impossible https://stackoverflow.com/a/50489083

It works on the mainwindows however because there we use a wx.DataViewCtrl, on the part selector we still use a wx.dataview.DataViewListCtrl. Maybe I'll rewrite that so that we use a wx.DataViewCtrl as well and get a double click event.

But at te moment I hav no time for that 😓

Bouni commented 1 week ago

Let me test your PR for a little longer and I'll merge it if I don't see any issues