Don't ask for layer of multi-layer objects.

This commit is contained in:
Jeff Young 2022-02-18 14:19:13 +00:00
parent 89907a18ce
commit 1ee3ce45e8
4 changed files with 17 additions and 1 deletions

View File

@ -158,7 +158,7 @@ void DRC_TEST_PROVIDER_MISC::testDisabledLayers()
if( pad->GetAttribute() == PAD_ATTRIB::SMD
|| pad->GetAttribute() == PAD_ATTRIB::CONN )
{
if( disabledLayers.test( item->GetLayer() ) )
if( disabledLayers.test( pad->GetPrincipalLayer() ) )
badLayer = item->GetLayer();
}
else

View File

@ -208,6 +208,16 @@ PCB_LAYER_ID PAD::GetLayer() const
}
PCB_LAYER_ID PAD::GetPrincipalLayer() const
{
if( m_attribute == PAD_ATTRIB::SMD || m_attribute == PAD_ATTRIB::CONN )
return m_layer;
wxFAIL_MSG( wxT( "Non-SMD/CONN pads have no principal layer." ) );
return m_layer;
}
bool PAD::FlashLayer( LSET aLayers ) const
{
for( auto layer : aLayers.Seq() )

View File

@ -587,6 +587,11 @@ public:
PCB_LAYER_ID GetLayer() const override;
/**
* @return the principal copper layer for SMD and CONN pads.
*/
PCB_LAYER_ID GetPrincipalLayer() const;
/**
* Check to see if the pad should be flashed to any of the layers in the set.
*

View File

@ -5735,6 +5735,7 @@ ZONE* PCB_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent )
}
else
{
// for legacy, single-layer zones
filledLayer = zone->GetFirstLayer();
}