Post-process board min clearance rather than building it in to netclasses.
The later makes the diagnostic messages harder to decipher.
This commit is contained in:
parent
babfb29c54
commit
bf2566a44f
|
@ -150,10 +150,6 @@ void DRC_ENGINE::loadImplicitRules()
|
||||||
|
|
||||||
std::shared_ptr<DRC_RULE> rule = createImplicitRule( _( "board setup constraints" ) );
|
std::shared_ptr<DRC_RULE> rule = createImplicitRule( _( "board setup constraints" ) );
|
||||||
|
|
||||||
DRC_CONSTRAINT clearanceConstraint( CLEARANCE_CONSTRAINT );
|
|
||||||
clearanceConstraint.Value().SetMin( bds.m_MinClearance );
|
|
||||||
rule->AddConstraint( clearanceConstraint );
|
|
||||||
|
|
||||||
DRC_CONSTRAINT widthConstraint( TRACK_WIDTH_CONSTRAINT );
|
DRC_CONSTRAINT widthConstraint( TRACK_WIDTH_CONSTRAINT );
|
||||||
widthConstraint.Value().SetMin( bds.m_TrackMinWidth );
|
widthConstraint.Value().SetMin( bds.m_TrackMinWidth );
|
||||||
rule->AddConstraint( widthConstraint );
|
rule->AddConstraint( widthConstraint );
|
||||||
|
@ -174,10 +170,6 @@ void DRC_ENGINE::loadImplicitRules()
|
||||||
holeToHoleConstraint.Value().SetMin( bds.m_HoleToHoleMin );
|
holeToHoleConstraint.Value().SetMin( bds.m_HoleToHoleMin );
|
||||||
rule->AddConstraint( holeToHoleConstraint );
|
rule->AddConstraint( holeToHoleConstraint );
|
||||||
|
|
||||||
DRC_CONSTRAINT diffPairGapConstraint( DIFF_PAIR_GAP_CONSTRAINT );
|
|
||||||
diffPairGapConstraint.Value().SetMin( bds.m_MinClearance );
|
|
||||||
rule->AddConstraint( diffPairGapConstraint );
|
|
||||||
|
|
||||||
rule = createImplicitRule( _( "default" ) );
|
rule = createImplicitRule( _( "default" ) );
|
||||||
|
|
||||||
DRC_CONSTRAINT thermalSpokeCountConstraint( MIN_RESOLVED_SPOKES_CONSTRAINT );
|
DRC_CONSTRAINT thermalSpokeCountConstraint( MIN_RESOLVED_SPOKES_CONSTRAINT );
|
||||||
|
@ -273,8 +265,7 @@ void DRC_ENGINE::loadImplicitRules()
|
||||||
if( nc->GetClearance() )
|
if( nc->GetClearance() )
|
||||||
{
|
{
|
||||||
DRC_CONSTRAINT constraint( CLEARANCE_CONSTRAINT );
|
DRC_CONSTRAINT constraint( CLEARANCE_CONSTRAINT );
|
||||||
constraint.Value().SetMin( std::max( bds.m_MinClearance,
|
constraint.Value().SetMin( nc->GetClearance() );
|
||||||
nc->GetClearance() ) );
|
|
||||||
netclassRule->AddConstraint( constraint );
|
netclassRule->AddConstraint( constraint );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,8 +312,7 @@ void DRC_ENGINE::loadImplicitRules()
|
||||||
constraint.Value().SetOpt( nc->GetDiffPairGap() );
|
constraint.Value().SetOpt( nc->GetDiffPairGap() );
|
||||||
netclassRule->AddConstraint( constraint );
|
netclassRule->AddConstraint( constraint );
|
||||||
|
|
||||||
// A narrower diffpair gap overrides the netclass min clearance (but is still
|
// A narrower diffpair gap overrides the netclass min clearance
|
||||||
// trimmed to the board min clearance, which is absolute).
|
|
||||||
if( nc->GetDiffPairGap() < nc->GetClearance() )
|
if( nc->GetDiffPairGap() < nc->GetClearance() )
|
||||||
{
|
{
|
||||||
netclassRule = std::make_shared<DRC_RULE>();
|
netclassRule = std::make_shared<DRC_RULE>();
|
||||||
|
@ -336,8 +326,7 @@ void DRC_ENGINE::loadImplicitRules()
|
||||||
netclassItemSpecificRules.push_back( netclassRule );
|
netclassItemSpecificRules.push_back( netclassRule );
|
||||||
|
|
||||||
DRC_CONSTRAINT min_clearanceConstraint( CLEARANCE_CONSTRAINT );
|
DRC_CONSTRAINT min_clearanceConstraint( CLEARANCE_CONSTRAINT );
|
||||||
min_clearanceConstraint.Value().SetMin( std::max( bds.m_MinClearance,
|
min_clearanceConstraint.Value().SetMin( nc->GetDiffPairGap() );
|
||||||
nc->GetDiffPairGap() ) );
|
|
||||||
netclassRule->AddConstraint( min_clearanceConstraint );
|
netclassRule->AddConstraint( min_clearanceConstraint );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1320,7 +1309,12 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||||
REPORT_VALUE( localA ) ) )
|
REPORT_VALUE( localA ) ) )
|
||||||
|
|
||||||
if( localA > clearance )
|
if( localA > clearance )
|
||||||
|
{
|
||||||
clearance = ac->GetLocalClearance( &m_msg );
|
clearance = ac->GetLocalClearance( &m_msg );
|
||||||
|
constraint.SetParentRule( nullptr );
|
||||||
|
constraint.SetName( m_msg );
|
||||||
|
constraint.m_Value.SetMin( clearance );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( localB > 0 )
|
if( localB > 0 )
|
||||||
|
@ -1331,16 +1325,41 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||||
REPORT_VALUE( localB ) ) )
|
REPORT_VALUE( localB ) ) )
|
||||||
|
|
||||||
if( localB > clearance )
|
if( localB > clearance )
|
||||||
|
{
|
||||||
clearance = bc->GetLocalClearance( &m_msg );
|
clearance = bc->GetLocalClearance( &m_msg );
|
||||||
|
constraint.SetParentRule( nullptr );
|
||||||
|
constraint.SetName( m_msg );
|
||||||
|
constraint.m_Value.SetMin( clearance );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( localA > global || localB > global )
|
REPORT( "" )
|
||||||
|
REPORT( wxString::Format( _( "Board minimum clearance: %s." ),
|
||||||
|
REPORT_VALUE( m_designSettings->m_MinClearance ) ) )
|
||||||
|
|
||||||
|
if( clearance < m_designSettings->m_MinClearance )
|
||||||
{
|
{
|
||||||
constraint.SetParentRule( nullptr );
|
constraint.SetParentRule( nullptr );
|
||||||
constraint.SetName( m_msg );
|
constraint.SetName( _( "board minimum" ) );
|
||||||
constraint.m_Value.SetMin( clearance );
|
constraint.m_Value.SetMin( m_designSettings->m_MinClearance );
|
||||||
return constraint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return constraint;
|
||||||
|
}
|
||||||
|
else if( aConstraintType == DIFF_PAIR_GAP_CONSTRAINT )
|
||||||
|
{
|
||||||
|
REPORT( "" )
|
||||||
|
REPORT( wxString::Format( _( "Board minimum clearance: %s." ),
|
||||||
|
REPORT_VALUE( m_designSettings->m_MinClearance ) ) )
|
||||||
|
|
||||||
|
if( constraint.m_Value.Min() < m_designSettings->m_MinClearance )
|
||||||
|
{
|
||||||
|
constraint.SetParentRule( nullptr );
|
||||||
|
constraint.SetName( _( "board minimum" ) );
|
||||||
|
constraint.m_Value.SetMin( m_designSettings->m_MinClearance );
|
||||||
|
}
|
||||||
|
|
||||||
|
return constraint;
|
||||||
}
|
}
|
||||||
else if( aConstraintType == ZONE_CONNECTION_CONSTRAINT )
|
else if( aConstraintType == ZONE_CONNECTION_CONSTRAINT )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue