Improve SameLogicalPadAs() shorting nets test.

This is required to support 4cd26ab6bc.
This commit is contained in:
Jeff Young 2023-09-24 16:16:45 +01:00
parent f2fdf0f3df
commit d428b0e20e
1 changed files with 11 additions and 4 deletions

View File

@ -774,12 +774,19 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
if( otherPad && pad->SameLogicalPadAs( otherPad ) )
{
// If pads are equivalent (ie: from the same footprint with the same pad number)...
// ... and have nets...
// ... and have "real" nets...
// then they must be the same net
if( pad->GetNetCode() && otherPad->GetNetCode()
&& pad->GetNetCode() != otherPad->GetNetCode()
&& testShorting )
if( testShorting )
{
if( pad->GetNetCode() == 0 || pad->GetNetCode() == otherPad->GetNetCode() )
return !m_drcEngine->IsCancelled();
if( pad->GetShortNetname().StartsWith( wxS( "unconnected-(" ) )
&& otherPad->GetShortNetname().StartsWith( wxS( "unconnected-(" ) ) )
{
return !m_drcEngine->IsCancelled();
}
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_SHORTING_ITEMS );
wxString msg;