From bb2efa0649effeabddac1313802c5d53f9bc4f1a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 9 Sep 2021 15:17:19 +0100 Subject: [PATCH] Improve disabled layer test. 1) handle graphic items on copper layers 2) handle items on multiple layers --- pcbnew/drc/drc_test_provider_misc.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_misc.cpp b/pcbnew/drc/drc_test_provider_misc.cpp index 800df1d34d..0b282ee095 100644 --- a/pcbnew/drc/drc_test_provider_misc.cpp +++ b/pcbnew/drc/drc_test_provider_misc.cpp @@ -132,14 +132,11 @@ void DRC_TEST_PROVIDER_MISC::testDisabledLayers() auto checkDisabledLayers = [&]( BOARD_ITEM* item ) -> bool { - LSET refLayers ( item->GetLayer() ); - - if( ( disabledLayers & refLayers ).any() ) + if( ( disabledLayers & item->GetLayerSet() ).any() ) { std::shared_ptrdrcItem = DRC_ITEM::Create( DRCE_DISABLED_LAYER_ITEM ); - m_msg.Printf( _( "(layer %s)" ), - item->GetLayerName() ); + m_msg.Printf( _( "(layer %s)" ), item->GetLayerName() ); drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + m_msg ); drcItem->SetItems( item ); @@ -149,11 +146,10 @@ void DRC_TEST_PROVIDER_MISC::testDisabledLayers() return true; }; - // fixme: what about graphical items? - forEachGeometryItem( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_ZONE_T, PCB_PAD_T }, - LSET::AllLayersMask(), checkDisabledLayers ); + forEachGeometryItem( s_allBasicItems, LSET::AllLayersMask(), checkDisabledLayers ); } + void DRC_TEST_PROVIDER_MISC::testTextVars() { auto checkUnresolvedTextVar =