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 
42 #include <class_zone.h>
43 #include <class_board.h>
45 
46 #include <wx/imaglist.h> // needed for wx/listctrl.h, in wxGTK 2.8.12
47 #include <wx/listctrl.h>
49 
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 
122  wxBitmap makeLayerBitmap( COLOR4D aColor, COLOR4D aBackground );
123 };
124 
125 
126 #define LAYER_BITMAP_SIZE_X 20
127 #define LAYER_BITMAP_SIZE_Y 10
128 
129 // Initialize static member variables
130 wxString DIALOG_COPPER_ZONE::m_netNameShowFilter( wxT( "*" ) );
131 
132 
134 {
135  DIALOG_COPPER_ZONE dlg( aCaller, aSettings );
136 
137  ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() );
138  return result;
139 }
140 
141 
143  DIALOG_COPPER_ZONE_BASE( aParent )
144 {
145  m_Parent = aParent;
147 
148  m_ptr = aSettings;
149  m_settings = *aSettings;
150 
151  m_NetSortingByPadCount = true; // false = alphabetic sort, true = pad count sort
153 
154  SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click
155 
156  // Fix static text widget minimum width to a suitable value so that
157  // resizing the dialog is not necessary when changing the corner smoothing type.
158  // Depends on the default text in the widget.
159  m_cornerSmoothingValue->SetMinSize( m_cornerSmoothingValue->GetSize() );
160 
161  initDialog();
162 
163  m_sdbSizerOK->SetDefault();
164 
166 }
167 
168 
170 {
171  BOARD* board = m_Parent->GetBoard();
172 
173  m_bitmapNoNetWarning->SetBitmap( KiBitmap( dialog_warning_xpm ) );
174 
175  wxString msg;
176 
178  m_OrientEdgesOpt->SetSelection( 1 );
179 
180  m_FillModeCtrl->SetSelection( m_settings.m_FillMode == ZFM_SEGMENTS ? 1 : 0 );
181 
185 
189 
190  switch( m_settings.GetPadConnection() )
191  {
192  case PAD_ZONE_CONN_THT_THERMAL: // Thermals only for THT pads
193  m_PadInZoneOpt->SetSelection( 2 );
194  break;
195 
196  case PAD_ZONE_CONN_NONE: // Pads are not covered
197  m_PadInZoneOpt->SetSelection( 3 );
198  break;
199 
200  default:
201  case PAD_ZONE_CONN_THERMAL: // Use thermal relief for pads
202  m_PadInZoneOpt->SetSelection( 1 );
203  break;
204 
205  case PAD_ZONE_CONN_FULL: // pads are covered by copper
206  m_PadInZoneOpt->SetSelection( 0 );
207  break;
208  }
209 
211 
216 
218 
220 
222  {
224  m_OutlineAppearanceCtrl->SetSelection( 0 );
225  break;
226 
228  m_OutlineAppearanceCtrl->SetSelection( 1 );
229  break;
230 
232  m_OutlineAppearanceCtrl->SetSelection( 2 );
233  break;
234  }
235 
236  m_ArcApproximationOpt->SetSelection(
238 
239  // Create one column in m_LayerSelectionCtrl
240  wxListItem column0;
241  column0.SetId( 0 );
242  m_LayerSelectionCtrl->InsertColumn( 0, column0 );
243 
244  wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
245  m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL );
246 
247  int ctrlWidth = 0; // Min width for m_LayerSelectionCtrl to show the layers names
248  int imgIdx = 0;
249 
250  LSET cu_set = LSET::AllCuMask( board->GetCopperLayerCount() );
251 
253  for( LSEQ cu_stack = cu_set.UIOrder(); cu_stack; ++cu_stack, imgIdx++ )
254  {
255  PCB_LAYER_ID layer = *cu_stack;
256 
257  m_LayerId.push_back( layer );
258 
259  msg = board->GetLayerName( layer );
260 
261  msg.Trim();
262 
263  COLOR4D layerColor = m_Parent->Settings().Colors().GetLayerColor( layer );
264 
265  imageList->Add( makeLayerBitmap( layerColor, backgroundColor ) );
266 
267  int itemIndex = m_LayerSelectionCtrl->InsertItem(
268  m_LayerSelectionCtrl->GetItemCount(), msg, imgIdx );
269 
270  if( m_settings.m_CurrentZone_Layer == layer )
271  m_LayerSelectionCtrl->Select( itemIndex );
272 
273  wxSize tsize( GetTextSize( msg, m_LayerSelectionCtrl ) );
274  ctrlWidth = std::max( ctrlWidth, tsize.x );
275  }
276 
277  // The most easy way to ensure the right size is to use wxLIST_AUTOSIZE
278  // unfortunately this option does not work well both on
279  // wxWidgets 2.8 ( column width too small), and
280  // wxWidgets 2.9 ( column width too large)
281  ctrlWidth += LAYER_BITMAP_SIZE_X + 25; // Add bitmap width + margin between bitmap and text
282  m_LayerSelectionCtrl->SetColumnWidth( 0, ctrlWidth );
283 
284  ctrlWidth += 25; // add small margin between text and window borders
285  // and room for vertical scroll bar
286  m_LayerSelectionCtrl->SetMinSize( wxSize( ctrlWidth, -1 ) );
287 
288  wxString netNameDoNotShowFilter = wxT( "Net-*" );
289  if( m_Config )
290  {
291  int opt = m_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
292  m_NetDisplayOption->SetSelection( opt );
293  m_Config->Read( ZONE_NET_FILTER_STRING_KEY, netNameDoNotShowFilter );
294  }
295  else
296  m_NetDisplayOption->SetSelection( 1 );
297 
300 
301  // Build list of nets:
302  m_DoNotShowNetNameFilter->SetValue( netNameDoNotShowFilter );
304 
305  wxCommandEvent event;
307 }
308 
309 
310 void DIALOG_COPPER_ZONE::OnUpdateUI( wxUpdateUIEvent& )
311 {
312  m_bNoNetWarning->Show( m_ListNetNameSelection->GetSelection() == 0 );
313 }
314 
315 void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event )
316 {
317  Close( true );
318 }
319 
320 void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
321 {
323 
324  if( AcceptOptions( true ) )
325  {
326  *m_ptr = m_settings;
327  EndModal( ZONE_OK );
328  }
329 }
330 
331 
332 // called on system close button
333 void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event )
334 {
335  if( m_OnExitCode != ZONE_ABORT )
336  *m_ptr = m_settings;
337 
338  EndModal( m_OnExitCode );
339 }
340 
341 
342 bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly )
343 {
344  switch( m_PadInZoneOpt->GetSelection() )
345  {
346  case 3:
347  // Pads are not covered
349  break;
350 
351  case 2:
352  // Use thermal relief for THT pads
354  break;
355 
356  case 1:
357  // Use thermal relief for pads
359  break;
360 
361  case 0:
362  // pads are covered by copper
364  break;
365  }
366 
367  switch( m_OutlineAppearanceCtrl->GetSelection() )
368  {
369  case 0:
371  break;
372 
373  case 1:
375  break;
376 
377  case 2:
379  break;
380  }
381 
382  m_settings.m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ?
385 
386  if( m_Config )
387  {
390  wxString filter = m_DoNotShowNetNameFilter->GetValue();
391  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, filter );
392  }
393 
395  m_settings.m_FillMode = (m_FillModeCtrl->GetSelection() == 0) ? ZFM_POLYGONS : ZFM_SEGMENTS;
396 
397  wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
399 
400  // Test if this is a reasonable value for this parameter
401  // A too large value can hang Pcbnew
402  #define CLEARANCE_MAX_VALUE ZONE_CLEARANCE_MAX_VALUE_MIL*IU_PER_MILS
403 
405  {
406  wxString msg;
407  msg.Printf( _( "Clearance must be smaller than %f\" / %f mm." ),
409  DisplayError( this, msg );
410  return false;
411  }
412 
413  txtvalue = m_ZoneMinThicknessCtrl->GetValue();
415 
417  {
418  wxString msg;
419  msg.Printf( _( "Minimum width must be larger than %f\" / %f mm." ),
421  DisplayError( this, msg );
422  return false;
423  }
424 
426  txtvalue = m_cornerSmoothingCtrl->GetValue();
428 
430 
431  if( m_OrientEdgesOpt->GetSelection() == 0 )
432  m_settings.m_Zone_45_Only = false;
433  else
434  m_settings.m_Zone_45_Only = true;
435 
438 
439  if( m_Config )
440  {
442  (double) m_settings.m_ZoneClearance / IU_PER_MILS );
443 
445  (double) m_settings.m_ZoneMinThickness / IU_PER_MILS );
446 
448  (double) m_settings.m_ThermalReliefGap / IU_PER_MILS );
449 
451  (double) m_settings.m_ThermalReliefCopperBridge / IU_PER_MILS );
452  }
453 
457  {
458  DisplayError( this,
459  _( "Thermal relief spoke must be greater than the minimum width." ) );
460  return false;
461  }
462 
463  // If we use only exportable to others zones parameters, exit here:
464  if( aUseExportableSetupOnly )
465  return true;
466 
467  // Get the layer selection for this zone
468  int ii = m_LayerSelectionCtrl->GetFirstSelected();
469 
470  if( ii < 0 && aPromptForErrors )
471  {
472  DisplayError( this, _( "No layer selected." ) );
473  return false;
474  }
475 
477 
478  // Get the net name selection for this zone
479  ii = m_ListNetNameSelection->GetSelection();
480 
481  if( ii < 0 && aPromptForErrors )
482  {
483  DisplayError( this, _( "No net selected." ) );
484  return false;
485  }
486 
487  wxString net_name = m_ListNetNameSelection->GetString( ii );
488 
490 
491  // Search net_code for this net, if a net was selected
492  if( m_ListNetNameSelection->GetSelection() > 0 )
493  {
494  NETINFO_ITEM* net = m_Parent->GetBoard()->FindNet( net_name );
495 
496  if( net )
498  }
499 
500  return true;
501 }
502 
503 
505 {
506  int selection = m_cornerSmoothingChoice->GetSelection();
507 
508  switch( selection )
509  {
511  m_cornerSmoothingValue->Enable( false );
512  m_cornerSmoothingCtrl->Enable( false );
513  break;
515  m_cornerSmoothingValue->Enable( true );
516  m_cornerSmoothingCtrl->Enable( true );
517  m_cornerSmoothingValue->SetLabel( _( "Chamfer distance" ) );
519  break;
521  m_cornerSmoothingValue->Enable( true );
522  m_cornerSmoothingCtrl->Enable( true );
523  m_cornerSmoothingValue->SetLabel( _( "Fillet radius" ) );
525  break;
526  }
527 }
528 
529 
531 {
534 
536 
537  if( m_Config )
538  {
539  m_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetDisplayOption->GetSelection() );
540  wxString Filter = m_DoNotShowNetNameFilter->GetValue();
541  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, Filter );
542  }
543 }
544 
545 
547 {
548  if( !AcceptOptions( true, true ) )
549  return;
550 
551  // Export settings ( but layer and netcode ) to others copper zones
552  BOARD* pcb = m_Parent->GetBoard();
553 
554  for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
555  {
556  ZONE_CONTAINER* zone = pcb->GetArea( ii );
557 
558  // Cannot export settings from a copper zone
559  // to a zone keepout:
560  if( zone->GetIsKeepout() )
561  continue;
562 
563  m_settings.ExportSetting( *zone, false ); // false = partial export
564  m_Parent->OnModify();
565  }
566 
567  m_OnExitCode = ZONE_EXPORT_VALUES; // values are exported to others zones
568 }
569 
570 
571 void DIALOG_COPPER_ZONE::OnPadsInZoneClick( wxCommandEvent& event )
572 {
573  // Antipad and spokes are significant only for thermals
574  // However, even if thermals are disabled, these parameters must be set
575  // for pads which have local settings with thermal enabled
576  // Previously, wxTextCtrl widgets related to thermal settings were disabled,
577  // but this is not a good idea. We leave them always enabled.
578 }
579 
580 
582 {
583  switch( m_NetDisplayOption->GetSelection() )
584  {
585  case 0:
586  m_NetSortingByPadCount = false;
587  m_NetFiltering = false;
588  break;
589 
590  case 1:
591  m_NetSortingByPadCount = true;
592  m_NetFiltering = false;
593  break;
594 
595  case 2:
596  m_NetSortingByPadCount = false;
597  m_NetFiltering = true;
598  break;
599 
600  case 3:
601  m_NetSortingByPadCount = true;
602  m_NetFiltering = true;
603  break;
604  }
605 }
606 
607 
608 void DIALOG_COPPER_ZONE::OnRunFiltersButtonClick( wxCommandEvent& event )
609 {
611 
612  // Ensure filtered option for nets
613  if( m_NetDisplayOption->GetSelection() == 0 )
614  m_NetDisplayOption->SetSelection( 2 );
615  else if( m_NetDisplayOption->GetSelection() == 1 )
616  m_NetDisplayOption->SetSelection( 3 );
617 
620 }
621 
622 
624 {
625  wxArrayString listNetName;
626 
628 
629  if( m_NetFiltering )
630  {
631  wxString doNotShowFilter = m_DoNotShowNetNameFilter->GetValue();
632  wxString ShowFilter = m_ShowNetNameFilter->GetValue();
633 
634  for( unsigned ii = 0; ii < listNetName.GetCount(); ii++ )
635  {
636  if( listNetName[ii].Matches( doNotShowFilter ) )
637  {
638  listNetName.RemoveAt( ii );
639  ii--;
640  }
641  else if( !listNetName[ii].Matches( ShowFilter ) )
642  {
643  listNetName.RemoveAt( ii );
644  ii--;
645  }
646  }
647  }
648 
649  listNetName.Insert( wxT( "<no net>" ), 0 );
650 
651  // Ensure currently selected net for the zone is visible, regardless of filters
652  int selectedNetListNdx = -1;
653  int net_select = m_settings.m_NetcodeSelection;
654 
655  if( net_select > 0 )
656  {
657  NETINFO_ITEM* equipot = m_Parent->GetBoard()->FindNet( net_select );
658  if( equipot )
659  {
660  selectedNetListNdx = listNetName.Index( equipot->GetNetname() );
661 
662  if( wxNOT_FOUND == selectedNetListNdx )
663  {
664  // the currently selected net must *always* be visible.
665  // <no net> is the zero'th index, so pick next lowest
666  listNetName.Insert( equipot->GetNetname(), 1 );
667  selectedNetListNdx = 1;
668  }
669  }
670  }
671  else if( net_select == 0 )
672  selectedNetListNdx = 0; // SetSelection() on "<no net>"
673  else
674  {
675  // selectedNetListNdx remains -1, no net selected.
676  }
677 
678  m_ListNetNameSelection->Clear();
679  m_ListNetNameSelection->InsertItems( listNetName, 0 );
680  m_ListNetNameSelection->SetSelection( 0 );
681 
682  if( selectedNetListNdx >= 0 )
683  {
684  m_ListNetNameSelection->SetSelection( selectedNetListNdx );
685  m_ListNetNameSelection->EnsureVisible( selectedNetListNdx );
686  }
687 }
688 
689 
690 wxBitmap DIALOG_COPPER_ZONE::makeLayerBitmap( COLOR4D aColor, COLOR4D aBackground )
691 {
692  wxBitmap bitmap( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
693  wxBrush brush;
694  wxMemoryDC iconDC;
695 
696  iconDC.SelectObject( bitmap );
697 
698  brush.SetStyle( wxBRUSHSTYLE_SOLID );
699  brush.SetColour( aBackground.WithAlpha(1.0).ToColour() );
700  iconDC.SetBrush( brush );
701  iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
702 
703  brush.SetColour( aColor.ToColour() );
704  iconDC.SetBrush( brush );
705  iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
706 
707  return bitmap;
708 }
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 LAYER_BITMAP_SIZE_Y
#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)
Function GetTextSize returns the size of aSingleLine of text when it is rendered in aWindow using wha...
Definition: common.cpp:94
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
COLOR4D WithAlpha(double aAlpha) const
Function WithAlpha Returns a colour with the same colour, but the given alpha.
Definition: color4d.h:237
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
#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:1011
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:982
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
wxBitmap makeLayerBitmap(COLOR4D aColor, COLOR4D aBackground)
Function makeLayerBitmap creates the colored rectangle bitmaps used in the layer selection widget...
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
#define LAYER_BITMAP_SIZE_X
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