KiCad PCB EDA Suite
dialog_copper_zones.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2017 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
9  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
10  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, you may find one here:
24  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
25  * or you may search the http://www.gnu.org website for the version 2 license,
26  * or you may write to the Free Software Foundation, Inc.,
27  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28  */
29 
30 #include <wx/wx.h>
31 #include <fctsys.h>
32 #include <kiface_i.h>
33 #include <confirm.h>
34 #include <PolyLine.h>
35 #include <pcbnew.h>
36 #include <pcb_edit_frame.h>
37 #include <zones.h>
38 #include <base_units.h>
39 #include <widgets/text_ctrl_eval.h>
40 #include <bitmaps.h>
41 #include <widgets/color_swatch.h>
42 
43 #include <class_zone.h>
44 #include <class_board.h>
46 
47 #include <wx/imaglist.h> // needed for wx/listctrl.h, in wxGTK 2.8.12
48 #include <wx/listctrl.h>
50 
56 {
57 public:
58  DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings );
59 
60 private:
62  wxConfigBase* m_Config;
63 
65 
70 
72 
75 
76  std::vector<PCB_LAYER_ID> m_LayerId;
77 
79  static wxString m_netNameShowFilter;
80 
86  void initDialog();
87 
88  void OnButtonOkClick( wxCommandEvent& event ) override;
89  void OnButtonCancelClick( wxCommandEvent& event ) override;
90  void OnClose( wxCloseEvent& event ) override;
91  void OnCornerSmoothingModeChoice( wxCommandEvent& event ) override;
92  void OnUpdateUI( wxUpdateUIEvent& ) override;
93 
100  bool AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly = false );
101 
102  void OnNetSortingOptionSelected( wxCommandEvent& event ) override;
103  void ExportSetupToOtherCopperZones( wxCommandEvent& event ) override;
104  void OnPadsInZoneClick( wxCommandEvent& event ) override;
105  void OnRunFiltersButtonClick( wxCommandEvent& event ) override;
106 
108 
114  void initListNetsParams();
115 };
116 
117 
118 const static wxSize LAYER_BITMAP_SIZE( 20, 14 );
119 
120 // Initialize static member variables
121 wxString DIALOG_COPPER_ZONE::m_netNameShowFilter( wxT( "*" ) );
122 
123 
125 {
126  DIALOG_COPPER_ZONE dlg( aCaller, aSettings );
127 
128  ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() );
129  return result;
130 }
131 
132 
134  DIALOG_COPPER_ZONE_BASE( aParent )
135 {
136  m_Parent = aParent;
138 
139  m_ptr = aSettings;
140  m_settings = *aSettings;
141 
142  m_NetSortingByPadCount = true; // false = alphabetic sort, true = pad count sort
144 
145  SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click
146 
147  // Fix static text widget minimum width to a suitable value so that
148  // resizing the dialog is not necessary when changing the corner smoothing type.
149  // Depends on the default text in the widget.
150  m_cornerSmoothingValue->SetMinSize( m_cornerSmoothingValue->GetSize() );
151 
152  initDialog();
153 
154  m_sdbSizerOK->SetDefault();
155 
157 }
158 
159 
161 {
162  BOARD* board = m_Parent->GetBoard();
163 
164  m_bitmapNoNetWarning->SetBitmap( KiBitmap( dialog_warning_xpm ) );
165 
166  wxString msg;
167 
169  m_OrientEdgesOpt->SetSelection( 1 );
170 
171  m_FillModeCtrl->SetSelection( m_settings.m_FillMode == ZFM_SEGMENTS ? 1 : 0 );
172 
176 
180 
181  switch( m_settings.GetPadConnection() )
182  {
183  case PAD_ZONE_CONN_THT_THERMAL: // Thermals only for THT pads
184  m_PadInZoneOpt->SetSelection( 2 );
185  break;
186 
187  case PAD_ZONE_CONN_NONE: // Pads are not covered
188  m_PadInZoneOpt->SetSelection( 3 );
189  break;
190 
191  default:
192  case PAD_ZONE_CONN_THERMAL: // Use thermal relief for pads
193  m_PadInZoneOpt->SetSelection( 1 );
194  break;
195 
196  case PAD_ZONE_CONN_FULL: // pads are covered by copper
197  m_PadInZoneOpt->SetSelection( 0 );
198  break;
199  }
200 
202 
207 
209 
211 
213  {
215  m_OutlineAppearanceCtrl->SetSelection( 0 );
216  break;
217 
219  m_OutlineAppearanceCtrl->SetSelection( 1 );
220  break;
221 
223  m_OutlineAppearanceCtrl->SetSelection( 2 );
224  break;
225  }
226 
227  m_ArcApproximationOpt->SetSelection(
229 
230  // Create one column in m_LayerSelectionCtrl
231  wxListItem column0;
232  column0.SetId( 0 );
233  m_LayerSelectionCtrl->InsertColumn( 0, column0 );
234 
235  wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE.x, LAYER_BITMAP_SIZE.y );
236  m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL );
237 
238  int ctrlWidth = 0; // Min width for m_LayerSelectionCtrl to show the layers names
239  int imgIdx = 0;
240 
241  LSET cu_set = LSET::AllCuMask( board->GetCopperLayerCount() );
242 
244  for( LSEQ cu_stack = cu_set.UIOrder(); cu_stack; ++cu_stack, imgIdx++ )
245  {
246  PCB_LAYER_ID layer = *cu_stack;
247 
248  m_LayerId.push_back( layer );
249 
250  msg = board->GetLayerName( layer );
251  msg.Trim();
252  wxSize tsize( GetTextSize( msg, m_LayerSelectionCtrl ) );
253  ctrlWidth = std::max( ctrlWidth, tsize.x );
254 
255  COLOR4D layerColor = m_Parent->Settings().Colors().GetLayerColor( layer );
256  imageList->Add( COLOR_SWATCH::MakeBitmap( layerColor, backgroundColor, LAYER_BITMAP_SIZE ) );
257 
258  int itemIndex = m_LayerSelectionCtrl->GetItemCount();
259  m_LayerSelectionCtrl->InsertItem( itemIndex, msg, imgIdx );
260 
261  if( m_settings.m_CurrentZone_Layer == layer )
262  m_LayerSelectionCtrl->Select( itemIndex );
263  }
264 
265  // The most easy way to ensure the right size is to use wxLIST_AUTOSIZE
266  // unfortunately this option does not work well both on
267  // wxWidgets 2.8 ( column width too small), and
268  // wxWidgets 2.9 ( column width too large)
269  ctrlWidth += LAYER_BITMAP_SIZE.x + 25; // Add bitmap width + margin before text
270  m_LayerSelectionCtrl->SetColumnWidth( 0, ctrlWidth );
271 
272  ctrlWidth += 25; // Add margin after text + width for scroll bar
273  m_LayerSelectionCtrl->SetMinSize( wxSize( ctrlWidth, -1 ) );
274 
275  wxString netNameDoNotShowFilter = wxT( "Net-*" );
276  if( m_Config )
277  {
278  int opt = m_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
279  m_NetDisplayOption->SetSelection( opt );
280  m_Config->Read( ZONE_NET_FILTER_STRING_KEY, netNameDoNotShowFilter );
281  }
282  else
283  m_NetDisplayOption->SetSelection( 1 );
284 
287 
288  // Build list of nets:
289  m_DoNotShowNetNameFilter->SetValue( netNameDoNotShowFilter );
291 
292  wxCommandEvent event;
294 }
295 
296 
297 void DIALOG_COPPER_ZONE::OnUpdateUI( wxUpdateUIEvent& )
298 {
299  m_bNoNetWarning->Show( m_ListNetNameSelection->GetSelection() == 0 );
300 }
301 
302 void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event )
303 {
304  Close( true );
305 }
306 
307 void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
308 {
310 
311  if( AcceptOptions( true ) )
312  {
313  *m_ptr = m_settings;
314  EndModal( ZONE_OK );
315  }
316 }
317 
318 
319 // called on system close button
320 void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event )
321 {
322  if( m_OnExitCode != ZONE_ABORT )
323  *m_ptr = m_settings;
324 
325  EndModal( m_OnExitCode );
326 }
327 
328 
329 bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly )
330 {
331  switch( m_PadInZoneOpt->GetSelection() )
332  {
333  case 3:
334  // Pads are not covered
336  break;
337 
338  case 2:
339  // Use thermal relief for THT pads
341  break;
342 
343  case 1:
344  // Use thermal relief for pads
346  break;
347 
348  case 0:
349  // pads are covered by copper
351  break;
352  }
353 
354  switch( m_OutlineAppearanceCtrl->GetSelection() )
355  {
356  case 0:
358  break;
359 
360  case 1:
362  break;
363 
364  case 2:
366  break;
367  }
368 
369  m_settings.m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ?
372 
373  if( m_Config )
374  {
377  wxString filter = m_DoNotShowNetNameFilter->GetValue();
378  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, filter );
379  }
380 
382  m_settings.m_FillMode = (m_FillModeCtrl->GetSelection() == 0) ? ZFM_POLYGONS : ZFM_SEGMENTS;
383 
384  wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
386 
387  // Test if this is a reasonable value for this parameter
388  // A too large value can hang Pcbnew
389  #define CLEARANCE_MAX_VALUE ZONE_CLEARANCE_MAX_VALUE_MIL*IU_PER_MILS
390 
392  {
393  wxString msg;
394  msg.Printf( _( "Clearance must be smaller than %f\" / %f mm." ),
396  DisplayError( this, msg );
397  return false;
398  }
399 
400  txtvalue = m_ZoneMinThicknessCtrl->GetValue();
402 
404  {
405  wxString msg;
406  msg.Printf( _( "Minimum width must be larger than %f\" / %f mm." ),
408  DisplayError( this, msg );
409  return false;
410  }
411 
413  txtvalue = m_cornerSmoothingCtrl->GetValue();
415 
417 
418  if( m_OrientEdgesOpt->GetSelection() == 0 )
419  m_settings.m_Zone_45_Only = false;
420  else
421  m_settings.m_Zone_45_Only = true;
422 
425 
426  if( m_Config )
427  {
429  (double) m_settings.m_ZoneClearance / IU_PER_MILS );
430 
432  (double) m_settings.m_ZoneMinThickness / IU_PER_MILS );
433 
435  (double) m_settings.m_ThermalReliefGap / IU_PER_MILS );
436 
438  (double) m_settings.m_ThermalReliefCopperBridge / IU_PER_MILS );
439  }
440 
444  {
445  DisplayError( this,
446  _( "Thermal relief spoke must be greater than the minimum width." ) );
447  return false;
448  }
449 
450  // If we use only exportable to others zones parameters, exit here:
451  if( aUseExportableSetupOnly )
452  return true;
453 
454  // Get the layer selection for this zone
455  int ii = m_LayerSelectionCtrl->GetFirstSelected();
456 
457  if( ii < 0 && aPromptForErrors )
458  {
459  DisplayError( this, _( "No layer selected." ) );
460  return false;
461  }
462 
464 
465  // Get the net name selection for this zone
466  ii = m_ListNetNameSelection->GetSelection();
467 
468  if( ii < 0 && aPromptForErrors )
469  {
470  DisplayError( this, _( "No net selected." ) );
471  return false;
472  }
473 
474  wxString net_name = m_ListNetNameSelection->GetString( ii );
475 
477 
478  // Search net_code for this net, if a net was selected
479  if( m_ListNetNameSelection->GetSelection() > 0 )
480  {
481  NETINFO_ITEM* net = m_Parent->GetBoard()->FindNet( net_name );
482 
483  if( net )
485  }
486 
487  return true;
488 }
489 
490 
492 {
493  int selection = m_cornerSmoothingChoice->GetSelection();
494 
495  switch( selection )
496  {
498  m_cornerSmoothingValue->Enable( false );
499  m_cornerSmoothingCtrl->Enable( false );
500  break;
502  m_cornerSmoothingValue->Enable( true );
503  m_cornerSmoothingCtrl->Enable( true );
504  m_cornerSmoothingValue->SetLabel( _( "Chamfer distance" ) );
506  break;
508  m_cornerSmoothingValue->Enable( true );
509  m_cornerSmoothingCtrl->Enable( true );
510  m_cornerSmoothingValue->SetLabel( _( "Fillet radius" ) );
512  break;
513  }
514 }
515 
516 
518 {
521 
523 
524  if( m_Config )
525  {
526  m_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetDisplayOption->GetSelection() );
527  wxString Filter = m_DoNotShowNetNameFilter->GetValue();
528  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, Filter );
529  }
530 }
531 
532 
534 {
535  if( !AcceptOptions( true, true ) )
536  return;
537 
538  // Export settings ( but layer and netcode ) to others copper zones
539  BOARD* pcb = m_Parent->GetBoard();
540 
541  for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
542  {
543  ZONE_CONTAINER* zone = pcb->GetArea( ii );
544 
545  // Cannot export settings from a copper zone
546  // to a zone keepout:
547  if( zone->GetIsKeepout() )
548  continue;
549 
550  m_settings.ExportSetting( *zone, false ); // false = partial export
551  m_Parent->OnModify();
552  }
553 
554  m_OnExitCode = ZONE_EXPORT_VALUES; // values are exported to others zones
555 }
556 
557 
558 void DIALOG_COPPER_ZONE::OnPadsInZoneClick( wxCommandEvent& event )
559 {
560  // Antipad and spokes are significant only for thermals
561  // However, even if thermals are disabled, these parameters must be set
562  // for pads which have local settings with thermal enabled
563  // Previously, wxTextCtrl widgets related to thermal settings were disabled,
564  // but this is not a good idea. We leave them always enabled.
565 }
566 
567 
569 {
570  switch( m_NetDisplayOption->GetSelection() )
571  {
572  case 0:
573  m_NetSortingByPadCount = false;
574  m_NetFiltering = false;
575  break;
576 
577  case 1:
578  m_NetSortingByPadCount = true;
579  m_NetFiltering = false;
580  break;
581 
582  case 2:
583  m_NetSortingByPadCount = false;
584  m_NetFiltering = true;
585  break;
586 
587  case 3:
588  m_NetSortingByPadCount = true;
589  m_NetFiltering = true;
590  break;
591  }
592 }
593 
594 
595 void DIALOG_COPPER_ZONE::OnRunFiltersButtonClick( wxCommandEvent& event )
596 {
598 
599  // Ensure filtered option for nets
600  if( m_NetDisplayOption->GetSelection() == 0 )
601  m_NetDisplayOption->SetSelection( 2 );
602  else if( m_NetDisplayOption->GetSelection() == 1 )
603  m_NetDisplayOption->SetSelection( 3 );
604 
607 }
608 
609 
611 {
612  wxArrayString listNetName;
613 
615 
616  if( m_NetFiltering )
617  {
618  wxString doNotShowFilter = m_DoNotShowNetNameFilter->GetValue();
619  wxString ShowFilter = m_ShowNetNameFilter->GetValue();
620 
621  for( unsigned ii = 0; ii < listNetName.GetCount(); ii++ )
622  {
623  if( listNetName[ii].Matches( doNotShowFilter ) )
624  {
625  listNetName.RemoveAt( ii );
626  ii--;
627  }
628  else if( !listNetName[ii].Matches( ShowFilter ) )
629  {
630  listNetName.RemoveAt( ii );
631  ii--;
632  }
633  }
634  }
635 
636  listNetName.Insert( wxT( "<no net>" ), 0 );
637 
638  // Ensure currently selected net for the zone is visible, regardless of filters
639  int selectedNetListNdx = -1;
640  int net_select = m_settings.m_NetcodeSelection;
641 
642  if( net_select > 0 )
643  {
644  NETINFO_ITEM* equipot = m_Parent->GetBoard()->FindNet( net_select );
645  if( equipot )
646  {
647  selectedNetListNdx = listNetName.Index( equipot->GetNetname() );
648 
649  if( wxNOT_FOUND == selectedNetListNdx )
650  {
651  // the currently selected net must *always* be visible.
652  // <no net> is the zero'th index, so pick next lowest
653  listNetName.Insert( equipot->GetNetname(), 1 );
654  selectedNetListNdx = 1;
655  }
656  }
657  }
658  else if( net_select == 0 )
659  selectedNetListNdx = 0; // SetSelection() on "<no net>"
660  else
661  {
662  // selectedNetListNdx remains -1, no net selected.
663  }
664 
665  m_ListNetNameSelection->Clear();
666  m_ListNetNameSelection->InsertItems( listNetName, 0 );
667  m_ListNetNameSelection->SetSelection( 0 );
668 
669  if( selectedNetListNdx >= 0 )
670  {
671  m_ListNetNameSelection->SetSelection( selectedNetListNdx );
672  m_ListNetNameSelection->EnsureVisible( selectedNetListNdx );
673  }
674 }
675 
void OnRunFiltersButtonClick(wxCommandEvent &event) override
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:673
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
Definition: zone_settings.h:72
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
#define ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF
Definition: pcbnew.h:42
int m_ArcToSegmentsCount
Option to select number of segments to approximate a circle 16 or 32 segments.
Definition: zone_settings.h:75
void OnButtonCancelClick(wxCommandEvent &event) override
#define CLEARANCE_MAX_VALUE
static wxString m_netNameShowFilter
the filter to show nets (default * "*").
TEXT_CTRL_EVAL * m_cornerSmoothingCtrl
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
void SetCornerSmoothingType(int aType)
#define ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
Definition: pcbnew.h:41
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
Definition: zone_settings.h:78
Class BOARD to handle a board.
ZONE_EDIT_T
Exit codes for zone editing dialogs.
Definition: zones.h:47
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:205
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int GetCopperLayerCount() const
Function GetCopperLayerCount.
Class DIALOG_COPPER_ZONE is the derived class from dialog_copper_zone_frame created by wxFormBuilder...
TEXT_CTRL_EVAL * m_ZoneMinThicknessCtrl
#define ZONE_CLEARANCE_MAX_VALUE_MIL
Definition: zones.h:43
BOARD * GetBoard() const
Classes to handle copper zones.
unsigned int GetCornerRadius() const
ZoneConnection GetPadConnection() const
std::vector< PCB_LAYER_ID > m_LayerId
Handle the real layer number from layer name position in m_LayerSelectionCtrl.
bool AcceptOptions(bool aPromptForErrors, bool aUseExportableSetupOnly=false)
Function AcceptOptions.
Class DIALOG_COPPER_ZONE_BASE.
void initDialog()
Function initDialog fills in the dialog controls using the current settings.
void SetValue(const wxString &aValue) override
Set a new value in evaluator buffer, and display it in the wxTextCtrl.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
Definition: common.cpp:87
ZONE_EDIT_T m_OnExitCode
exit code: ZONE_ABORT if no change, ZONE_OK if new values accepted ZONE_EXPORT_VALUES if values are e...
Pads are not covered.
Definition: zones.h:57
void ExportSetting(ZONE_CONTAINER &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:602
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:65
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
int GetCornerSmoothingType() const
PCB_LAYER_ID
A quick note on layer IDs:
Class LSET is a set of PCB_LAYER_IDs.
if new values were accepted
Definition: zones.h:49
#define ZONE_NET_OUTLINES_HATCH_OPTION_KEY
Definition: zones.h:29
#define ZONE_NET_SORT_OPTION_KEY
Definition: zones.h:30
if values were exported to others zones
Definition: zones.h:50
PCB_BASE_FRAME * m_Parent
PCB_GENERAL_SETTINGS & Settings()
void OnButtonOkClick(wxCommandEvent &event) override
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
int m_ZonePriority
Priority (0 ... N) of the zone.
Definition: zone_settings.h:61
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
Definition: base_units.cpp:370
if no change
Definition: zones.h:48
int SortedNetnamesList(wxArrayString &aNames, bool aSortbyPadsCount)
Function SortedNetnamesList.
int m_ZoneClearance
Clearance value.
Definition: zone_settings.h:63
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize)
Make a simple color swatch bitmap.
#define ZONE_THERMAL_RELIEF_GAP_STRING_KEY
Definition: zones.h:32
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
#define ZONE_NET_FILTER_STRING_KEY
Definition: zones.h:31
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1015
void ExportSetupToOtherCopperZones(wxCommandEvent &event) override
int GetNet() const
Function GetNet.
Definition: netinfo.h:227
int ValueFromTextCtrl(const wxTextCtrl &aTextCtr)
Convert the number Value in a string according to the internal units and the selected unit (g_UserUni...
Definition: base_units.cpp:386
Thermal relief only for THT pads.
Definition: zones.h:60
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
COLORS_DESIGN_SETTINGS & Colors()
Class ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:49
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:57
void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
Function ConfigBaseWriteDouble This is a helper function to write doubles in config We cannot use wxC...
#define ZONE_MIN_THICKNESS_WIDTH_STRING_KEY
Definition: zones.h:35
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:59
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:267
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
Class NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:69
#define ZONE_THICKNESS_MIN_VALUE_MIL
Definition: zones.h:41
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
Definition: zones.h:33
void AddUnitSymbol(wxStaticText &Stext, EDA_UNITS_T aUnit)
Definition: base_units.cpp:515
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:986
Board layer functions and definitions.
#define max(a, b)
Definition: auxiliary.h:86
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
void SetCornerRadius(int aRadius)
void OnPadsInZoneClick(wxCommandEvent &event) override
DIALOG_COPPER_ZONE(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings)
#define ZONE_CLEARANCE_WIDTH_STRING_KEY
Definition: zones.h:34
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
void initListNetsParams()
Function initListNetsParams initializes m_NetSortingByPadCount and m_NetFiltering values according to...
ZONE_EDIT_T InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing...
void OnNetSortingOptionSelected(wxCommandEvent &event) override
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
void SetPadConnection(ZoneConnection aPadConnection)
void OnCornerSmoothingModeChoice(wxCommandEvent &event) override
bool m_NetSortingByPadCount
false = alphabetic sort.
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:235
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:185
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:796
Use thermal relief for pads.
Definition: zones.h:58
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
Definition: zone_settings.h:69
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
wxConfigBase * m_Config
Current config.
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
Definition: zone_settings.h:77
void OnClose(wxCloseEvent &event) override
int m_ZoneMinThickness
Min thickness value in filled areas.
Definition: zone_settings.h:64
pads are covered by copper
Definition: zones.h:59
LSEQ UIOrder() const
Definition: lset.cpp:786
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void OnUpdateUI(wxUpdateUIEvent &) override
static const wxSize LAYER_BITMAP_SIZE(20, 14)