Support merging multiple schematics for fab output #632
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to be able to panelize boards from multiple different projects together in the same panel. This is an open feature request elsewhere, but for my purposes I just implemented a simple layout plugin to handle it. The plug in API is nice!
However for "fab --assembly" to work I also need to be able to merge the schematics for each board. This PR allows the user to specify the "--schematic" argument multiple times, and all components will be merged from each schematic.
For this to work, the reference designators must be unique across all schematics and I added validation to check that. Currently I think duplicate references are happily added to the BOM. This requirement could be relaxed if UUIDs were used to correlate components and reference designators were renamed to be unique for each board, however I think that would confuse both users and fabricators pretty fast. And it's pretty easy to have unique references by just setting the starting index for generating them to different values for each project.
If this is too much of a hack, feel free to close. I also de-duplicated the code that filters parts out of the BOM to make the uniqueness check work more nicely.