Browse Source

DIALOG_GLOBAL_EDIT_TEARDROPS: add option "Remove all teardrops"

"Remove teardrops" remove only teardrops allowed by the filtering/scope options
"Remove all teardrops" remove all existing teardrops
pcb_db
jean-pierre charras 1 year ago
parent
commit
d031652d9d
  1. 31
      pcbnew/dialogs/dialog_global_edit_teardrops.cpp
  2. 4
      pcbnew/dialogs/dialog_global_edit_teardrops_base.cpp
  3. 4
      pcbnew/dialogs/dialog_global_edit_teardrops_base.fbp

31
pcbnew/dialogs/dialog_global_edit_teardrops.cpp

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -125,7 +125,7 @@ protected:
}
void setSpecifiedParams( TEARDROP_PARAMETERS* targetParams );
void visitItem( BOARD_COMMIT* aCommit, BOARD_CONNECTED_ITEM* aItem );
void visitItem( BOARD_COMMIT* aCommit, BOARD_CONNECTED_ITEM* aItem,bool aSelectAlways );
void processItem( BOARD_COMMIT* aCommit, BOARD_CONNECTED_ITEM* aItem );
bool TransferDataToWindow() override;
@ -388,7 +388,9 @@ void DIALOG_GLOBAL_EDIT_TEARDROPS::processItem( BOARD_COMMIT* aCommit, BOARD_CON
}
void DIALOG_GLOBAL_EDIT_TEARDROPS::visitItem( BOARD_COMMIT* aCommit, BOARD_CONNECTED_ITEM* aItem )
void DIALOG_GLOBAL_EDIT_TEARDROPS::visitItem( BOARD_COMMIT* aCommit,
BOARD_CONNECTED_ITEM* aItem,
bool aSelectAlways )
{
if( m_selectedItemsFilter->GetValue() )
{
@ -404,6 +406,13 @@ void DIALOG_GLOBAL_EDIT_TEARDROPS::visitItem( BOARD_COMMIT* aCommit, BOARD_CONNE
}
}
if( aSelectAlways )
{
processItem( aCommit, aItem );
return;
}
if( m_netFilterOpt->GetValue() && m_netFilter->GetSelectedNetcode() >= 0 )
{
if( aItem->GetNetCode() != m_netFilter->GetSelectedNetcode() )
@ -465,12 +474,14 @@ bool DIALOG_GLOBAL_EDIT_TEARDROPS::TransferDataFromWindow()
bds.m_TeardropParamsList.m_TargetTrack2Track = m_trackToTrack->GetValue();
bds.m_TeardropParamsList.m_UseRoundShapesOnly = m_roundPadsFilter->GetValue();
if( m_vias->GetValue() )
bool remove_all = m_removeAllTeardrops->GetValue();
if( m_vias->GetValue() || remove_all )
{
for( PCB_TRACK* track : m_brd->Tracks() )
{
if ( track->Type() == PCB_VIA_T )
visitItem( &commit, track );
visitItem( &commit, track, remove_all );
}
}
@ -478,14 +489,20 @@ bool DIALOG_GLOBAL_EDIT_TEARDROPS::TransferDataFromWindow()
{
for( PAD* pad : footprint->Pads() )
{
if( remove_all )
{
visitItem( &commit, pad, true );
continue;
}
if( m_pthPads->GetValue() && pad->GetAttribute() == PAD_ATTRIB::PTH )
{
visitItem( &commit, pad );
visitItem( &commit, pad, false );
}
else if( m_smdPads->GetValue() && ( pad->GetAttribute() == PAD_ATTRIB::SMD
|| pad->GetAttribute() == PAD_ATTRIB::CONN ) )
{
visitItem( &commit, pad );
visitItem( &commit, pad, false );
}
}
}

4
pcbnew/dialogs/dialog_global_edit_teardrops_base.cpp

@ -112,9 +112,13 @@ DIALOG_GLOBAL_EDIT_TEARDROPS_BASE::DIALOG_GLOBAL_EDIT_TEARDROPS_BASE( wxWindow*
sbAction = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Action") ), wxVERTICAL );
m_removeTeardrops = new wxRadioButton( sbAction->GetStaticBox(), wxID_ANY, _("Remove teardrops"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_removeTeardrops->SetToolTip( _("Remove teardrops according to filtering options") );
sbAction->Add( m_removeTeardrops, 0, wxBOTTOM|wxRIGHT, 5 );
m_removeAllTeardrops = new wxRadioButton( sbAction->GetStaticBox(), wxID_ANY, _("Remove all teardrops"), wxDefaultPosition, wxDefaultSize, 0 );
m_removeAllTeardrops->SetToolTip( _("Remove all teadrops, regardless filtering options") );
sbAction->Add( m_removeAllTeardrops, 0, wxBOTTOM|wxRIGHT, 5 );
wxBoxSizer* bSizer12;

4
pcbnew/dialogs/dialog_global_edit_teardrops_base.fbp

@ -1094,7 +1094,7 @@
<property name="style">wxRB_GROUP</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="tooltip">Remove teardrops according to filtering options</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
@ -1159,7 +1159,7 @@
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="tooltip">Remove all teadrops, regardless filtering options</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>

Loading…
Cancel
Save