Better prioritization for non-driven pin ERC

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1881
This commit is contained in:
Jon Evans 2020-10-21 21:47:00 -04:00
parent af28634df1
commit 601a63b63a
1 changed files with 9 additions and 2 deletions

View File

@ -459,8 +459,15 @@ int ERC_TESTER::TestPinToPin()
{
ELECTRICAL_PINTYPE refType = refPin->GetType();
if( !needsDriver && DrivenPinTypes.count( refType ) )
needsDriver = refPin;
if( DrivenPinTypes.count( refType ) )
{
// needsDriver will be the pin shown in the error report eventually, so try to
// upgrade to a "better" pin if possible: something visible and not a power symbol
if( !needsDriver ||
( !needsDriver->IsVisible() && refPin->IsVisible() ) ||
( needsDriver->IsPowerConnection() && !refPin->IsPowerConnection() ) )
needsDriver = refPin;
}
hasDriver |= DrivingPinTypes.count( refType );