Check keepTopBottom when determining whether or not to flash a pad/via.

Fixes https://gitlab.com/kicad/code/kicad/issues/12961
This commit is contained in:
Jeff Young 2022-11-22 18:18:07 +00:00
parent 729e64f33a
commit b42d5da07d
4 changed files with 29 additions and 7 deletions

View File

@ -763,14 +763,14 @@ void CN_VISITOR::checkZoneItemConnection( CN_ZONE_LAYER* aZoneLayer, CN_ITEM* aI
{
PAD* pad = static_cast<PAD*>( item );
if( pad->GetRemoveUnconnected() && pad->ZoneConnectionCache( layer ) == ZLC_UNCONNECTED )
if( pad->ConditionallyFlashed( layer ) && pad->ZoneConnectionCache( layer ) == ZLC_UNCONNECTED )
return;
}
else if( item->Type() == PCB_VIA_T )
{
PCB_VIA* via = static_cast<PCB_VIA*>( item );
if( via->GetRemoveUnconnected() && via->ZoneConnectionCache( layer ) == ZLC_UNCONNECTED )
if( via->ConditionallyFlashed( layer ) && via->ZoneConnectionCache( layer ) == ZLC_UNCONNECTED )
return;
}
@ -897,23 +897,23 @@ bool CN_VISITOR::operator()( CN_ITEM* aCandidate )
if( const PAD* pad = dyn_cast<const PAD*>( parentA ) )
{
if( !pad->GetRemoveUnconnected() || ( ( layer == F_Cu || layer == B_Cu ) && pad->GetKeepTopBottom() ) )
if( !pad->ConditionallyFlashed( layer ) )
flashingA = FLASHING::ALWAYS_FLASHED;
}
else if( const PCB_VIA* via = dyn_cast<const PCB_VIA*>( parentA ) )
{
if( !via->GetRemoveUnconnected() || ( ( layer == F_Cu || layer == B_Cu ) && via->GetKeepTopBottom() ) )
if( !via->ConditionallyFlashed( layer ) )
flashingA = FLASHING::ALWAYS_FLASHED;
}
if( const PAD* pad = dyn_cast<const PAD*>( parentB ) )
{
if( !pad->GetRemoveUnconnected() || ( ( layer == F_Cu || layer == B_Cu ) && pad->GetKeepTopBottom() ) )
if( !pad->ConditionallyFlashed( layer ) )
flashingB = FLASHING::ALWAYS_FLASHED;
}
else if( const PCB_VIA* via = dyn_cast<const PCB_VIA*>( parentB ) )
{
if( !via->GetRemoveUnconnected() || ( ( layer == F_Cu || layer == B_Cu ) && via->GetKeepTopBottom() ) )
if( !via->ConditionallyFlashed( layer ) )
flashingB = FLASHING::ALWAYS_FLASHED;
}

View File

@ -609,6 +609,17 @@ public:
void SetKeepTopBottom( bool aSet ) { m_keepTopBottomLayer = aSet; }
bool GetKeepTopBottom() const { return m_keepTopBottomLayer; }
bool ConditionallyFlashed( PCB_LAYER_ID aLayer ) const
{
if( !m_removeUnconnectedLayer )
return false;
if( m_keepTopBottomLayer && ( aLayer == F_Cu || aLayer == B_Cu ) )
return false;
return true;
}
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
bool IsOnLayer( PCB_LAYER_ID aLayer ) const override

View File

@ -479,6 +479,17 @@ public:
void SetKeepTopBottom( bool aSet ) { m_keepTopBottomLayer = aSet; }
bool GetKeepTopBottom() const { return m_keepTopBottomLayer; }
bool ConditionallyFlashed( PCB_LAYER_ID aLayer ) const
{
if( !m_removeUnconnectedLayer )
return false;
if( m_keepTopBottomLayer && ( aLayer == F_Cu || aLayer == B_Cu ) )
return false;
return true;
}
/**
* Checks to see whether the via should have a pad on the specific layer
* @param aLayer Layer to check for connectivity

View File

@ -294,7 +294,7 @@ bool ZONE_FILLER::Fill( std::vector<ZONE*>& aZones, bool aCheck, wxWindow* aPare
{
PCB_VIA* via = static_cast<PCB_VIA*>( track );
if( !via->IsOnLayer( layer ) || !via->GetRemoveUnconnected() )
if( !via->IsOnLayer( layer ) || !via->ConditionallyFlashed( layer ) )
continue;
if( via->ZoneConnectionCache( layer ) == ZLC_UNRESOLVED