devbisme / skidl

SKiDL is a module that extends Python with the ability to design electronic circuits.
https://devbisme.github.io/skidl/
MIT License
1.04k stars 118 forks source link

ERC could show line defining part #185

Open 2e0byo opened 1 year ago

2e0byo commented 1 year ago

I have an ERC warning output, part of which shows:

ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R2.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R5.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R8.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R11.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R14.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R17.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R20.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R23.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R26.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R29.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R32.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R35.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R38.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R41.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R44.
ERC WARNING: Unconnected pin: PASSIVE pin 2/~ of R/R47.

Clearly I forgot to connect one end of a resistor. Unfortunately I have no idea which, as I haven't tagged or named my resistors. It would be neat if the ERC warning told me where the part was defined. I think something like this could be done by hooking into the logic which adds the part to a circuit, probably using something like inspect.findsource (which is slow.... but so is SKIDL :D).

If this bothers me enough and I get the time I'll have a go at implementing it, but I'd be interested to know what others do about it.