Treat PWR_FLAG anchors as connected in orphan-wire detection

PWR_FLAG instances use a #FLG reference prefix, not #PWR, so their
pin positions were never registered as virtual connection anchors in
_parse_virtual_connections. As a result, find_orphaned_wires reported
wire ends terminating on a PWR_FLAG as dangling. Other call sites
(schematic_analysis.py:127, kicad_interface.py:3814) already recognize
#FLG as a power symbol; align this site with them.

Also coerce a previously-validated Optional[int] to int in board/layers.py
so the file passes mypy (required by the pre-commit hook); behavior is
unchanged because the value is already None-checked above.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Eugene Mikhantyev
2026-04-26 16:05:35 +01:00
parent a87c4515c5
commit 7f3a379657
2 changed files with 2 additions and 2 deletions

View File

@@ -236,7 +236,7 @@ def _parse_virtual_connections(
if not hasattr(symbol, "property") or not hasattr(symbol.property, "Reference"):
continue
ref = symbol.property.Reference.value
if not ref.startswith("#PWR"):
if not (ref.startswith("#PWR") or ref.startswith("#FLG")):
continue
if ref.startswith("_TEMPLATE"):
continue