26#include <wx/radiobut.h>
77 void OnClose( wxCloseEvent& event )
override;
87 void displayNetsList(
const wxArrayString& netNamesList,
int selectIndex );
155 if( countA == countB )
158 return countB < countA;
173 m_outlineHatchPitch( aParent, m_stBorderHatchPitchText,
174 m_outlineHatchPitchCtrl, m_outlineHatchUnits ),
175 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
176 m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
177 m_minWidth( aParent, m_minWidthLabel, m_minWidthCtrl, m_minWidthUnits ),
178 m_antipadClearance( aParent, m_antipadLabel, m_antipadCtrl, m_antipadUnits ),
179 m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
180 m_gridStyleRotation( aParent, m_staticTextGrindOrient, m_tcGridStyleOrientation,
181 m_staticTextRotUnits ),
182 m_gridStyleThickness( aParent, m_staticTextStyleThickness, m_tcGridStyleThickness,
183 m_GridStyleThicknessUnits ),
184 m_gridStyleGap( aParent, m_staticTextGridGap, m_tcGridStyleGap, m_GridStyleGapUnits ),
185 m_islandThreshold( aParent, m_islandThresholdLabel, m_tcIslandThreshold,
186 m_islandThresholdUnits ),
187 m_hideAutoGeneratedNets{ false },
188 m_convertSettings( aConvertSettings ),
189 m_rbCenterline( nullptr ),
190 m_rbEnvelope( nullptr ),
191 m_cbDeleteOriginals( nullptr )
204 case TEARDROP_TYPE::TD_NONE:
208 case TEARDROP_TYPE::TD_VIAPAD:
209 SetTitle(
_(
"Teardrop on Vias/Pads Properties" ) );
212 case TEARDROP_TYPE::TD_TRACKEND:
213 SetTitle(
_(
"Teardrop on Tracks Properties" ) );
217 SetTitle(
_(
"Teardrop Properties" ) );
221 if( aConvertSettings )
223 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
_(
"Conversion Settings" ) );
224 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
226 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
229 bConvertSizer->AddSpacer( 2 );
230 m_rbEnvelope =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
231 bConvertSizer->Add(
m_rbEnvelope, 0, wxLEFT|wxRIGHT, 5 );
233 bConvertSizer->AddSpacer( 6 );
234 m_cbDeleteOriginals =
new wxCheckBox(
this, wxID_ANY,
_(
"Delete source objects after conversion" ) );
237 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
239 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
241 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
243 SetTitle(
_(
"Convert to Copper Zone" ) );
255 [&]( wxCommandEvent& )
307 case ZONE_CONNECTION::THERMAL:
m_PadInZoneOpt->SetSelection( 1 );
break;
308 case ZONE_CONNECTION::THT_THERMAL:
m_PadInZoneOpt->SetSelection( 2 );
break;
309 case ZONE_CONNECTION::NONE:
m_PadInZoneOpt->SetSelection( 3 );
break;
310 case ZONE_CONNECTION::FULL:
m_PadInZoneOpt->SetSelection( 0 );
break;
361 wxCommandEvent event;
385 const int netCode = net->GetNetCode();
566 DisplayError(
this,
_(
"Thermal spoke width cannot be smaller than the minimum width." ) );
576 if( aUseExportableSetupOnly )
582 for(
int ii = 0; ii <
m_layers->GetItemCount(); ++ii )
584 if(
m_layers->GetToggleValue( (
unsigned) ii, 0 ) )
606 if( netSelection > 0 )
631 if( event.GetColumn() != 0 )
634 int row =
m_layers->ItemToRow( event.GetItem() );
636 bool checked =
m_layers->GetToggleValue( row, 0 );
639 m_layers->GetValue( layerID, row, 2 );
693 if( zone->GetIsRuleArea() )
744 if( netNameShowFilter.Len() == 0 )
745 netNameShowFilter = wxT(
"*" );
747 wxStringTokenizer showFilters( netNameShowFilter.Lower(), wxT(
"," ) );
751 while( showFilters.HasMoreTokens() )
753 wxString
filter = showFilters.GetNextToken();
759 m_showNetsFilter.emplace_back( std::make_unique<EDA_PATTERN_MATCH_WILDCARD>() );
770 wxArrayString netNames;
781 if(
filter->Find( netName.Lower() ) )
783 netNames.Add( netName );
805 const int maxNetCode )
816 const int netCode =
pad->GetNetCode();
837 int selectedIndex = 0;
846 selectedIndex = netsList.Index( netName );
848 if( wxNOT_FOUND == selectedIndex )
852 netsList.Insert( netName, 1 );
858 return selectedIndex;
874 m_copperZoneInfo->ShowMessage(
_(
"<no net> will result in an isolated copper island." ),
constexpr EDA_IU_SCALE pcbIUScale
Information pertinent to a Pcbnew printed circuit board.
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
void ExportSetupToOtherCopperZones(wxCommandEvent &event) 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
void OnButtonCancelClick(wxCommandEvent &event) override
wxCheckBox * m_cbDeleteOriginals
bool AcceptOptions(bool aUseExportableSetupOnly=false)
static constexpr int INVALID_NET_CODE
std::unique_ptr< EDA_PATTERN_MATCH > NET_FILTER
void OnClose(wxCloseEvent &event) override
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
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
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 ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
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.
Handle a list of polygons defining a copper zone.
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 .. 180.0 range.
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_EXPORT_VALUES
#define ZONE_THICKNESS_MIN_VALUE_MM
#define ZONE_BORDER_HATCH_MAXDIST_MM