Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

wrs
Copy link

@wrs wrs commented Nov 10, 2024

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.

wrs and others added 10 commits November 10, 2024 11:47
Defaulting the setting to board priority means that by default all
work done will be lost if you forget to click the export button.
This is dangerous and confusing, so instead this saves work by default.

It would be better to also warn when the dialog is closed without
exporting, when the setting is the other way.
If in database priority mode, set the board's part to the
database's part rather than erasing it.
This adds an "LCSC Params" field to the footprint and part selection lists
that makes it much easier to double-check the assignments or select the
right part. Particularly for passives, LCSC buries the important data (like
the resistance of a resistor) in the middle of the description field. This
pulls those values out where you can see them.
Double-clicking a footprint brings up part selection.
Double-clicking a part in the selector assigns the part.
Don't search for the existing LCSC value -- if I'm searching, that's
presumably the only part I don't want!

Tweak the search string to make it easier to find passives quickly.
@Bouni
Copy link
Owner

Bouni commented Nov 18, 2024

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
Copy link
Owner

Bouni commented Nov 18, 2024

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

@Bouni Bouni added the enhancement New feature or request label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants