fix: prevent duplicate net labels when multiple ports share same net#2159
Open
BossChaos wants to merge 1 commit intotscircuit:mainfrom
Open
fix: prevent duplicate net labels when multiple ports share same net#2159BossChaos wants to merge 1 commit intotscircuit:mainfrom
BossChaos wants to merge 1 commit intotscircuit:mainfrom
Conversation
- Add netsWithLabels tracking Set to avoid placing multiple labels for the same net - When multiple ports are connected to GND/VCC, only place one label instead of one per port - Fixes repro61 test case where C1 and C2 both connected to same nets showed duplicate labels
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
rushabhcodes
left a comment
There was a problem hiding this comment.
proof that this fixes it, iirc this should be fixed in the schematic-trace-solver
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
Author
|
Just checking in — is there anything else needed from my side to move this forward? Happy to make any adjustments! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes repro61 test case where duplicate net labels were shown when multiple components share the same net (GND/VCC).
Problem
When two capacitors C1 and C2 both connect to GND and VCC nets, the schematic renderer placed a net label at each connection point, resulting in duplicate labels (2x GND, 2x VCC).
Solution
Add a
netsWithLabelsSet to track which nets already have a label placed. When processing ports or traces, skip placing a label if that net already has one.Changes
insertNetLabelsForPortsMissingTrace.ts: Add netsWithLabels trackinginsertNetLabelsForTracesExcludedFromRouting.ts: Add netsWithLabels trackingTest
Repro61 test case now shows only 2 labels (1x GND, 1x VCC) instead of 4.