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

Fix LCSC numbers appearing on silkscreen #547

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Fix LCSC numbers appearing on silkscreen #547

merged 1 commit into from
Oct 11, 2024

Conversation

whmountains
Copy link
Collaborator

@whmountains whmountains commented Oct 9, 2024

Fixes #546

The Python scripting API is a bit awkward. It would be nice if pcbnew.FOOTPRINT.SetField returned the resulting field so we could call SetVisible(False) on it.

I looked for ways to bypass the call to GetFieldByName(). The source code for SetField has some ideas. But it wasn't working quite right and I would have to modify the function signature to take pcbnew as an argument for use in standalone mode. I think we would also have to modify our standalone impl to add a couple of extra stub methods.

Thanks @Carbon225 for the example code showing the problem and a prototype solution.

@whmountains whmountains force-pushed the hide-lcsc-numbers branch 2 times, most recently from 2f8ee8b to dd073f6 Compare October 9, 2024 22:35
@whmountains
Copy link
Collaborator Author

The original push would unconditionally set the LCSC field to be hidden, but I realized that was a bit unclean. What if a user had manually set the field to be visible? We wouldn't want the plugin to make it hidden in that case. So I force-pushed a new implementation which only sets the field to visible if it did not already exist.

@Bouni
Copy link
Owner

Bouni commented Oct 11, 2024

Looks good to me.

Just a side note, this seems to be a Linux only issue. On Windows there is not even a Layer shown for the fields:
Turns out you can show/hide columns by right clicking the header 🙈

@Bouni Bouni merged commit a39bf1d into main Oct 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All LCSC numbers appear on silkscreen
2 participants