26#include <wx/radiobut.h>
86 void displayNetsList(
const wxArrayString& netNamesList,
int selectIndex );
158 if( countA == countB )
161 return countB < countA;
176 m_outlineHatchPitch( aParent, m_stBorderHatchPitchText,
177 m_outlineHatchPitchCtrl, m_outlineHatchUnits ),
178 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
179 m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
180 m_minWidth( aParent, m_minWidthLabel, m_minWidthCtrl, m_minWidthUnits ),
181 m_antipadClearance( aParent, m_antipadLabel, m_antipadCtrl, m_antipadUnits ),
182 m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
183 m_gridStyleRotation( aParent, m_staticTextGrindOrient, m_tcGridStyleOrientation,
184 m_staticTextRotUnits ),
185 m_gridStyleThickness( aParent, m_staticTextStyleThickness, m_tcGridStyleThickness,
186 m_GridStyleThicknessUnits ),
187 m_gridStyleGap( aParent, m_staticTextGridGap, m_tcGridStyleGap, m_GridStyleGapUnits ),
188 m_islandThreshold( aParent, m_islandThresholdLabel, m_tcIslandThreshold,
189 m_islandThresholdUnits ),
190 m_hideAutoGeneratedNets{ false },
191 m_convertSettings( aConvertSettings ),
192 m_rbCenterline( nullptr ),
193 m_rbEnvelope( nullptr ),
194 m_cbDeleteOriginals( nullptr )
207 case TEARDROP_TYPE::TD_NONE:
211 case TEARDROP_TYPE::TD_VIAPAD:
212 SetTitle(
_(
"Teardrop on Vias/Pads Properties" ) );
215 case TEARDROP_TYPE::TD_TRACKEND:
216 SetTitle(
_(
"Teardrop on Tracks Properties" ) );
220 SetTitle(
_(
"Teardrop Properties" ) );
224 if( aConvertSettings )
226 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
_(
"Conversion Settings" ) );
227 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
229 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
232 bConvertSizer->AddSpacer( 2 );
233 m_rbEnvelope =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
234 bConvertSizer->Add(
m_rbEnvelope, 0, wxLEFT|wxRIGHT, 5 );
236 m_gapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Gap:" ) );
237 m_gapCtrl =
new wxTextCtrl(
this, wxID_ANY );
238 m_gapUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm" ) );
242 wxBoxSizer* hullParamsSizer =
new wxBoxSizer( wxHORIZONTAL );
243 hullParamsSizer->Add(
m_gapLabel, 0, wxALIGN_CENTRE_VERTICAL|wxRIGHT, 5 );
244 hullParamsSizer->Add(
m_gapCtrl, 1, wxALIGN_CENTRE_VERTICAL|wxLEFT|wxRIGHT, 5 );
245 hullParamsSizer->Add(
m_gapUnits, 0, wxALIGN_CENTRE_VERTICAL|wxLEFT, 5 );
246 bConvertSizer->AddSpacer( 2 );
247 bConvertSizer->Add( hullParamsSizer, 0, wxLEFT, 26 );
249 bConvertSizer->AddSpacer( 6 );
250 m_cbDeleteOriginals =
new wxCheckBox(
this, wxID_ANY,
_(
"Delete source objects after conversion" ) );
253 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
255 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
257 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
259 SetTitle(
_(
"Convert to Copper Zone" ) );
277 [&]( wxCommandEvent& )
320 case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER:
break;
331 case ZONE_CONNECTION::THERMAL:
m_PadInZoneOpt->SetSelection( 1 );
break;
332 case ZONE_CONNECTION::THT_THERMAL:
m_PadInZoneOpt->SetSelection( 2 );
break;
333 case ZONE_CONNECTION::NONE:
m_PadInZoneOpt->SetSelection( 3 );
break;
334 case ZONE_CONNECTION::FULL:
m_PadInZoneOpt->SetSelection( 0 );
break;
385 wxCommandEvent event;
410 const int netCode = net->GetNetCode();
484 bool enabled = selection == 1 || selection == 2;
589 DisplayError(
this,
_(
"Thermal spoke width cannot be smaller than the minimum width." ) );
601 for(
int ii = 0; ii <
m_layers->GetItemCount(); ++ii )
603 if(
m_layers->GetToggleValue( (
unsigned) ii, 0 ) )
625 if( netSelection > 0 )
650 if( event.GetColumn() != 0 )
653 int row =
m_layers->ItemToRow( event.GetItem() );
655 bool checked =
m_layers->GetToggleValue( row, 0 );
658 m_layers->GetValue( layerID, row, 2 );
734 if( netNameShowFilter.Len() == 0 )
735 netNameShowFilter = wxT(
"*" );
737 wxStringTokenizer showFilters( netNameShowFilter.Lower(), wxT(
"," ) );
741 while( showFilters.HasMoreTokens() )
743 wxString
filter = showFilters.GetNextToken();
749 m_showNetsFilter.emplace_back( std::make_unique<EDA_PATTERN_MATCH_WILDCARD>() );
760 wxArrayString netNames;
771 if(
filter->Find( netName.Lower() ) )
773 netNames.Add( netName );
795 const int maxNetCode )
806 const int netCode =
pad->GetNetCode();
827 int selectedIndex = 0;
836 selectedIndex = netsList.Index( netName );
838 if( wxNOT_FOUND == selectedIndex )
842 netsList.Insert( netName, 1 );
848 return selectedIndex;
864 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
void OnPadInZoneSelection(wxCommandEvent &event) override
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