104 void OnClose( wxCloseEvent& event )
override;
115 void displayNetsList(
const wxArrayString& netNamesList,
int selectIndex );
151 if( countA == countB )
154 return countB < countA;
168 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
169 m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
170 m_minWidth( aParent, m_minWidthLabel, m_minWidthCtrl, m_minWidthUnits ),
171 m_antipadClearance( aParent, m_antipadLabel, m_antipadCtrl, m_antipadUnits ),
172 m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
173 m_gridStyleRotation( aParent, m_staticTextGrindOrient, m_tcGridStyleOrientation,
174 m_staticTextRotUnits ),
175 m_gridStyleThickness( aParent, m_staticTextStyleThickness, m_tcGridStyleThickness,
176 m_GridStyleThicknessUnits ),
177 m_gridStyleGap( aParent, m_staticTextGridGap, m_tcGridStyleGap, m_GridStyleGapUnits ),
178 m_islandThreshold( aParent, m_islandThresholdLabel, m_tcIslandThreshold,
179 m_islandThresholdUnits ),
180 m_hideAutoGeneratedNets{
false }
185 m_settings = *aSettings;
186 m_settings.SetupLayersList( m_layers, m_Parent,
190 m_settingsExported =
false;
191 m_currentlySelectedNetcode = INVALID_NET_CODE;
192 m_maxNetCode = INVALID_NET_CODE;
194 m_netSortingByPadCount =
true;
196 m_sdbSizerOK->SetDefault();
197 m_ShowNetNameFilter->SetHint(
_(
"Filter" ) );
199 m_cbRemoveIslands->Bind( wxEVT_CHOICE,
200 [&]( wxCommandEvent& )
203 bool val = m_cbRemoveIslands->GetSelection() == 2;
205 m_tcIslandThreshold->Enable( val );
206 m_islandThresholdLabel->Enable( val );
207 m_islandThresholdUnits->Enable( val );
210 finishDialogSettings();
309 wxCommandEvent event;
341 const int& netCode = net->GetNetCode();
505 DisplayError(
this,
_(
"Thermal spoke width cannot be smaller than the minimum width." ) );
520 if( aUseExportableSetupOnly )
526 for(
int ii = 0; ii <
m_layers->GetItemCount(); ++ii )
528 if(
m_layers->GetToggleValue( (
unsigned) ii, 0 ) )
575 if( event.GetColumn() != 0 )
578 int row =
m_layers->ItemToRow( event.GetItem() );
580 bool checked =
m_layers->GetToggleValue( row, 0 );
583 m_layers->GetValue( layerID, row, 2 );
643 if( zone->GetIsRuleArea() )
687 if( netNameShowFilter.Len() == 0 )
689 netNameShowFilter = wxT(
"*" );
692 wxStringTokenizer showFilters( netNameShowFilter.Lower(), wxT(
"," ) );
696 while( showFilters.HasMoreTokens() )
698 wxString
filter = showFilters.GetNextToken();
704 m_showNetsFilter.emplace_back( std::make_unique<EDA_PATTERN_MATCH_WILDCARD>() );
717 const wxArrayString netsAfterShowFilter =
applyShowFilter( sortedNetNames );
721 return filteredNetNames;
739 const int maxNetCode )
750 const int netCode =
pad->GetNetCode();
762 wxArrayString sortedNetNames;
767 sortedNetNames.Add( netName );
770 return sortedNetNames;
776 wxArrayString netsAfterShowFilter;
778 for(
const wxString& netName : netNames )
782 if(
filter->Find( netName.Lower() ) )
784 netsAfterShowFilter.Add( netName );
789 return netsAfterShowFilter;
795 wxArrayString filteredNetNames;
799 for(
const wxString& netName : netNames )
803 filteredNetNames.Add( netName );
809 filteredNetNames = netNames;
814 return filteredNetNames;
820 return netName.StartsWith( wxT(
"Net-(" ) ) || netName.StartsWith( wxT(
"unconnected-(" ) );
835 int selectedIndex = 0;
843 selectedIndex = netsList.Index( netName );
845 if( wxNOT_FOUND == selectedIndex )
849 netsList.Insert( netName, 1 );
855 return selectedIndex;
867 if( m_currentlySelectedNetcode <= INVALID_NET_CODE && !m_copperZoneInfo->IsShown() )
870 _(
"Selecting <no net> will create an isolated copper island." ), wxICON_WARNING );
int m_HatchSmoothingLevel
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
static constexpr int INVALID_NET_CODE
void SetMinIslandArea(long long int aArea)
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
wxSpinCtrl * m_PriorityLevelCtrl
wxArrayString applyHideFilterIfRequired(const wxArrayString &netNames)
UNIT_BINDER m_islandThreshold
wxTextCtrl * m_tcGridStyleOrientation
wxArrayString buildListOfNetsToDisplay()
bool isAutoGenerated(const wxString &netName)
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
void OnRemoveIslandsSelection(wxCommandEvent &event) override
void OnButtonCancelClick(wxCommandEvent &event) override
wxChoice * m_GridStyleCtrl
void loadPersistentNetSortConfigurations()
This file is part of the common library.
double m_HatchSmoothingValue
wxTextCtrl * m_tcGridStyleGap
long long int GetMinIslandArea() const
void SetCornerSmoothingType(int aType)
wxInfoBar * m_copperZoneInfo
void OnLayerSelection(wxDataViewEvent &event) override
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
void OnNetSelectionUpdated(wxCommandEvent &event) override
static bool sortNetsByNodes(const NETINFO_ITEM *a, const NETINFO_ITEM *b)
void updateDisplayedListOfNets()
void buildListOfNets(const NETINFO_LIST &nets)
std::map< wxString, int > m_netNameToNetCode
std::vector< NET_FILTER > NET_FILTER_LIST
bool m_hideAutoGeneratedNets
int GetCornerSmoothingType() const
static std::vector< int > padCountListByNet
#define ZONE_CLEARANCE_MAX_VALUE_MIL
void SetDataType(EDA_DATA_TYPE aDataType)
Used to override the datatype of the displayed property (default is DISTANCE)
wxTextCtrl * m_tcIslandThreshold
UNIT_BINDER m_gridStyleGap
int m_cornerSmoothingType
wxChoice * m_cornerSmoothingChoice
const NETINFO_LIST & GetNetInfo() const
#define ZONE_EXPORT_VALUES
const ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
wxChoice * m_PadInZoneOpt
Class DIALOG_COPPER_ZONE_BASE.
ZONE_CONNECTION GetPadConnection() const
wxChoice * m_OutlineDisplayCtrl
void OnShowNetNameFilterChange(wxCommandEvent &event) override
void OnStyleSelection(wxCommandEvent &event) override
wxTextCtrl * m_tcZoneName
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
std::unique_ptr< EDA_PATTERN_MATCH > NET_FILTER
bool m_netSortingByPadCount
unsigned int GetCornerRadius() const
wxStaticText * m_islandThresholdUnits
Abstract pattern-matching tool and implementations.
bool AcceptOptions(bool aUseExportableSetupOnly=false)
wxTextCtrl * m_cornerRadiusCtrl
T NormalizeAngle180(T Angle)
Normalize angle to be in the -180.0 .. 180.0 range.
double thermal_relief_gap
int ensureSelectedNetIsVisible(int selectedNetCode, wxArrayString &netsList)
pads are covered by copper
void SetPadConnection(ZONE_CONNECTION aPadConnection)
PCB_BASE_FRAME * m_Parent
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
std::vector< NETINFO_ITEM * > m_netInfoItemList
Container for NETINFO_ITEM elements, which are the nets.
wxCheckBox * m_constrainOutline
void readFilteringAndSortingCriteria()
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
wxSpinCtrlDouble * m_spinCtrlSmoothValue
UNIT_BINDER m_antipadClearance
bool TransferDataFromWindow() override
wxDataViewListCtrl * m_layers
wxStaticText * m_islandThresholdLabel
const wxString & GetNetname() const
static constexpr int HIDE_ANONYMOUS_NETS
Handle a list of polygons defining a copper zone.
int m_currentlySelectedNetcode
wxChoice * m_cbRemoveIslands
void ExportSetupToOtherCopperZones(wxCommandEvent &event) override
wxArrayString applyShowFilter(const wxArrayString &sortedNetNames)
double thermal_relief_copper_width
wxTextCtrl * m_ShowNetNameFilter
static bool sortNetsByNames(const NETINFO_ITEM *a, const NETINFO_ITEM *b)
UNIT_BINDER m_gridStyleRotation
void storePersistentNetSortConfigurations()
wxString UnescapeString(const wxString &aSource)
Thermal relief only for THT pads.
wxArrayString getSortedNetNamesList()
ZONE_SETTINGS handles zones parameters.
wxCheckBox * m_hideAutoGenNetNamesOpt
wxTextCtrl * m_tcGridStyleThickness
Use thermal relief for pads.
void readNetInformation()
ZONE_FILL_MODE m_FillMode
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 void OnModify()
Must be called after a change in order to set the "modify" flag of the current screen and update the ...
Handle the data for a net.
static constexpr int DEFAULT_SORT_CONFIG
#define ZONE_THICKNESS_MIN_VALUE_MIL
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.
long m_ThermalReliefSpokeWidth
void sortNetsIfRequired()
NET_FILTER_LIST m_showNetsFilter
UNIT_BINDER m_gridStyleThickness
Information pertinent to a Pcbnew printed circuit board.
static constexpr int NO_PERSISTENT_SORT_MODE
void updateShowNetsFilter()
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetCornerRadius(int aRadius)
PCBNEW_SETTINGS * GetPcbNewSettings() const
DIALOG_COPPER_ZONE(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings)
void OnNetSortingOptionSelected(wxCommandEvent &event) override
virtual long long int GetValue()
Return the current value in Internal Units.
unsigned GetNetCount() const
int InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing.
wxSpinCtrl * m_spinCtrlSmoothLevel
UNIT_BINDER m_cornerRadius
static constexpr int SORT_BY_PAD_COUNT
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
wxListBox * m_ListNetNameSelection
void updateCurrentNetSelection()
static constexpr int Millimeter2iu(double mm)
bool TransferDataToWindow() override
void sortNetsByPadCount(std::vector< NETINFO_ITEM * > &nets, const int maxNetCode)
PCB_LAYER_ID ToLAYER_ID(int aLayer)
double m_HatchOrientation
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void handleRemoveIslandsSelection()
wxString getUnescapedNetName(const NETINFO_ITEM *net)
wxStaticText * m_cornerRadiusLabel
void OnClose(wxCloseEvent &event) override
void displayNetsList(const wxArrayString &netNamesList, int selectIndex)
void OnUpdateUI(wxUpdateUIEvent &) override
wxCheckBox * m_sortByPadsOpt