Browse Source

Bring inspection reporting in line with zone filler

1) "clearance" rules don't apply to NPTH holes with no copper
2) local zone clearance applies even if other item has no copper

Fixes https://gitlab.com/kicad/code/kicad/issues/14575
newinvert
Jeff Young 3 years ago
parent
commit
251161dbeb
  1. 46
      pcbnew/drc/drc_engine.cpp

46
pcbnew/drc/drc_engine.cpp

@ -1075,9 +1075,23 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
if( c->constraint.m_Type == CLEARANCE_CONSTRAINT )
{
if( implicit && ( a_is_non_copper || b_is_non_copper ) )
if( a_is_non_copper || b_is_non_copper )
{
if( implicit )
{
REPORT( _( "Netclass clearances apply only between copper items." ) )
}
else if( a_is_non_copper )
{
REPORT( wxString::Format( _( "%s contains no copper. Rule ignored." ),
EscapeHTML( a->GetItemDescription( this ) ) ) )
}
else if( b_is_non_copper )
{
REPORT( _( "Netclass clearances apply only between copper items." ) );
REPORT( wxString::Format( _( "%s contains no copper. Rule ignored." ),
EscapeHTML( b->GetItemDescription( this ) ) ) )
}
return;
}
}
@ -1305,11 +1319,17 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
int localA = ac ? ac->GetLocalClearance( nullptr ) : 0;
int localB = bc ? bc->GetLocalClearance( nullptr ) : 0;
int clearance = global;
bool needBlankLine = true;
if( localA > 0 )
{
if( needBlankLine )
{
REPORT( "" )
REPORT( wxString::Format( _( "Local clearance on %s; clearance: %s." ),
needBlankLine = false;
}
REPORT( wxString::Format( _( "Local clearance on %s: %s." ),
EscapeHTML( a->GetItemDescription( this ) ),
MessageTextFromValue( localA ) ) )
@ -1324,9 +1344,14 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
}
if( localB > 0 )
{
if( needBlankLine )
{
REPORT( "" )
REPORT( wxString::Format( _( "Local clearance on %s; clearance: %s." ),
needBlankLine = false;
}
REPORT( wxString::Format( _( "Local clearance on %s: %s." ),
EscapeHTML( b->GetItemDescription( this ) ),
MessageTextFromValue( localB ) ) )
@ -1340,7 +1365,14 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
}
}
if( !a_is_non_copper && !b_is_non_copper )
{
if( needBlankLine )
{
REPORT( "" )
needBlankLine = false;
}
REPORT( wxString::Format( _( "Board minimum clearance: %s." ),
MessageTextFromValue( m_designSettings->m_MinClearance ) ) )
@ -1350,12 +1382,6 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
constraint.SetName( _( "board minimum" ) );
constraint.m_Value.SetMin( m_designSettings->m_MinClearance );
}
if( a_is_non_copper || b_is_non_copper )
{
REPORT( _( "Local and board clearances apply only between copper items." ) );
constraint.m_Type = NULL_CONSTRAINT;
constraint.m_DisallowFlags = 0;
}
return constraint;

Loading…
Cancel
Save