Replace findings list with a tree; filter ESD/PI false positives.
PE-ESD-001 only on J* connector–IC nets (skip NC, unconnected, VSYS/GND/3V3). PE-PI-001 treats any capacitor on the rail, including KiCad slash prefixes, as decoupling. Sort findings ERROR then WARNING then INFO, then RULE/RISK/REVIEW/INFO. Report sidebar is a collapsed expand-on-click tree instead of an all-open list. GET /report and complete_findings fail-soft and sort the same way.
This commit is contained in:
@@ -22,6 +22,21 @@ def normalize_kicad_hierarchy_net(name: str) -> str:
|
||||
return n
|
||||
|
||||
|
||||
def refs_on_matched_net(graph: DesignGraph, net_name: str) -> list[str]:
|
||||
"""Component refs on *net_name*, including KiCad ``/``-prefixed aliases."""
|
||||
refs: set[str] = set()
|
||||
if not net_name:
|
||||
return []
|
||||
for name, net in graph.nets.items():
|
||||
if name == net_name or kicad_nets_match(name, net_name):
|
||||
refs.update(pc.component_ref for pc in net.pins)
|
||||
for ref, comp in graph.components.items():
|
||||
for pin_net in comp.pins.values():
|
||||
if pin_net and (pin_net == net_name or kicad_nets_match(pin_net, net_name)):
|
||||
refs.add(ref)
|
||||
return sorted(refs)
|
||||
|
||||
|
||||
def kicad_nets_match(a: str, b: str) -> bool:
|
||||
"""True if schematic and PCB names are the same KiCad net.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user