From 3a66f33d9601071dccf83c130e35cd9b25de2c72 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 27 Jan 2022 11:24:10 +0100 Subject: [PATCH] TEARDROP_MANAGER: add option to add teardrops on pads in zones. --- pcbnew/board_design_settings.cpp | 34 ++++---- pcbnew/teardrop/dialog_teardrop.cpp | 11 +-- pcbnew/teardrop/dialog_teardrop_base.cpp | 41 ++++++---- pcbnew/teardrop/dialog_teardrop_base.fbp | 100 +++++++++++++++++++---- pcbnew/teardrop/dialog_teardrop_base.h | 1 + pcbnew/teardrop/teardrop.cpp | 5 +- pcbnew/teardrop/teardrop.h | 2 - pcbnew/teardrop/teardrop_parameters.h | 6 +- 8 files changed, 137 insertions(+), 63 deletions(-) diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 866e00605e..daa5d9f6be 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -461,6 +461,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: entry["td_onroundshapesonly"] = m_TeardropParamsList.m_UseRoundShapesOnly; entry["td_allow_use_two_tracks"] = m_TeardropParamsList.m_AllowUseTwoTracks; entry["td_curve_segcount"] = m_TeardropParamsList.m_CurveSegCount; + entry["td_on_pad_in_zone"] = m_TeardropParamsList.m_TdOnPadsInZones; js.push_back( entry ); @@ -476,21 +477,26 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: if( entry.empty() || !entry.is_object() ) continue; - if( !entry.contains( "td_onviapad" ) - || !entry.contains( "td_onpadsmd" ) - || !entry.contains( "td_ontrackend" ) - || !entry.contains( "td_onroundshapesonly" ) - || !entry.contains( "td_allow_use_two_tracks" ) - || !entry.contains( "td_curve_segcount" ) - ) - continue; + if( entry.contains( "td_onviapad" ) ) + m_TeardropParamsList.m_TargetViasPads = entry["td_onviapad"].get(); - m_TeardropParamsList.m_TargetViasPads = entry["td_onviapad"].get(); - m_TeardropParamsList.m_TargetPadsWithNoHole = entry["td_onpadsmd"].get(); - m_TeardropParamsList.m_TargetTrack2Track = entry["td_ontrackend"].get(); - m_TeardropParamsList.m_UseRoundShapesOnly = entry["td_onroundshapesonly"].get(); - m_TeardropParamsList.m_AllowUseTwoTracks = entry["td_allow_use_two_tracks"].get(); - m_TeardropParamsList.m_CurveSegCount = entry["td_curve_segcount"].get(); + if( entry.contains( "td_onpadsmd" ) ) + m_TeardropParamsList.m_TargetPadsWithNoHole = entry["td_onpadsmd"].get(); + + if( entry.contains( "td_ontrackend" ) ) + m_TeardropParamsList.m_TargetTrack2Track = entry["td_ontrackend"].get(); + + if( entry.contains( "td_onroundshapesonly" ) ) + m_TeardropParamsList.m_UseRoundShapesOnly = entry["td_onroundshapesonly"].get(); + + if( entry.contains( "td_allow_use_two_tracks" ) ) + m_TeardropParamsList.m_AllowUseTwoTracks = entry["td_allow_use_two_tracks"].get(); + + if( entry.contains( "td_curve_segcount" ) ) + m_TeardropParamsList.m_CurveSegCount = entry["td_curve_segcount"].get(); + + if( entry.contains( "td_on_pad_in_zone" ) ) + m_TeardropParamsList.m_TdOnPadsInZones = entry["td_on_pad_in_zone"].get(); } }, {} ) ); diff --git a/pcbnew/teardrop/dialog_teardrop.cpp b/pcbnew/teardrop/dialog_teardrop.cpp index 663b8b190c..bf0c204d26 100644 --- a/pcbnew/teardrop/dialog_teardrop.cpp +++ b/pcbnew/teardrop/dialog_teardrop.cpp @@ -64,6 +64,7 @@ public: m_cbSmdSimilarPads->SetValue( prmsList->m_TargetPadsWithNoHole ); m_cbRoundShapesOnly->SetValue( prmsList->m_UseRoundShapesOnly ); m_cbTrack2Track->SetValue( prmsList->m_TargetTrack2Track ); + m_cbPadsInZones->SetValue( prmsList->m_TdOnPadsInZones ); m_cbOptUseNextTrack->SetValue( prmsList->m_AllowUseTwoTracks ); m_spPointCount->SetValue( prmsList->m_CurveSegCount ); @@ -110,6 +111,7 @@ public: prmsList->m_TargetPadsWithNoHole = m_cbSmdSimilarPads->GetValue(); prmsList->m_UseRoundShapesOnly = m_cbRoundShapesOnly->GetValue(); prmsList->m_TargetTrack2Track = m_cbTrack2Track->GetValue(); + prmsList->m_TdOnPadsInZones = m_cbPadsInZones->GetValue(); prmsList->m_AllowUseTwoTracks = m_cbOptUseNextTrack->GetValue(); prmsList->m_CurveSegCount = m_spPointCount->GetValue(); @@ -206,16 +208,11 @@ void PCB_EDIT_FRAME::OnRunTeardropTool( wxCommandEvent& event ) dlg.TransferToParamList(); TEARDROP_MANAGER trdm( GetBoard(), this ); - const bool discardTeardropInSameZone = true; - - int added_count = trdm.SetTeardrops( &committer, - discardTeardropInSameZone, - dlg.CanUseTwoTracks() ); + int added_count = trdm.SetTeardrops( &committer, dlg.CanUseTwoTracks() ); m_infoBar->RemoveAllButtons(); m_infoBar->AddCloseButton(); - m_infoBar->ShowMessageFor( wxString::Format( _( "%d Teardrops created" ), - added_count ), + m_infoBar->ShowMessageFor( wxString::Format( _( "%d Teardrops created" ), added_count ), 1000, wxICON_EXCLAMATION ); } diff --git a/pcbnew/teardrop/dialog_teardrop_base.cpp b/pcbnew/teardrop/dialog_teardrop_base.cpp index b64205add0..ad4c752404 100644 --- a/pcbnew/teardrop/dialog_teardrop_base.cpp +++ b/pcbnew/teardrop/dialog_teardrop_base.cpp @@ -47,25 +47,25 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stMaxLenRound = new wxStaticText( this, wxID_ANY, _("Max length"), wxDefaultPosition, wxDefaultSize, 0 ); m_stMaxLenRound->Wrap( -1 ); - fgSizerParmRound->Add( m_stMaxLenRound, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmRound->Add( m_stMaxLenRound, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_tcTdMaxLenRound = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerParmRound->Add( m_tcTdMaxLenRound, 0, wxALL|wxEXPAND, 5 ); m_stTdMaxSizeRound = new wxStaticText( this, wxID_ANY, _("Max height"), wxDefaultPosition, wxDefaultSize, 0 ); m_stTdMaxSizeRound->Wrap( -1 ); - fgSizerParmRound->Add( m_stTdMaxSizeRound, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmRound->Add( m_stTdMaxSizeRound, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_tcMaxHeightRound = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerParmRound->Add( m_tcMaxHeightRound, 0, wxALL|wxEXPAND, 5 ); m_stLenUnitRound = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_stLenUnitRound->Wrap( -1 ); - fgSizerParmRound->Add( m_stLenUnitRound, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizerParmRound->Add( m_stLenUnitRound, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); m_stHsettingRound = new wxStaticText( this, wxID_ANY, _("Best length"), wxDefaultPosition, wxDefaultSize, 0 ); m_stHsettingRound->Wrap( -1 ); - fgSizerParmRound->Add( m_stHsettingRound, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmRound->Add( m_stHsettingRound, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_spTeardropLenPercentRound = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 20, 100, 50.000000, 10 ); m_spTeardropLenPercentRound->SetDigits( 0 ); @@ -73,7 +73,7 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stVsettingRound = new wxStaticText( this, wxID_ANY, _("Best height"), wxDefaultPosition, wxDefaultSize, 0 ); m_stVsettingRound->Wrap( -1 ); - fgSizerParmRound->Add( m_stVsettingRound, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmRound->Add( m_stVsettingRound, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_spTeardropSizePercentRound = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 60, 100, 100.000000, 10 ); m_spTeardropSizePercentRound->SetDigits( 0 ); @@ -81,7 +81,7 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stLenPercentRound = new wxStaticText( this, wxID_ANY, _("percent of d"), wxDefaultPosition, wxDefaultSize, 0 ); m_stLenPercentRound->Wrap( -1 ); - fgSizerParmRound->Add( m_stLenPercentRound, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizerParmRound->Add( m_stLenPercentRound, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerBitmaps->Add( fgSizerParmRound, 1, wxEXPAND, 5 ); @@ -102,25 +102,25 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stMaxLenRect = new wxStaticText( this, wxID_ANY, _("Max length"), wxDefaultPosition, wxDefaultSize, 0 ); m_stMaxLenRect->Wrap( -1 ); - fgSizerParmRect->Add( m_stMaxLenRect, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmRect->Add( m_stMaxLenRect, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_tcTdMaxLenRect = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerParmRect->Add( m_tcTdMaxLenRect, 0, wxALL|wxEXPAND, 5 ); m_stTdMaxSizeRect = new wxStaticText( this, wxID_ANY, _("Max height"), wxDefaultPosition, wxDefaultSize, 0 ); m_stTdMaxSizeRect->Wrap( -1 ); - fgSizerParmRect->Add( m_stTdMaxSizeRect, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmRect->Add( m_stTdMaxSizeRect, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_tcMaxHeightRect = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerParmRect->Add( m_tcMaxHeightRect, 0, wxALL|wxEXPAND, 5 ); m_stLenUnitRect = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_stLenUnitRect->Wrap( -1 ); - fgSizerParmRect->Add( m_stLenUnitRect, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizerParmRect->Add( m_stLenUnitRect, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); m_stHsettingRect = new wxStaticText( this, wxID_ANY, _("Best length"), wxDefaultPosition, wxDefaultSize, 0 ); m_stHsettingRect->Wrap( -1 ); - fgSizerParmRect->Add( m_stHsettingRect, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmRect->Add( m_stHsettingRect, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_spTeardropLenPercentRect = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 20, 100, 50.000000, 10 ); m_spTeardropLenPercentRect->SetDigits( 0 ); @@ -128,7 +128,7 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stVsettingRect = new wxStaticText( this, wxID_ANY, _("Best height"), wxDefaultPosition, wxDefaultSize, 0 ); m_stVsettingRect->Wrap( -1 ); - fgSizerParmRect->Add( m_stVsettingRect, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmRect->Add( m_stVsettingRect, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_spTeardropSizePercentRect = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 60, 100, 100.000000, 10 ); m_spTeardropSizePercentRect->SetDigits( 0 ); @@ -136,7 +136,7 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stLenPercentRect = new wxStaticText( this, wxID_ANY, _("percent of d"), wxDefaultPosition, wxDefaultSize, 0 ); m_stLenPercentRect->Wrap( -1 ); - fgSizerParmRect->Add( m_stLenPercentRect, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizerParmRect->Add( m_stLenPercentRect, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerBitmaps->Add( fgSizerParmRect, 1, wxEXPAND, 5 ); @@ -157,25 +157,25 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stMaxLenTrack = new wxStaticText( this, wxID_ANY, _("Max length"), wxDefaultPosition, wxDefaultSize, 0 ); m_stMaxLenTrack->Wrap( -1 ); - fgSizerParmTrack->Add( m_stMaxLenTrack, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmTrack->Add( m_stMaxLenTrack, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_tcTdMaxLenTrack = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerParmTrack->Add( m_tcTdMaxLenTrack, 0, wxALL|wxEXPAND, 5 ); m_stTdMaxSizeTrack = new wxStaticText( this, wxID_ANY, _("Max height"), wxDefaultPosition, wxDefaultSize, 0 ); m_stTdMaxSizeTrack->Wrap( -1 ); - fgSizerParmTrack->Add( m_stTdMaxSizeTrack, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmTrack->Add( m_stTdMaxSizeTrack, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_tcMaxHeightTrack = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerParmTrack->Add( m_tcMaxHeightTrack, 0, wxALL|wxEXPAND, 5 ); m_stLenUnitTrack = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_stLenUnitTrack->Wrap( -1 ); - fgSizerParmTrack->Add( m_stLenUnitTrack, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizerParmTrack->Add( m_stLenUnitTrack, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); m_stHsettingtrack = new wxStaticText( this, wxID_ANY, _("Best length"), wxDefaultPosition, wxDefaultSize, 0 ); m_stHsettingtrack->Wrap( -1 ); - fgSizerParmTrack->Add( m_stHsettingtrack, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmTrack->Add( m_stHsettingtrack, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_spTeardropLenPercentTrack = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 20, 100, 100.000000, 10 ); m_spTeardropLenPercentTrack->SetDigits( 0 ); @@ -183,7 +183,7 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stVsettingtrack = new wxStaticText( this, wxID_ANY, _("Best height"), wxDefaultPosition, wxDefaultSize, 0 ); m_stVsettingtrack->Wrap( -1 ); - fgSizerParmTrack->Add( m_stVsettingtrack, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + fgSizerParmTrack->Add( m_stVsettingtrack, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_spTeardropSizePercentTrack = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 60, 100, 100.000000, 10 ); m_spTeardropSizePercentTrack->SetDigits( 0 ); @@ -191,7 +191,7 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con m_stLenPercentTrack = new wxStaticText( this, wxID_ANY, _("percent of d"), wxDefaultPosition, wxDefaultSize, 0 ); m_stLenPercentTrack->Wrap( -1 ); - fgSizerParmTrack->Add( m_stLenPercentTrack, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizerParmTrack->Add( m_stLenPercentTrack, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerBitmaps->Add( fgSizerParmTrack, 1, wxEXPAND, 5 ); @@ -273,6 +273,11 @@ TEARDROP_DIALOG_BASE::TEARDROP_DIALOG_BASE( wxWindow* parent, wxWindowID id, con sbSizerOptions->Add( m_cbOptUseNextTrack, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_cbPadsInZones = new wxCheckBox( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Teardrop on pads in zones"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbPadsInZones->SetToolTip( _("Pads inside a copper zone outline of same net have no teardrop.\nCheck this option to allow teardrop for these pads.") ); + + sbSizerOptions->Add( m_cbPadsInZones, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizerOptions->Add( 30, 0, 0, 0, 5 ); diff --git a/pcbnew/teardrop/dialog_teardrop_base.fbp b/pcbnew/teardrop/dialog_teardrop_base.fbp index 91eff6556a..91ab47d7f3 100644 --- a/pcbnew/teardrop/dialog_teardrop_base.fbp +++ b/pcbnew/teardrop/dialog_teardrop_base.fbp @@ -241,7 +241,7 @@ 0 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -366,7 +366,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -491,7 +491,7 @@ 5 - wxTOP|wxBOTTOM|wxRIGHT + wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL 0 1 @@ -552,7 +552,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -677,7 +677,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -802,7 +802,7 @@ 5 - wxTOP|wxBOTTOM|wxRIGHT + wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1000,7 +1000,7 @@ 0 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1125,7 +1125,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1250,7 +1250,7 @@ 5 - wxTOP|wxBOTTOM|wxRIGHT + wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1311,7 +1311,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1436,7 +1436,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1561,7 +1561,7 @@ 5 - wxTOP|wxBOTTOM|wxRIGHT + wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1759,7 +1759,7 @@ 0 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1884,7 +1884,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -2009,7 +2009,7 @@ 5 - wxTOP|wxBOTTOM|wxRIGHT + wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL 0 1 @@ -2070,7 +2070,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -2195,7 +2195,7 @@ 5 - wxTOP|wxBOTTOM|wxLEFT + wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -2320,7 +2320,7 @@ 5 - wxTOP|wxBOTTOM|wxRIGHT + wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL 0 1 @@ -2962,6 +2962,70 @@ + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Teardrop on pads in zones + + 0 + + + 0 + + 1 + m_cbPadsInZones + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Pads inside a copper zone outline of same net have no teardrop. Check this option to allow teardrop for these pads. + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 diff --git a/pcbnew/teardrop/dialog_teardrop_base.h b/pcbnew/teardrop/dialog_teardrop_base.h index 4572a0b3f8..579dcd0883 100644 --- a/pcbnew/teardrop/dialog_teardrop_base.h +++ b/pcbnew/teardrop/dialog_teardrop_base.h @@ -86,6 +86,7 @@ class TEARDROP_DIALOG_BASE : public DIALOG_SHIM wxRadioBox* m_rbShapeRect; wxRadioBox* m_rbShapeTrack; wxCheckBox* m_cbOptUseNextTrack; + wxCheckBox* m_cbPadsInZones; wxStaticText* m_stPointCount; wxSpinCtrl* m_spPointCount; wxStaticLine* m_staticline1; diff --git a/pcbnew/teardrop/teardrop.cpp b/pcbnew/teardrop/teardrop.cpp index 4acdc3f563..e30d155f61 100644 --- a/pcbnew/teardrop/teardrop.cpp +++ b/pcbnew/teardrop/teardrop.cpp @@ -84,8 +84,7 @@ ZONE* TEARDROP_MANAGER::createTeardrop( TEARDROP_VARIANT aTeardropVariant, } -int TEARDROP_MANAGER::SetTeardrops( BOARD_COMMIT* aCommitter, - bool aDiscardInSameZone, bool aFollowTracks ) +int TEARDROP_MANAGER::SetTeardrops( BOARD_COMMIT* aCommitter, bool aFollowTracks ) { // Init parameters: m_tolerance = Millimeter2iu( 0.01 ); @@ -161,7 +160,7 @@ int TEARDROP_MANAGER::SetTeardrops( BOARD_COMMIT* aCommitter, // Skip case where pad/via and the track is within a copper zone with the same net // (and the pad can be connected by the zone thermal relief ) - if( aDiscardInSameZone && isViaAndTrackInSameZone( viapad, track ) ) + if( !m_prmsList->m_TdOnPadsInZones && isViaAndTrackInSameZone( viapad, track ) ) continue; std::vector points; diff --git a/pcbnew/teardrop/teardrop.h b/pcbnew/teardrop/teardrop.h index 9747a721d3..e46f4fa129 100644 --- a/pcbnew/teardrop/teardrop.h +++ b/pcbnew/teardrop/teardrop.h @@ -93,12 +93,10 @@ public: * Set teardrops on a teardrop free board * @return the number of teardrop created * @param aCommitter is a BOARD_COMMIT reference (can be null) - * @param aDiscardInSameZone = to do not create teardrops for pads in a zone of the same net * @param aFollowTracks = true to use a track connected to the initial track connected * to a pad / via if this initial track is too short to build the teardrop */ int SetTeardrops( BOARD_COMMIT* aCommitter, - bool aDiscardInSameZone = true, bool aFollowTracks = true ); diff --git a/pcbnew/teardrop/teardrop_parameters.h b/pcbnew/teardrop/teardrop_parameters.h index 98c592488e..ffb21b0e45 100644 --- a/pcbnew/teardrop/teardrop_parameters.h +++ b/pcbnew/teardrop/teardrop_parameters.h @@ -129,6 +129,9 @@ public: /// the number of segments to apprximate a curve (Bezier curve) in a teardrop /// Must be > 2, otherwise a line is used int m_CurveSegCount; + /// Pads inside a zone of the same net do not have teardrop added. + /// if this option is true, these pads will have teardrop added. + bool m_TdOnPadsInZones; public: TEARDROP_PARAMETERS_LIST() : @@ -137,7 +140,8 @@ public: m_TargetTrack2Track( false ), m_UseRoundShapesOnly( false ), m_AllowUseTwoTracks( true ), - m_CurveSegCount( 5 ) + m_CurveSegCount( 5 ), + m_TdOnPadsInZones( false ) { m_params_list.emplace_back( TARGET_ROUND ); // parameters for TARGET_ROUND m_params_list.emplace_back( TARGET_RECT ); // parameters for TARGET_RECT