26#include <wx/radiobut.h>
85 void displayNetsList(
const wxArrayString& netNamesList,
int selectIndex );
157 if( countA == countB )
160 return countB < countA;
175 m_outlineHatchPitch( aParent, m_stBorderHatchPitchText,
176 m_outlineHatchPitchCtrl, m_outlineHatchUnits ),
177 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
178 m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
179 m_minWidth( aParent, m_minWidthLabel, m_minWidthCtrl, m_minWidthUnits ),
180 m_antipadClearance( aParent, m_antipadLabel, m_antipadCtrl, m_antipadUnits ),
181 m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
182 m_gridStyleRotation( aParent, m_staticTextGrindOrient, m_tcGridStyleOrientation,
183 m_staticTextRotUnits ),
184 m_gridStyleThickness( aParent, m_staticTextStyleThickness, m_tcGridStyleThickness,
185 m_GridStyleThicknessUnits ),
186 m_gridStyleGap( aParent, m_staticTextGridGap, m_tcGridStyleGap, m_GridStyleGapUnits ),
187 m_islandThreshold( aParent, m_islandThresholdLabel, m_tcIslandThreshold,
188 m_islandThresholdUnits ),
189 m_hideAutoGeneratedNets{ false },
190 m_convertSettings( aConvertSettings ),
191 m_rbCenterline( nullptr ),
192 m_rbEnvelope( nullptr ),
193 m_cbDeleteOriginals( nullptr )
206 case TEARDROP_TYPE::TD_NONE:
210 case TEARDROP_TYPE::TD_VIAPAD:
211 SetTitle(
_(
"Teardrop on Vias/Pads Properties" ) );
214 case TEARDROP_TYPE::TD_TRACKEND:
215 SetTitle(
_(
"Teardrop on Tracks Properties" ) );
219 SetTitle(
_(
"Teardrop Properties" ) );
223 if( aConvertSettings )
225 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
_(
"Conversion Settings" ) );
226 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
228 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
231 bConvertSizer->AddSpacer( 2 );
232 m_rbEnvelope =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
233 bConvertSizer->Add(
m_rbEnvelope, 0, wxLEFT|wxRIGHT, 5 );
235 m_gapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Gap:" ) );
236 m_gapCtrl =
new wxTextCtrl(
this, wxID_ANY );
237 m_gapUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm" ) );
241 wxBoxSizer* hullParamsSizer =
new wxBoxSizer( wxHORIZONTAL );
242 hullParamsSizer->Add(
m_gapLabel, 0, wxALIGN_CENTRE_VERTICAL|wxRIGHT, 5 );
243 hullParamsSizer->Add(
m_gapCtrl, 1, wxALIGN_CENTRE_VERTICAL|wxLEFT|wxRIGHT, 5 );
244 hullParamsSizer->Add(
m_gapUnits, 0, wxALIGN_CENTRE_VERTICAL|wxLEFT, 5 );
245 bConvertSizer->AddSpacer( 2 );
246 bConvertSizer->Add( hullParamsSizer, 0, wxLEFT, 26 );
248 bConvertSizer->AddSpacer( 6 );
249 m_cbDeleteOriginals =
new wxCheckBox(
this, wxID_ANY,
_(
"Delete source objects after conversion" ) );
252 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
254 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
256 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
258 SetTitle(
_(
"Convert to Copper Zone" ) );
276 [&]( wxCommandEvent& )
319 case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER:
break;
330 case ZONE_CONNECTION::THERMAL:
m_PadInZoneOpt->SetSelection( 1 );
break;
331 case ZONE_CONNECTION::THT_THERMAL:
m_PadInZoneOpt->SetSelection( 2 );
break;
332 case ZONE_CONNECTION::NONE:
m_PadInZoneOpt->SetSelection( 3 );
break;
333 case ZONE_CONNECTION::FULL:
m_PadInZoneOpt->SetSelection( 0 );
break;
384 wxCommandEvent event;
408 const int netCode = net->GetNetCode();
578 DisplayError(
this,
_(
"Thermal spoke width cannot be smaller than the minimum width." ) );
590 for(
int ii = 0; ii <
m_layers->GetItemCount(); ++ii )
592 if(
m_layers->GetToggleValue( (
unsigned) ii, 0 ) )
614 if( netSelection > 0 )
639 if( event.GetColumn() != 0 )
642 int row =
m_layers->ItemToRow( event.GetItem() );
644 bool checked =
m_layers->GetToggleValue( row, 0 );
647 m_layers->GetValue( layerID, row, 2 );
723 if( netNameShowFilter.Len() == 0 )
724 netNameShowFilter = wxT(
"*" );
726 wxStringTokenizer showFilters( netNameShowFilter.Lower(), wxT(
"," ) );
730 while( showFilters.HasMoreTokens() )
732 wxString
filter = showFilters.GetNextToken();
738 m_showNetsFilter.emplace_back( std::make_unique<EDA_PATTERN_MATCH_WILDCARD>() );
749 wxArrayString netNames;
760 if(
filter->Find( netName.Lower() ) )
762 netNames.Add( netName );
784 const int maxNetCode )
795 const int netCode =
pad->GetNetCode();
816 int selectedIndex = 0;
825 selectedIndex = netsList.Index( netName );
827 if( wxNOT_FOUND == selectedIndex )
831 netsList.Insert( netName, 1 );
837 return selectedIndex;
853 m_copperZoneInfo->ShowMessage(
_(
"<no net> will result in an isolated copper island." ),
constexpr EDA_IU_SCALE pcbIUScale
BASE_SET & set(size_t pos)
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
wxStaticText * m_gapLabel
UNIT_BINDER m_gridStyleRotation
wxStaticText * m_gapUnits
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