Change via keep-start-end to be start/end, not top/bottom.

The implementation used to always check F_Cu and B_Cu, rather than
where the via started and ended (which will be different for blind/
buried vias and microvias).
This commit is contained in:
Jeff Young 2022-11-23 13:43:31 +00:00
parent 199743e8b0
commit 1aad2fb37b
6 changed files with 16 additions and 16 deletions

View File

@ -106,7 +106,7 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
{ {
if( !via->GetRemoveUnconnected() ) if( !via->GetRemoveUnconnected() )
return 0; return 0;
else if( via->GetKeepTopBottom() ) else if( via->GetKeepStartEnd() )
return 1; return 1;
else else
return 2; return 2;
@ -607,11 +607,11 @@ bool DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow()
break; break;
case 1: case 1:
v->SetRemoveUnconnected( true ); v->SetRemoveUnconnected( true );
v->SetKeepTopBottom( true ); v->SetKeepStartEnd( true );
break; break;
case 2: case 2:
v->SetRemoveUnconnected( true ); v->SetRemoveUnconnected( true );
v->SetKeepTopBottom( false ); v->SetKeepStartEnd( false );
break; break;
default: default:
break; break;

View File

@ -93,7 +93,7 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow()
{ {
PCB_VIA* via = static_cast<PCB_VIA*>( item ); PCB_VIA* via = static_cast<PCB_VIA*>( item );
via->SetRemoveUnconnected( m_rbAction->GetSelection() == PAD_ACTION_REMOVE ); via->SetRemoveUnconnected( m_rbAction->GetSelection() == PAD_ACTION_REMOVE );
via->SetKeepTopBottom( m_cbPreservePads->IsChecked() ); via->SetKeepStartEnd( m_cbPreservePads->IsChecked() );
} }
if( item->Type() == PCB_FOOTPRINT_T && m_cbPads->IsChecked() ) if( item->Type() == PCB_FOOTPRINT_T && m_cbPads->IsChecked() )
@ -142,7 +142,7 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow()
m_commit.Modify( item ); m_commit.Modify( item );
PCB_VIA* via = static_cast<PCB_VIA*>( item ); PCB_VIA* via = static_cast<PCB_VIA*>( item );
via->SetRemoveUnconnected( m_rbAction->GetSelection() == PAD_ACTION_REMOVE ); via->SetRemoveUnconnected( m_rbAction->GetSelection() == PAD_ACTION_REMOVE );
via->SetKeepTopBottom( m_cbPreservePads->IsChecked() ); via->SetKeepStartEnd( m_cbPreservePads->IsChecked() );
} }
} }
} }

View File

@ -87,7 +87,7 @@ PCB_VIA::PCB_VIA( BOARD_ITEM* aParent ) :
SetDrillDefault(); SetDrillDefault();
m_removeUnconnectedLayer = false; m_removeUnconnectedLayer = false;
m_keepTopBottomLayer = true; m_keepStartEndLayer = true;
for( size_t ii = 0; ii < arrayDim( m_zoneLayerConnections ); ++ii ) for( size_t ii = 0; ii < arrayDim( m_zoneLayerConnections ); ++ii )
m_zoneLayerConnections[ ii ] = ZLC_UNCONNECTED; m_zoneLayerConnections[ ii ] = ZLC_UNCONNECTED;
@ -615,7 +615,7 @@ bool PCB_VIA::FlashLayer( int aLayer ) const
if( !m_removeUnconnectedLayer ) if( !m_removeUnconnectedLayer )
return true; return true;
if( m_keepTopBottomLayer && ( aLayer == m_layer || aLayer == m_bottomLayer ) ) if( m_keepStartEndLayer && ( aLayer == m_layer || aLayer == m_bottomLayer ) )
return true; return true;
// Must be static to keep from raising its ugly head in performance profiles // Must be static to keep from raising its ugly head in performance profiles

View File

@ -474,17 +474,17 @@ public:
bool GetRemoveUnconnected() const { return m_removeUnconnectedLayer; } bool GetRemoveUnconnected() const { return m_removeUnconnectedLayer; }
/** /**
* Sets whether we keep the top and bottom connections even if they are not connected * Sets whether we keep the start and end annular rings even if they are not connected
*/ */
void SetKeepTopBottom( bool aSet ) { m_keepTopBottomLayer = aSet; } void SetKeepStartEnd( bool aSet ) { m_keepStartEndLayer = aSet; }
bool GetKeepTopBottom() const { return m_keepTopBottomLayer; } bool GetKeepStartEnd() const { return m_keepStartEndLayer; }
bool ConditionallyFlashed( PCB_LAYER_ID aLayer ) const bool ConditionallyFlashed( PCB_LAYER_ID aLayer ) const
{ {
if( !m_removeUnconnectedLayer ) if( !m_removeUnconnectedLayer )
return false; return false;
if( m_keepTopBottomLayer && ( aLayer == F_Cu || aLayer == B_Cu ) ) if( m_keepStartEndLayer && ( aLayer == m_layer || aLayer == m_bottomLayer ) )
return false; return false;
return true; return true;
@ -574,8 +574,8 @@ private:
int m_drill; ///< for vias: via drill (- 1 for default value) int m_drill; ///< for vias: via drill (- 1 for default value)
bool m_removeUnconnectedLayer; ///< Remove unconnected copper on a via bool m_removeUnconnectedLayer; ///< Remove annular rings on unconnected layers
bool m_keepTopBottomLayer; ///< Keep the top and bottom annular rings bool m_keepStartEndLayer; ///< Keep the start and end annular rings
bool m_isFree; ///< "Free" vias don't get their nets auto-updated bool m_isFree; ///< "Free" vias don't get their nets auto-updated
mutable ZONE_LAYER_CONNECTION m_zoneLayerConnections[B_Cu + 1]; mutable ZONE_LAYER_CONNECTION m_zoneLayerConnections[B_Cu + 1];

View File

@ -5369,7 +5369,7 @@ PCB_VIA* PCB_PARSER::parsePCB_VIA()
// File format default is no-token == no-feature. // File format default is no-token == no-feature.
via->SetRemoveUnconnected( false ); via->SetRemoveUnconnected( false );
via->SetKeepTopBottom( false ); via->SetKeepStartEnd( false );
for( token = NextTok(); token != T_RIGHT; token = NextTok() ) for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{ {
@ -5438,7 +5438,7 @@ PCB_VIA* PCB_PARSER::parsePCB_VIA()
break; break;
case T_keep_end_layers: case T_keep_end_layers:
via->SetKeepTopBottom( true ); via->SetKeepStartEnd( true );
NeedRIGHT(); NeedRIGHT();
break; break;

View File

@ -2146,7 +2146,7 @@ void PCB_PLUGIN::format( const PCB_TRACK* aTrack, int aNestLevel ) const
{ {
m_out->Print( 0, " (remove_unused_layers)" ); m_out->Print( 0, " (remove_unused_layers)" );
if( via->GetKeepTopBottom() ) if( via->GetKeepStartEnd() )
m_out->Print( 0, " (keep_end_layers)" ); m_out->Print( 0, " (keep_end_layers)" );
} }