Limit checks need to be done at start, not end.

(We also use the limit checks to ignore violations.)

Fixes https://gitlab.com/kicad/code/kicad/issues/5831
This commit is contained in:
Jeff Young 2020-09-29 21:22:45 +01:00
parent 2cf303bb09
commit ab033327c7
2 changed files with 8 additions and 3 deletions

View File

@ -124,6 +124,9 @@ bool test::DRC_TEST_PROVIDER_SILK_TO_PAD::Run()
DRC_RTREE::ITEM_WITH_SHAPE* aRefItem, DRC_RTREE::ITEM_WITH_SHAPE* aRefItem,
DRC_RTREE::ITEM_WITH_SHAPE* aTestItem ) -> bool DRC_RTREE::ITEM_WITH_SHAPE* aTestItem ) -> bool
{ {
if( m_drcEngine->IsErrorLimitExceeded( DRCE_SILK_OVER_PAD ) )
return false;
auto constraint = m_drcEngine->EvalRulesForItems( DRC_CONSTRAINT_TYPE_SILK_TO_PAD, auto constraint = m_drcEngine->EvalRulesForItems( DRC_CONSTRAINT_TYPE_SILK_TO_PAD,
aRefItem->parent, aRefItem->parent,
aTestItem->parent ); aTestItem->parent );
@ -145,8 +148,7 @@ bool test::DRC_TEST_PROVIDER_SILK_TO_PAD::Run()
reportViolation( drcItem, (wxPoint) pos ); reportViolation( drcItem, (wxPoint) pos );
return true;
return !m_drcEngine->IsErrorLimitExceeded( DRCE_SILK_OVER_PAD );
}; };
int numPads = forEachGeometryItem( { PCB_PAD_T }, LSET::AllTechMask() | LSET::AllCuMask(), int numPads = forEachGeometryItem( { PCB_PAD_T }, LSET::AllTechMask() | LSET::AllCuMask(),

View File

@ -111,6 +111,9 @@ bool DRC_TEST_PROVIDER_SILK_TO_SILK::Run()
DRC_RTREE::ITEM_WITH_SHAPE* aRefItem, DRC_RTREE::ITEM_WITH_SHAPE* aRefItem,
DRC_RTREE::ITEM_WITH_SHAPE* aTestItem ) -> bool DRC_RTREE::ITEM_WITH_SHAPE* aTestItem ) -> bool
{ {
if( m_drcEngine->IsErrorLimitExceeded( DRCE_SILK_CLEARANCE ) )
return false;
auto constraint = m_drcEngine->EvalRulesForItems( DRC_CONSTRAINT_TYPE_SILK_TO_SILK, auto constraint = m_drcEngine->EvalRulesForItems( DRC_CONSTRAINT_TYPE_SILK_TO_SILK,
aRefItem->parent, aRefItem->parent,
aTestItem->parent ); aTestItem->parent );
@ -171,7 +174,7 @@ bool DRC_TEST_PROVIDER_SILK_TO_SILK::Run()
reportViolation( drcItem, (wxPoint) pos ); reportViolation( drcItem, (wxPoint) pos );
return !m_drcEngine->IsErrorLimitExceeded( DRCE_SILK_CLEARANCE ); return true;
}; };
int numSilk = forEachGeometryItem( { PCB_LINE_T, PCB_MODULE_EDGE_T, PCB_TEXT_T, PCB_MODULE_TEXT_T }, int numSilk = forEachGeometryItem( { PCB_LINE_T, PCB_MODULE_EDGE_T, PCB_TEXT_T, PCB_MODULE_TEXT_T },