Only report on clearances where there was one defined.

If it's 0, it's just a straight-up collision.

(cherry picked from commit 9976b9ce8c)
This commit is contained in:
Jeff Young 2023-03-26 20:46:59 +01:00
parent 76685ae2d9
commit e759c4d27a
2 changed files with 12 additions and 7 deletions

View File

@ -235,9 +235,9 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances()
actual );
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
drce->SetViolatingRule( constraint.GetParentRule() );
}
drce->SetViolatingRule( constraint.GetParentRule() );
drce->SetItems( fpA, fpB );
reportViolation( drce, pos, F_CrtYd );
}
@ -268,9 +268,9 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances()
actual );
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
drce->SetViolatingRule( constraint.GetParentRule() );
}
drce->SetViolatingRule( constraint.GetParentRule() );
drce->SetItems( fpA, fpB );
reportViolation( drce, pos, B_CrtYd );
}

View File

@ -307,12 +307,17 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance()
clearance, &actual, &pos ) )
{
auto drce = DRC_ITEM::Create( DRCE_SILK_CLEARANCE );
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
constraint.GetName(),
clearance,
actual );
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
if( clearance > 0 )
{
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
constraint.GetName(),
clearance,
actual );
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
}
drce->SetItems( item );
drce->SetViolatingRule( constraint.GetParentRule() );