Designators for parts-with-sublayouts are not unique
in progress
B
Bryan Hoyt
When you add multiple sublayouts to a document, the existing designators of parts within those sublayouts remain whatever they were created to be in the source document.
This is a problem, because designators need to be globally unique within a PCB document. So when the sublayout is added to the main document, any conflicting designators should be updated.
Original bug report that raises this issue tangentially: https://fluxai.canny.io/admin/feedback/featurerequests/p/bom-file-and-sub-layouts?owner=bryan-939
A few things to be aware of when implementing this:
* Don't get confused here with the sublayout's designator. We're talking here about designators of components _inside_ the sublayout.
* I think we should preserve designator values that don't conflict. The sublayout author may have intended them to be meaningful.
* Per discussion with Bryan/Jared/Dominic, we should NOT implement this by mutating the part_version_data.extracted_element_cache -- very soon, part_version_data will be a reference and should be treated as readonly.
* This is a separate issue to finding a designator value that's conflict-free (i.e. one that doesn't clash with designators inside sublayouts). Bryan is addressing that separately (will post PR when ready)
M
Michael Ilewicz
why not simply a pattern of {sublayout_designator}_{component_designator}? this preserves the possibly meaningful designators and also ensures that designator values inside and outside of sublayouts don't clash
Not the prettiest but would at least unblock project using sublayouts, which is kinda a crucial feature to have :)
Riley Porter
This also affects design when you export the bom in flux. you get only the parts in a single instance of the subylayout vs n*sublayout
M
Mark Wu
This bug is blocking multi-module projects like this one: https://www.flux.ai/markwuflux/on-air-r2-demo. In this project, the design is made up of 3 functional modules. It is a good example of a blocked use case by this bug.
When attempting to order, the manufacturer cannot link the PnP to the BoM because part centroids are not unique.
Riley Porter
Mark Wu: I too find myself here after using 8 sublayouts in a design. That bening said Mark Wu you think I can just edit the PNP file to change designators
silks will be wrong
? This way I can assemble the board? Bryan Hoyt any ideas when this might be fixed? This does kill the use of sublayouts in anything bigger than a DIY by hand designs.
R
Rishabh Kaushik
Any updates on this?
M
Mark Wu
Also for duplicates of sublayouts, I propose that they should append an alphabetic sequence for each sublayout e.g. R1a, J1a for first copy and R1b, J1b for the second copy, etc. This would also work for the base case of adding a single sublayout: all their designators in the parent append "a" to every designator
M
Mark Wu
Noticed that selector is selecting designators of the same name in sublayouts; +1 on bug report.
Matthias
in progress
B
Bryan Hoyt
planned