Skip to content

Connectivity: Prevent duplicate logical pin assignments - #50

Open
Andrei-Errapart wants to merge 1 commit into
issus:masterfrom
Andrei-Errapart:PreventDuplicateLogicalPinAssignments
Open

Connectivity: Prevent duplicate logical pin assignments#50
Andrei-Errapart wants to merge 1 commit into
issus:masterfrom
Andrei-Errapart:PreventDuplicateLogicalPinAssignments

Conversation

@Andrei-Errapart

@Andrei-Errapart Andrei-Errapart commented Aug 19, 2026

Copy link
Copy Markdown

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

  • SheetGraph now skips pins whose OwnerPartDisplayMode differs from the component's selected DisplayMode, extending the existing inactive-part (CurrentPartId) filter to inactive display modes.
  • New SheetGraph.UnifyDuplicatePhysicalPins unions all graphical endpoints that share a physical package pad (component + pin designator), so they form one electrical node even when drawn at different locations.
  • NetlistAssembler emits one logical pin per sheet instance and pad, deduplicating by SheetInstanceId plus pin key when assembling each net's pin list.
  • New tests in SchematicNetlistTests covering both behaviors.

Test Plan

  • Existing tests pass (dotnet test) — full suite at this commit: 853 passed, 0 failed, 10 skipped (pre-existing data-dependent skips, unrelated to this change)
  • New tests added for new behavior — 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) and Duplicate_Pin_Designators_On_Component_Unify_By_Physical_Pad (both graphical locations of pad 6 resolve to a single net listing the pin once)

Checklist

  • Code follows existing style and conventions
  • Public API changes are documented with XML doc comments — there are no public API changes: NetlistAssembler and SheetGraph are internal, the new UnifyDuplicatePhysicalPins is private, and the properties the tests use (SchPin.OwnerPartDisplayMode, SchComponent.DisplayMode) already existed
  • No breaking changes (or clearly identified below) — no API signature changes. Netlist extraction output does change for affected schematics, which is the fix itself: pins of unselected display modes no longer join nets, and endpoints sharing a physical pad now merge into one logical pin instead of appearing as duplicates.

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.
@Andrei-Errapart

Copy link
Copy Markdown
Author

CI for this branch passed on my fork (same workflow, same base commit): https://github.com/Andrei-Errapart/AltiumSharp/actions/runs/32387331575

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.

1 participant