Connectivity: Prevent duplicate logical pin assignments - #50
Open
Andrei-Errapart wants to merge 1 commit into
Open
Connectivity: Prevent duplicate logical pin assignments#50Andrei-Errapart wants to merge 1 commit into
Andrei-Errapart wants to merge 1 commit into
Conversation
Ignore pins from inactive component display modes so alternate header graphics cannot capture adjacent nets. Unify graphical endpoints that share a physical package pad and emit one logical pin per sheet instance.
Author
|
CI for this branch passed on my fork (same workflow, same base commit): https://github.com/Andrei-Errapart/AltiumSharp/actions/runs/32387331575 |
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.
Summary
Two connectivity defects let a component's inactive or duplicated graphics distort the extracted netlist. Pins belonging to a display mode other than the component's selected one still participated in connectivity, so an alternate symbol graphic (notably dual-row header alternates) could capture adjacent nets. And a symbol exposing the same physical package pad at multiple graphical locations produced multiple independent logical pins, so one pad's endpoints could land in different nets or a net could list the same pin more than once.
Changes
SheetGraphnow skips pins whoseOwnerPartDisplayModediffers from the component's selectedDisplayMode, extending the existing inactive-part (CurrentPartId) filter to inactive display modes.SheetGraph.UnifyDuplicatePhysicalPinsunions all graphical endpoints that share a physical package pad (component + pin designator), so they form one electrical node even when drawn at different locations.NetlistAssembleremits one logical pin per sheet instance and pad, deduplicating bySheetInstanceIdplus pin key when assembling each net's pin list.SchematicNetlistTestscovering both behaviors.Test Plan
dotnet test) — full suite at this commit: 853 passed, 0 failed, 10 skipped (pre-existing data-dependent skips, unrelated to this change)Only_Selected_Display_Mode_Pins_Participate_In_Connectivity(Theory, run for both display modes: each mode's pin connects only to its own net and the netlist contains the logical pin exactly once) andDuplicate_Pin_Designators_On_Component_Unify_By_Physical_Pad(both graphical locations of pad 6 resolve to a single net listing the pin once)Checklist
NetlistAssemblerandSheetGraphareinternal, the newUnifyDuplicatePhysicalPinsisprivate, and the properties the tests use (SchPin.OwnerPartDisplayMode,SchComponent.DisplayMode) already existed