26#include <wx/radiobut.h>
82 void displayNetsList(
const wxArrayString& netNamesList,
int selectIndex );
149 if( countA == countB )
152 return countB < countA;
167 m_outlineHatchPitch( aParent, m_stBorderHatchPitchText,
168 m_outlineHatchPitchCtrl, m_outlineHatchUnits ),
169 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
170 m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
171 m_minWidth( aParent, m_minWidthLabel, m_minWidthCtrl, m_minWidthUnits ),
172 m_antipadClearance( aParent, m_antipadLabel, m_antipadCtrl, m_antipadUnits ),
173 m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
174 m_gridStyleRotation( aParent, m_staticTextGrindOrient, m_tcGridStyleOrientation,
175 m_staticTextRotUnits ),
176 m_gridStyleThickness( aParent, m_staticTextStyleThickness, m_tcGridStyleThickness,
177 m_GridStyleThicknessUnits ),
178 m_gridStyleGap( aParent, m_staticTextGridGap, m_tcGridStyleGap, m_GridStyleGapUnits ),
179 m_islandThreshold( aParent, m_islandThresholdLabel, m_tcIslandThreshold,
180 m_islandThresholdUnits ),
181 m_hideAutoGeneratedNets{ false },
182 m_convertSettings( aConvertSettings ),
183 m_rbCenterline( nullptr ),
184 m_rbEnvelope( nullptr ),
185 m_cbDeleteOriginals( nullptr )
198 case TEARDROP_TYPE::TD_NONE:
202 case TEARDROP_TYPE::TD_VIAPAD:
203 SetTitle(
_(
"Teardrop on Vias/Pads Properties" ) );
206 case TEARDROP_TYPE::TD_TRACKEND:
207 SetTitle(
_(
"Teardrop on Tracks Properties" ) );
211 SetTitle(
_(
"Teardrop Properties" ) );
215 if( aConvertSettings )
217 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
_(
"Conversion Settings" ) );
218 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
220 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
223 bConvertSizer->AddSpacer( 2 );
224 m_rbEnvelope =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
225 bConvertSizer->Add(
m_rbEnvelope, 0, wxLEFT|wxRIGHT, 5 );
227 bConvertSizer->AddSpacer( 6 );
228 m_cbDeleteOriginals =
new wxCheckBox(
this, wxID_ANY,
_(
"Delete source objects after conversion" ) );
231 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
233 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
235 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
237 SetTitle(
_(
"Convert to Copper Zone" ) );
248 [&]( wxCommandEvent& )
290 case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER:
break;
301 case ZONE_CONNECTION::THERMAL:
m_PadInZoneOpt->SetSelection( 1 );
break;
302 case ZONE_CONNECTION::THT_THERMAL:
m_PadInZoneOpt->SetSelection( 2 );
break;
303 case ZONE_CONNECTION::NONE:
m_PadInZoneOpt->SetSelection( 3 );
break;
304 case ZONE_CONNECTION::FULL:
m_PadInZoneOpt->SetSelection( 0 );
break;
355 wxCommandEvent event;
379 const int netCode = net->GetNetCode();
545 DisplayError(
this,
_(
"Thermal spoke width cannot be smaller than the minimum width." ) );
557 for(
int ii = 0; ii <
m_layers->GetItemCount(); ++ii )
559 if(
m_layers->GetToggleValue( (
unsigned) ii, 0 ) )
581 if( netSelection > 0 )
606 if( event.GetColumn() != 0 )
609 int row =
m_layers->ItemToRow( event.GetItem() );
611 bool checked =
m_layers->GetToggleValue( row, 0 );
614 m_layers->GetValue( layerID, row, 2 );
690 if( netNameShowFilter.Len() == 0 )
691 netNameShowFilter = wxT(
"*" );
693 wxStringTokenizer showFilters( netNameShowFilter.Lower(), wxT(
"," ) );
697 while( showFilters.HasMoreTokens() )
699 wxString
filter = showFilters.GetNextToken();
705 m_showNetsFilter.emplace_back( std::make_unique<EDA_PATTERN_MATCH_WILDCARD>() );
716 wxArrayString netNames;
727 if(
filter->Find( netName.Lower() ) )
729 netNames.Add( netName );
751 const int maxNetCode )
762 const int netCode =
pad->GetNetCode();
783 int selectedIndex = 0;
792 selectedIndex = netsList.Index( netName );
794 if( wxNOT_FOUND == selectedIndex )
798 netsList.Insert( netName, 1 );
804 return selectedIndex;
820 m_copperZoneInfo->ShowMessage(
_(
"<no net> will result in an isolated copper island." ),
constexpr EDA_IU_SCALE pcbIUScale
const NETINFO_LIST & GetNetInfo() const
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
int GetCopperLayerCount() const
Class DIALOG_COPPER_ZONE_BASE.
wxTextCtrl * m_tcGridStyleGap
wxCheckBox * m_sortByPadsOpt
wxChoice * m_cornerSmoothingChoice
wxCheckBox * m_hideAutoGenNetNamesOpt
wxSpinCtrl * m_PriorityLevelCtrl
wxTextCtrl * m_tcGridStyleOrientation
wxListBox * m_ListNetNameSelection
wxSpinCtrlDouble * m_spinCtrlSmoothValue
wxTextCtrl * m_ShowNetNameFilter
wxTextCtrl * m_tcGridStyleThickness
wxDataViewListCtrl * m_layers
wxChoice * m_GridStyleCtrl
wxStaticText * m_cornerRadiusLabel
wxChoice * m_OutlineDisplayCtrl
wxChoice * m_cbRemoveIslands
wxStaticText * m_staticText40
wxSpinCtrl * m_spinCtrlSmoothLevel
wxTextCtrl * m_cornerRadiusCtrl
wxChoice * m_PadInZoneOpt
wxTextCtrl * m_tcZoneName
wxInfoBar * m_copperZoneInfo
void loadPersistentNetSortConfigurations()
void updateDisplayedListOfNets()
UNIT_BINDER m_outlineHatchPitch
bool TransferDataFromWindow() override
void storePersistentNetSortConfigurations()
int m_cornerSmoothingType
void OnStyleSelection(wxCommandEvent &event) override
std::map< wxString, int > m_netNameToNetCode
NET_FILTER_LIST m_showNetsFilter
void OnNetSortingOptionSelected(wxCommandEvent &event) override
DIALOG_COPPER_ZONE(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
bool m_hideAutoGeneratedNets
wxArrayString buildListOfNetsToDisplay()
void sortNetsByPadCount(std::vector< NETINFO_ITEM * > &nets, const int maxNetCode)
int ensureSelectedNetIsVisible(int selectedNetCode, wxArrayString &netsList)
UNIT_BINDER m_gridStyleThickness
wxRadioButton * m_rbCenterline
UNIT_BINDER m_gridStyleGap
bool TransferDataToWindow() override
wxString getUnescapedNetName(const NETINFO_ITEM *net)
void readFilteringAndSortingCriteria()
void updateShowNetsFilter()
void OnLayerSelection(wxDataViewEvent &event) override
CONVERT_SETTINGS * m_convertSettings
bool m_netSortingByPadCount
void OnShowNetNameFilterChange(wxCommandEvent &event) override
void OnRemoveIslandsSelection(wxCommandEvent &event) override
static constexpr int HIDE_ANONYMOUS_NETS
void sortNetsIfRequired()
std::vector< NET_FILTER > NET_FILTER_LIST
wxCheckBox * m_cbDeleteOriginals
static constexpr int INVALID_NET_CODE
std::unique_ptr< EDA_PATTERN_MATCH > NET_FILTER
UNIT_BINDER m_antipadClearance
PCB_BASE_FRAME * m_Parent
static constexpr int SORT_BY_PAD_COUNT
static constexpr int DEFAULT_SORT_CONFIG
std::vector< NETINFO_ITEM * > m_netInfoItemList
void updateCurrentNetSelection()
void OnUpdateUI(wxUpdateUIEvent &) override
void readNetInformation()
int m_currentlySelectedNetcode
UNIT_BINDER m_cornerRadius
UNIT_BINDER m_gridStyleRotation
void displayNetsList(const wxArrayString &netNamesList, int selectIndex)
wxRadioButton * m_rbEnvelope
UNIT_BINDER m_islandThreshold
void OnNetSelectionUpdated(wxCommandEvent &event) override
static constexpr int NO_PERSISTENT_SORT_MODE
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Handle the data for a net.
const wxString & GetNetname() const
Container for NETINFO_ITEM elements, which are the nets.
unsigned GetNetCount() const
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
virtual EDA_ANGLE GetAngleValue()
void SetDataType(EDA_DATA_TYPE aDataType)
Used to override the datatype of the displayed property (default is DISTANCE)
virtual void SetAngleValue(const EDA_ANGLE &aValue)
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
ZONE_SETTINGS handles zones parameters.
EDA_ANGLE m_HatchOrientation
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
double m_HatchSmoothingValue
void SetMinIslandArea(long long int aArea)
void SetPadConnection(ZONE_CONNECTION aPadConnection)
long long int GetMinIslandArea() const
long m_ThermalReliefSpokeWidth
ZONE_CONNECTION GetPadConnection() const
TEARDROP_TYPE m_TeardropType
void SetCornerRadius(int aRadius)
void SetupLayersList(wxDataViewListCtrl *aList, PCB_BASE_FRAME *aFrame, LSET aLayers, bool aFpEditorMode)
A helper routine for the various zone dialogs (copper, non-copper, keepout).
int GetCornerSmoothingType() const
ZONE_FILL_MODE m_FillMode
void SetCornerSmoothingType(int aType)
int m_HatchSmoothingLevel
unsigned int GetCornerRadius() const
ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
static bool sortNetsByNodes(const NETINFO_ITEM *a, const NETINFO_ITEM *b)
int InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing.
static bool sortNetsByNames(const NETINFO_ITEM *a, const NETINFO_ITEM *b)
static std::vector< int > padCountListByNet
Abstract pattern-matching tool and implementations.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
wxString UnescapeString(const wxString &aSource)
CONVERT_STRATEGY m_Strategy
constexpr int mmToIU(double mm) const
T NormalizeAngle180(T Angle)
Normalize angle to be in the -180.0 .
ISLAND_REMOVAL_MODE
Whether or not to remove isolated islands from a zone.
#define ZONE_CLEARANCE_MAX_VALUE_MM
#define ZONE_BORDER_HATCH_MINDIST_MM
#define ZONE_THICKNESS_MIN_VALUE_MM
#define ZONE_BORDER_HATCH_MAXDIST_MM