Improve disabled layer test.
1) handle graphic items on copper layers 2) handle items on multiple layers
This commit is contained in:
parent
567767346c
commit
bb2efa0649
|
@ -132,14 +132,11 @@ void DRC_TEST_PROVIDER_MISC::testDisabledLayers()
|
||||||
auto checkDisabledLayers =
|
auto checkDisabledLayers =
|
||||||
[&]( BOARD_ITEM* item ) -> bool
|
[&]( BOARD_ITEM* item ) -> bool
|
||||||
{
|
{
|
||||||
LSET refLayers ( item->GetLayer() );
|
if( ( disabledLayers & item->GetLayerSet() ).any() )
|
||||||
|
|
||||||
if( ( disabledLayers & refLayers ).any() )
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<DRC_ITEM>drcItem = DRC_ITEM::Create( DRCE_DISABLED_LAYER_ITEM );
|
std::shared_ptr<DRC_ITEM>drcItem = DRC_ITEM::Create( DRCE_DISABLED_LAYER_ITEM );
|
||||||
|
|
||||||
m_msg.Printf( _( "(layer %s)" ),
|
m_msg.Printf( _( "(layer %s)" ), item->GetLayerName() );
|
||||||
item->GetLayerName() );
|
|
||||||
|
|
||||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + m_msg );
|
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + m_msg );
|
||||||
drcItem->SetItems( item );
|
drcItem->SetItems( item );
|
||||||
|
@ -149,11 +146,10 @@ void DRC_TEST_PROVIDER_MISC::testDisabledLayers()
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// fixme: what about graphical items?
|
forEachGeometryItem( s_allBasicItems, LSET::AllLayersMask(), checkDisabledLayers );
|
||||||
forEachGeometryItem( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_ZONE_T, PCB_PAD_T },
|
|
||||||
LSET::AllLayersMask(), checkDisabledLayers );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DRC_TEST_PROVIDER_MISC::testTextVars()
|
void DRC_TEST_PROVIDER_MISC::testTextVars()
|
||||||
{
|
{
|
||||||
auto checkUnresolvedTextVar =
|
auto checkUnresolvedTextVar =
|
||||||
|
|
Loading…
Reference in New Issue