Fix wxCHECK_MSG in DRC

The layers check needs to look for testing against technical layers for
those vias that pass the outer layers
This commit is contained in:
Seth Hillbrand 2023-06-03 20:25:35 -07:00
parent 9da66ccb58
commit e4fe27993e
1 changed files with 24 additions and 2 deletions

View File

@ -647,7 +647,18 @@ int DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aItem
if( aItem->Type() == PCB_VIA_T ) if( aItem->Type() == PCB_VIA_T )
{ {
wxCHECK_MSG( aItem->GetLayerSet().Contains( aLayer ), violations, LSET layers = aItem->GetLayerSet();
if( layers.Contains( F_Cu ) )
layers |= LSET::FrontBoardTechMask().set( F_CrtYd );
if( layers.Contains( B_Cu ) )
layers |= LSET::BackBoardTechMask().set( B_CrtYd );
if( layers.Contains( F_Cu ) && layers.Contains( B_Cu ) )
layers |= LSET::AllCuMask();
wxCHECK_MSG( layers.Contains( aLayer ), violations,
wxT( "Bug! Vias should only be checked for layers on which they exist" ) ); wxT( "Bug! Vias should only be checked for layers on which they exist" ) );
itemHoleShape = aItem->GetEffectiveHoleShape(); itemHoleShape = aItem->GetEffectiveHoleShape();
@ -659,7 +670,18 @@ int DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aItem
if( other->Type() == PCB_VIA_T ) if( other->Type() == PCB_VIA_T )
{ {
wxCHECK_MSG( other->GetLayerSet().Contains( aLayer ), violations, LSET layers = other->GetLayerSet();
if( layers.Contains( F_Cu ) )
layers |= LSET::FrontBoardTechMask().set( F_CrtYd );
if( layers.Contains( B_Cu ) )
layers |= LSET::BackBoardTechMask().set( B_CrtYd );
if( layers.Contains( F_Cu ) && layers.Contains( B_Cu ) )
layers |= LSET::AllCuMask();
wxCHECK_MSG( layers.Contains( aLayer ), violations,
wxT( "Bug! Vias should only be checked for layers on which they exist" ) ); wxT( "Bug! Vias should only be checked for layers on which they exist" ) );
otherHoleShape = other->GetEffectiveHoleShape(); otherHoleShape = other->GetEffectiveHoleShape();