Improve clearance report messages.
Removes some duplicated terms; puts in some more headers to make visual parsing easier, and makes non-connected-pads report the correct data. Also fixes a bug where zone-connection overrides of none weren't getting handled correctly. Fixes https://gitlab.com/kicad/code/kicad/issues/11544
This commit is contained in:
parent
ee4e50518f
commit
5d0d2201f3
|
@ -170,8 +170,7 @@ void DRC_ENGINE::loadImplicitRules()
|
||||||
holeToHoleConstraint.Value().SetMin( bds.m_HoleToHoleMin );
|
holeToHoleConstraint.Value().SetMin( bds.m_HoleToHoleMin );
|
||||||
rule->AddConstraint( holeToHoleConstraint );
|
rule->AddConstraint( holeToHoleConstraint );
|
||||||
|
|
||||||
rule = createImplicitRule( _( "default" ) );
|
rule = createImplicitRule( _( "board setup constraints zone fill strategy" ) );
|
||||||
|
|
||||||
DRC_CONSTRAINT thermalSpokeCountConstraint( MIN_RESOLVED_SPOKES_CONSTRAINT );
|
DRC_CONSTRAINT thermalSpokeCountConstraint( MIN_RESOLVED_SPOKES_CONSTRAINT );
|
||||||
thermalSpokeCountConstraint.Value().SetMin( bds.m_MinResolvedSpokes );
|
thermalSpokeCountConstraint.Value().SetMin( bds.m_MinResolvedSpokes );
|
||||||
rule->AddConstraint( thermalSpokeCountConstraint );
|
rule->AddConstraint( thermalSpokeCountConstraint );
|
||||||
|
@ -870,7 +869,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||||
spoke_override = zone->GetMinThickness();
|
spoke_override = zone->GetMinThickness();
|
||||||
|
|
||||||
REPORT( "" )
|
REPORT( "" )
|
||||||
REPORT( wxString::Format( _( "Zone %s min thickness: %s." ),
|
REPORT( wxString::Format( _( "%s min thickness: %s." ),
|
||||||
EscapeHTML( zone->GetSelectMenuText( UNITS ) ),
|
EscapeHTML( zone->GetSelectMenuText( UNITS ) ),
|
||||||
EscapeHTML( REPORT_VALUE( spoke_override ) ) ) )
|
EscapeHTML( REPORT_VALUE( spoke_override ) ) ) )
|
||||||
}
|
}
|
||||||
|
@ -943,6 +942,12 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||||
REPORT_VALUE( c->constraint.m_Value.Opt() ) ) )
|
REPORT_VALUE( c->constraint.m_Value.Opt() ) ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MIN_RESOLVED_SPOKES_CONSTRAINT:
|
||||||
|
REPORT( wxString::Format( _( "Checking %s min spoke count: %s." ),
|
||||||
|
EscapeHTML( c->constraint.GetName() ),
|
||||||
|
MessageTextFromValue( EDA_UNITS::UNSCALED, c->constraint.m_Value.Min() ) ) )
|
||||||
|
break;
|
||||||
|
|
||||||
case ZONE_CONNECTION_CONSTRAINT:
|
case ZONE_CONNECTION_CONSTRAINT:
|
||||||
REPORT( wxString::Format( _( "Checking %s zone connection: %s." ),
|
REPORT( wxString::Format( _( "Checking %s zone connection: %s." ),
|
||||||
EscapeHTML( c->constraint.GetName() ),
|
EscapeHTML( c->constraint.GetName() ),
|
||||||
|
@ -1371,7 +1376,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||||
if( local != ZONE_CONNECTION::INHERITED )
|
if( local != ZONE_CONNECTION::INHERITED )
|
||||||
{
|
{
|
||||||
REPORT( "" )
|
REPORT( "" )
|
||||||
REPORT( wxString::Format( _( "Footprint %s zone connection: %s." ),
|
REPORT( wxString::Format( _( "%s zone connection: %s." ),
|
||||||
EscapeHTML( footprint->GetSelectMenuText( UNITS ) ),
|
EscapeHTML( footprint->GetSelectMenuText( UNITS ) ),
|
||||||
EscapeHTML( PrintZoneConnection( local ) ) ) )
|
EscapeHTML( PrintZoneConnection( local ) ) ) )
|
||||||
|
|
||||||
|
@ -1387,7 +1392,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||||
ZONE_CONNECTION local = zone->GetPadConnection();
|
ZONE_CONNECTION local = zone->GetPadConnection();
|
||||||
|
|
||||||
REPORT( "" )
|
REPORT( "" )
|
||||||
REPORT( wxString::Format( _( "Zone %s pad connection: %s." ),
|
REPORT( wxString::Format( _( "%s pad connection: %s." ),
|
||||||
EscapeHTML( zone->GetSelectMenuText( UNITS ) ),
|
EscapeHTML( zone->GetSelectMenuText( UNITS ) ),
|
||||||
EscapeHTML( PrintZoneConnection( local ) ) ) )
|
EscapeHTML( PrintZoneConnection( local ) ) ) )
|
||||||
|
|
||||||
|
@ -1404,7 +1409,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||||
int local = zone->GetThermalReliefGap();
|
int local = zone->GetThermalReliefGap();
|
||||||
|
|
||||||
REPORT( "" )
|
REPORT( "" )
|
||||||
REPORT( wxString::Format( _( "Zone %s thermal relief gap: %s." ),
|
REPORT( wxString::Format( _( "%s thermal relief gap: %s." ),
|
||||||
EscapeHTML( zone->GetSelectMenuText( UNITS ) ),
|
EscapeHTML( zone->GetSelectMenuText( UNITS ) ),
|
||||||
EscapeHTML( REPORT_VALUE( local ) ) ) )
|
EscapeHTML( REPORT_VALUE( local ) ) ) )
|
||||||
|
|
||||||
|
@ -1421,7 +1426,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||||
int local = zone->GetThermalReliefSpokeWidth();
|
int local = zone->GetThermalReliefSpokeWidth();
|
||||||
|
|
||||||
REPORT( "" )
|
REPORT( "" )
|
||||||
REPORT( wxString::Format( _( "Zone %s thermal spoke width: %s." ),
|
REPORT( wxString::Format( _( "%s thermal spoke width: %s." ),
|
||||||
EscapeHTML( zone->GetSelectMenuText( UNITS ) ),
|
EscapeHTML( zone->GetSelectMenuText( UNITS ) ),
|
||||||
EscapeHTML( REPORT_VALUE( local ) ) ) )
|
EscapeHTML( REPORT_VALUE( local ) ) ) )
|
||||||
|
|
||||||
|
|
|
@ -616,19 +616,38 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
if( constraint.m_ZoneConnection == ZONE_CONNECTION::THERMAL )
|
if( constraint.m_ZoneConnection == ZONE_CONNECTION::THERMAL )
|
||||||
{
|
{
|
||||||
|
r->Report( "" );
|
||||||
|
r->Report( "" );
|
||||||
|
reportHeader( _( "Thermal relief gap resolution for:" ), a, b, layer, r );
|
||||||
|
|
||||||
constraint = drcEngine.EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad, zone, layer, r );
|
constraint = drcEngine.EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad, zone, layer, r );
|
||||||
int gap = constraint.m_Value.Min();
|
int gap = constraint.m_Value.Min();
|
||||||
|
|
||||||
|
if( compileError )
|
||||||
|
reportCompileError( r );
|
||||||
|
|
||||||
|
r->Report( "" );
|
||||||
r->Report( wxString::Format( _( "Resolved thermal relief gap: %s." ),
|
r->Report( wxString::Format( _( "Resolved thermal relief gap: %s." ),
|
||||||
StringFromValue( units, gap, true ) ) );
|
StringFromValue( units, gap, true ) ) );
|
||||||
|
|
||||||
|
r->Report( "" );
|
||||||
|
r->Report( "" );
|
||||||
|
reportHeader( _( "Spoke width resolution for:" ), a, b, layer, r );
|
||||||
|
|
||||||
constraint = drcEngine.EvalRules( THERMAL_SPOKE_WIDTH_CONSTRAINT, pad, zone, layer, r );
|
constraint = drcEngine.EvalRules( THERMAL_SPOKE_WIDTH_CONSTRAINT, pad, zone, layer, r );
|
||||||
int width = constraint.m_Value.Opt();
|
int width = constraint.m_Value.Opt();
|
||||||
|
|
||||||
|
if( compileError )
|
||||||
|
reportCompileError( r );
|
||||||
|
|
||||||
r->Report( "" );
|
r->Report( "" );
|
||||||
r->Report( wxString::Format( _( "Resolved thermal spoke width: %s." ),
|
r->Report( wxString::Format( _( "Resolved thermal relief spoke width: %s." ),
|
||||||
StringFromValue( units, width, true ) ) );
|
StringFromValue( units, width, true ) ) );
|
||||||
|
|
||||||
|
r->Report( "" );
|
||||||
|
r->Report( "" );
|
||||||
|
reportHeader( _( "Spoke count resolution for:" ), a, b, layer, r );
|
||||||
|
|
||||||
constraint = drcEngine.EvalRules( MIN_RESOLVED_SPOKES_CONSTRAINT, pad, zone, layer, r );
|
constraint = drcEngine.EvalRules( MIN_RESOLVED_SPOKES_CONSTRAINT, pad, zone, layer, r );
|
||||||
int minSpokes = constraint.m_Value.Min();
|
int minSpokes = constraint.m_Value.Min();
|
||||||
|
|
||||||
|
@ -636,46 +655,71 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
||||||
reportCompileError( r );
|
reportCompileError( r );
|
||||||
|
|
||||||
r->Report( "" );
|
r->Report( "" );
|
||||||
r->Report( wxString::Format( _( "Minimum thermal spoke count: %d." ),
|
r->Report( wxString::Format( _( "Resolved min thermal relief spoke count: %d." ),
|
||||||
minSpokes ) );
|
minSpokes ) );
|
||||||
|
|
||||||
std::shared_ptr<CONNECTIVITY_DATA> connectivity = pad->GetBoard()->GetConnectivity();
|
std::shared_ptr<CONNECTIVITY_DATA> connectivity = pad->GetBoard()->GetConnectivity();
|
||||||
|
|
||||||
if( !alg::contains( connectivity->GetConnectedItems( pad, { PCB_ZONE_T } ), zone ) )
|
|
||||||
r->Report( _( "Items are not connected. No thermal spokes will be generated." ) );
|
|
||||||
}
|
}
|
||||||
else if( constraint.m_ZoneConnection == ZONE_CONNECTION::NONE )
|
else if( constraint.m_ZoneConnection == ZONE_CONNECTION::NONE )
|
||||||
{
|
{
|
||||||
|
r->Report( "" );
|
||||||
|
r->Report( "" );
|
||||||
|
reportHeader( _( "Zone clearance resolution for:" ), a, b, layer, r );
|
||||||
|
|
||||||
clearance = zone->GetLocalClearance();
|
clearance = zone->GetLocalClearance();
|
||||||
|
r->Report( "" );
|
||||||
r->Report( wxString::Format( _( "Zone clearance: %s." ),
|
r->Report( wxString::Format( _( "Zone clearance: %s." ),
|
||||||
StringFromValue( units, clearance, true ) ) );
|
StringFromValue( units, clearance, true ) ) );
|
||||||
|
|
||||||
constraint = drcEngine.EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad, zone, layer, r );
|
constraint = drcEngine.EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT, pad, zone, layer, r );
|
||||||
|
|
||||||
if( constraint.m_Value.Min() > clearance )
|
if( constraint.m_Value.Min() > clearance )
|
||||||
{
|
{
|
||||||
clearance = constraint.m_Value.Min();
|
clearance = constraint.m_Value.Min();
|
||||||
r->Report( wxString::Format( _( "Overridden by larger thermal relief from %s;"
|
|
||||||
|
r->Report( "" );
|
||||||
|
r->Report( wxString::Format( _( "Overridden by larger mechanical clearance from %s;"
|
||||||
"clearance: %s." ),
|
"clearance: %s." ),
|
||||||
EscapeHTML( constraint.GetName() ),
|
EscapeHTML( constraint.GetName() ),
|
||||||
StringFromValue( units, clearance, true ) ) );
|
StringFromValue( units, clearance, true ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !pad->FlashLayer( layer ) )
|
||||||
|
{
|
||||||
|
constraint = drcEngine.EvalRules( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT, pad, zone,
|
||||||
|
layer, r );
|
||||||
|
|
||||||
|
if( constraint.m_Value.Min() > clearance )
|
||||||
|
{
|
||||||
|
clearance = constraint.m_Value.Min();
|
||||||
|
|
||||||
|
r->Report( "" );
|
||||||
|
r->Report( wxString::Format( _( "Overridden by larger mechanical hole clearance from %s;"
|
||||||
|
"clearance: %s." ),
|
||||||
|
EscapeHTML( constraint.GetName() ),
|
||||||
|
StringFromValue( units, clearance, true ) ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( compileError )
|
if( compileError )
|
||||||
reportCompileError( r );
|
reportCompileError( r );
|
||||||
|
|
||||||
r->Report( "" );
|
r->Report( "" );
|
||||||
r->Report( wxString::Format( _( "Clearance: %s." ),
|
r->Report( wxString::Format( _( "Resolved clearance: %s." ),
|
||||||
StringFromValue( units, 0, true ) ) );
|
StringFromValue( units, clearance, true ) ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
r->Report( "" );
|
||||||
|
r->Report( "" );
|
||||||
|
reportHeader( _( "Zone clearance resolution for:" ), a, b, layer, r );
|
||||||
|
|
||||||
if( compileError )
|
if( compileError )
|
||||||
reportCompileError( r );
|
reportCompileError( r );
|
||||||
|
|
||||||
// Report a 0 clearance for solid connections
|
// Report a 0 clearance for solid connections
|
||||||
r->Report( "" );
|
r->Report( "" );
|
||||||
r->Report( wxString::Format( _( "Clearance: %s." ),
|
r->Report( wxString::Format( _( "Resolved clearance: %s." ),
|
||||||
StringFromValue( units, 0, true ) ) );
|
StringFromValue( units, 0, true ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -560,7 +560,8 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer
|
||||||
BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings();
|
BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings();
|
||||||
ZONE_CONNECTION connection;
|
ZONE_CONNECTION connection;
|
||||||
DRC_CONSTRAINT constraint;
|
DRC_CONSTRAINT constraint;
|
||||||
int gap;
|
int padClearance;
|
||||||
|
int holeClearance;
|
||||||
SHAPE_POLY_SET holes;
|
SHAPE_POLY_SET holes;
|
||||||
|
|
||||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||||
|
@ -595,11 +596,31 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer
|
||||||
case ZONE_CONNECTION::THERMAL:
|
case ZONE_CONNECTION::THERMAL:
|
||||||
constraint = bds.m_DRCEngine->EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad, aZone,
|
constraint = bds.m_DRCEngine->EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad, aZone,
|
||||||
aLayer );
|
aLayer );
|
||||||
gap = constraint.GetValue().Min();
|
padClearance = constraint.GetValue().Min();
|
||||||
|
holeClearance = padClearance;
|
||||||
|
|
||||||
|
if( pad->FlashLayer( aLayer ) )
|
||||||
|
aThermalConnectionPads.push_back( pad );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZONE_CONNECTION::NONE:
|
case ZONE_CONNECTION::NONE:
|
||||||
gap = aZone->GetLocalClearance();
|
constraint = bds.m_DRCEngine->EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT, pad,
|
||||||
|
aZone, aLayer );
|
||||||
|
|
||||||
|
if( constraint.GetValue().Min() > aZone->GetLocalClearance() )
|
||||||
|
padClearance = constraint.GetValue().Min();
|
||||||
|
else
|
||||||
|
padClearance = aZone->GetLocalClearance();
|
||||||
|
|
||||||
|
constraint = bds.m_DRCEngine->EvalRules( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT, pad,
|
||||||
|
aZone, aLayer );
|
||||||
|
|
||||||
|
if( constraint.GetValue().Min() > padClearance )
|
||||||
|
holeClearance = constraint.GetValue().Min();
|
||||||
|
else
|
||||||
|
holeClearance = padClearance;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -609,17 +630,16 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer
|
||||||
|
|
||||||
if( pad->FlashLayer( aLayer ) )
|
if( pad->FlashLayer( aLayer ) )
|
||||||
{
|
{
|
||||||
aThermalConnectionPads.push_back( pad );
|
addKnockout( pad, aLayer, padClearance, holes );
|
||||||
addKnockout( pad, aLayer, gap, holes );
|
|
||||||
}
|
}
|
||||||
else if( pad->GetDrillSize().x > 0 )
|
else if( pad->GetDrillSize().x > 0 )
|
||||||
{
|
{
|
||||||
// Note: drill size represents finish size, which means the actual holes size
|
// Note: drill size represents finish size, which means the actual holes size
|
||||||
// is the plating thickness larger.
|
// is the plating thickness larger.
|
||||||
if( pad->GetAttribute() == PAD_ATTRIB::PTH )
|
holeClearance += pad->GetBoard()->GetDesignSettings().GetHolePlatingThickness();
|
||||||
gap += pad->GetBoard()->GetDesignSettings().GetHolePlatingThickness();
|
|
||||||
|
|
||||||
pad->TransformHoleWithClearanceToPolygon( holes, gap, m_maxError, ERROR_OUTSIDE );
|
pad->TransformHoleWithClearanceToPolygon( holes, holeClearance, m_maxError,
|
||||||
|
ERROR_OUTSIDE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue