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

Allow packages to fix parameters #784

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

jmwilson
Copy link
Contributor

This change allows packages and pads to define fixed parameters, which cannot be overwritten by a board's parameter rule. This can be useful in a number of situations, such as a package that wants to define a courtyard excess based on IPC density level, or has specific solder and paste mask settings that are recommended by the manufacturer. While these results can also be obtained by manually defining the courtyard boundary or a adding a shape on the mask layer, parametric definitions are much nicer.

This change bumps the pool version to 1, and adds parameters_fixed as a field in packages and pads. When the board pushes its parameter rule to packages via Package::apply_parameter_set, the parameter ID is checked against the set of fixed parameters. When both a pad and package fix the same parameter, the pad's value will take precedence.

In the parameter set editor UI, the option to fix a parameter is an additional button that appears with the pin icon, which is similarly used in many other programs. When multiple pads are selected in the parameter editor, using the All button will copy the fixed field to all pads, and clicking the All button on a fixed parameter will also copy it to all pads.

While fixed parameters could conceptually apply to padstacks, padstacks also allow required parameters that must be defined by a pad. Having a parameter that is both fixed (at the padstack level) and required of pads using it would be somewhat contradictory, so padstacks cannot define fixed parameters.

@carrotIndustries
Copy link
Member

Looks great overall!

Some more suggestions: I think not many packages will use this new feature, so bumping the version isn't always necessary. For this, the imp suggests the concept of dynamic versions, that is the version is only bumped if a new feature is used. See the symbol imp and symbol.cpp for how it's implemented there.

@jmwilson
Copy link
Contributor Author

Thanks for the comments! I added dynamic versioning and switched to a checkbox in the parameter windows: e80720c

Screenshot 2024-09-27 081457
Screenshot 2024-09-27 081415

@jmwilson
Copy link
Contributor Author

@carrotIndustries any more thoughts on this?

@carrotIndustries
Copy link
Member

LGTM, just squash the two last commits, then I'll merge it

@carrotIndustries carrotIndustries merged commit 596ac13 into horizon-eda:master Oct 1, 2024
21 checks passed
@carrotIndustries
Copy link
Member

Done, thanks for the high-quality PR!

@jmwilson jmwilson deleted the fixed_parameters branch October 2, 2024 05:49
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.

2 participants