KiCad PCB EDA Suite
dialog_track_via_properties.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015 CERN
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
26 #include <pcb_layer_box_selector.h>
27 #include <tools/selection_tool.h>
28 #include <class_track.h>
29 #include <pcb_edit_frame.h>
30 #include <confirm.h>
31 #include <widgets/text_ctrl_eval.h>
32 
34 #include <board_commit.h>
35 
37  DIALOG_TRACK_VIA_PROPERTIES_BASE( aParent ), m_items( aItems ),
38  m_trackStartX( aParent, m_TrackStartXCtrl, m_TrackStartXUnit ),
39  m_trackStartY( aParent, m_TrackStartYCtrl, m_TrackStartYUnit ),
40  m_trackEndX( aParent, m_TrackEndXCtrl, m_TrackEndXUnit ),
41  m_trackEndY( aParent, m_TrackEndYCtrl, m_TrackEndYUnit ),
42  m_trackWidth( aParent, m_TrackWidthCtrl, m_TrackWidthUnit ),
43  m_viaX( aParent, m_ViaXCtrl, m_ViaXUnit ), m_viaY( aParent, m_ViaYCtrl, m_ViaYUnit ),
44  m_viaDiameter( aParent, m_ViaDiameterCtrl, m_ViaDiameterUnit ),
45  m_viaDrill( aParent, m_ViaDrillCtrl, m_ViaDrillUnit ),
46  m_tracks( false ), m_vias( false )
47 {
48  wxASSERT( !m_items.Empty() );
49 
50  // This is a way to trick gcc into considering these variables as initialized
51  OPT<int> trackStartX( []()->OPT<int> { return NULLOPT; }() );
52  OPT<int> trackStartY( []()->OPT<int> { return NULLOPT; }() );
53  OPT<int> trackEndX( []()->OPT<int> { return NULLOPT; }() );
54  OPT<int> trackEndY( []()->OPT<int> { return NULLOPT; }() );
55  OPT<int> trackWidth( []()->OPT<int> { return NULLOPT; }() );
56  OPT<PCB_LAYER_ID> trackLayer( []()->OPT<PCB_LAYER_ID> { return NULLOPT; }() );
57  OPT<int> viaX( []()->OPT<int> { return NULLOPT; }() );
58  OPT<int> viaY( []()->OPT<int> { return NULLOPT; }() );
59  OPT<int> viaDiameter( []()->OPT<int> { return NULLOPT; }() );
60  OPT<int> viaDrill( []()->OPT<int> { return NULLOPT; }() );
61 
62  VIATYPE_T viaType = VIA_NOT_DEFINED;
63  PCB_LAYER_ID viaStartLayer = UNDEFINED_LAYER;
64  PCB_LAYER_ID viaEndLayer = UNDEFINED_LAYER;
65 
66  m_haveUniqueNet = true;
67  int prevNet = -1;
68 
69  m_NetComboBox->SetBoard( aParent->GetBoard() );
70  m_NetComboBox->Enable( true );
71 
72  bool hasLocked = false;
73  bool hasUnlocked = false;
74 
75  for( auto& item : m_items )
76  {
77  int net = static_cast<BOARD_CONNECTED_ITEM*>(item)->GetNetCode();
78 
79  if( prevNet >= 0 && net != prevNet )
80  {
81  printf("prev %d net %d\n", net, prevNet );
82  m_haveUniqueNet = false;
83  break;
84  }
85 
86  prevNet = net;
87  }
88 
89  if ( m_haveUniqueNet )
90  {
91  m_NetComboBox->SetSelectedNet( prevNet );
92  }
93  else
94  {
95  m_NetComboBox->SetMultiple( true );
96  }
97 
98 
99  // Look for values that are common for every item that is selected
100  for( auto& item : m_items )
101  {
102  switch( item->Type() )
103  {
104  case PCB_TRACE_T:
105  {
106  const TRACK* t = static_cast<const TRACK*>( item );
107 
108  if( !m_tracks ) // first track in the list
109  {
110  trackStartX = t->GetStart().x;
111  trackStartY = t->GetStart().y;
112  trackEndX = t->GetEnd().x;
113  trackEndY = t->GetEnd().y;
114  trackWidth = t->GetWidth();
115  trackLayer = t->GetLayer();
116  m_tracks = true;
117  }
118  else // check if values are the same for every selected track
119  {
120  if( trackStartX && ( *trackStartX != t->GetStart().x ) )
121  trackStartX = NULLOPT;
122 
123  if( trackStartY && ( *trackStartY != t->GetStart().y ) )
124  trackStartY = NULLOPT;
125 
126  if( trackEndX && ( *trackEndX != t->GetEnd().x ) )
127  trackEndX = NULLOPT;
128 
129  if( trackEndY && ( *trackEndY != t->GetEnd().y ) )
130  trackEndY = NULLOPT;
131 
132  if( trackWidth && ( *trackWidth != t->GetWidth() ) )
133  trackWidth = NULLOPT;
134 
135  if( trackLayer && ( *trackLayer != t->GetLayer() ) )
136  trackLayer = NULLOPT;
137  }
138 
139  if( t->IsLocked() )
140  hasLocked = true;
141  else
142  hasUnlocked = true;
143 
144  break;
145  }
146 
147  case PCB_VIA_T:
148  {
149  const VIA* v = static_cast<const VIA*>( item );
150 
151  if( !m_vias ) // first via in the list
152  {
153  viaX = v->GetPosition().x;
154  viaY = v->GetPosition().y;
155  viaDiameter = v->GetWidth();
156  viaDrill = v->GetDrillValue();
157  m_vias = true;
158  viaType = v->GetViaType();
159  viaStartLayer = v->TopLayer();
160  viaEndLayer = v->BottomLayer();
161  }
162  else // check if values are the same for every selected via
163  {
164  if( viaX && ( *viaX != v->GetPosition().x ) )
165  viaX = NULLOPT;
166 
167  if( viaY && ( *viaY != v->GetPosition().y ) )
168  viaY = NULLOPT;
169 
170  if( viaDiameter && ( *viaDiameter != v->GetWidth() ) )
171  viaDiameter = NULLOPT;
172 
173  if( viaDrill && ( *viaDrill != v->GetDrillValue() ) )
174  viaDrill = NULLOPT;
175 
176  if( viaType != v->GetViaType() )
177  viaType = VIA_NOT_DEFINED;
178 
179  if( viaStartLayer != v->TopLayer() )
180  viaStartLayer = UNDEFINED_LAYER;
181 
182  if( viaEndLayer != v->BottomLayer() )
183  viaEndLayer = UNDEFINED_LAYER;
184  }
185 
186  if( v->IsLocked() )
187  hasLocked = true;
188  else
189  hasUnlocked = true;
190 
191  break;
192  }
193 
194  default:
195  {
196  wxASSERT( false );
197  break;
198  }
199  }
200  }
201 
202  wxASSERT( m_tracks || m_vias );
203 
204  if( m_vias )
205  {
206  setCommonVal( viaX, m_ViaXCtrl, m_viaX );
207  setCommonVal( viaY, m_ViaYCtrl, m_viaY );
209  setCommonVal( viaDrill, m_ViaDrillCtrl, m_viaDrill );
210 
212 
213  int viaSelection = wxNOT_FOUND;
214 
215  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
216  {
217  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
218  wxString msg = StringFromValue( g_UserUnit, viaDimension->m_Diameter, false )
219  + " / " + StringFromValue( g_UserUnit, viaDimension->m_Drill, false );
220  m_DesignRuleViasCtrl->Append( msg, viaDimension );
221 
222  if( viaSelection == wxNOT_FOUND && viaDiameter == viaDimension->m_Diameter
223  && viaDrill == viaDimension->m_Drill )
224  {
225  viaSelection = ii;
226  }
227  }
228 
229  m_DesignRuleViasCtrl->SetSelection( viaSelection );
230 
231  m_DesignRuleViasCtrl->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaSelect ), NULL, this );
232  m_ViaDiameterCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
233  m_ViaDrillCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
234  m_ViaTypeChoice->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
235 
236  m_ViaDiameterCtrl->SetFocus();
237 
238  m_ViaTypeChoice->Enable();
239 
240  if( viaType == VIA_THROUGH )
241  m_ViaTypeChoice->SetSelection( 0 );
242  else if( viaType == VIA_MICROVIA )
243  m_ViaTypeChoice->SetSelection( 1 );
244  else if ( viaType == VIA_BLIND_BURIED )
245  m_ViaTypeChoice->SetSelection( 2 );
246  else if( viaType == VIA_NOT_DEFINED )
247  m_ViaTypeChoice->SetSelection( 3 );
248 
249 
252  m_ViaStartLayer->SetBoardFrame( aParent );
256  m_ViaEndLayer->SetBoardFrame( aParent );
258 
259 
260  m_ViaStartLayer->SetLayerSelection( viaStartLayer );
261  m_ViaEndLayer->SetLayerSelection( viaEndLayer );
262 
263  m_ViaStartLayer->Enable( false );
264  m_ViaEndLayer->Enable( false );
265 
266  if( viaType != VIA_THROUGH ) // check if selected type isnt through.
267  {
268  m_ViaStartLayer->Enable();
269  m_ViaEndLayer->Enable();
270  }
271 
272  }
273  else
274  {
275  m_MainSizer->Hide( m_sbViaSizer, true );
276  }
277 
278  if( m_tracks )
279  {
285 
286  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
287  {
288  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
289  wxString msg = StringFromValue( g_UserUnit, width, false );
290  m_TrackWidthCtrl->Append( msg );
291  }
292 
295  m_TrackLayerCtrl->SetBoardFrame( aParent );
297 
298  if( trackLayer )
299  m_TrackLayerCtrl->SetLayerSelection( *trackLayer );
300 
301  m_TrackWidthCtrl->SetFocus();
302  }
303  else
304  {
305  m_MainSizer->Hide( m_sbTrackSizer, true );
306  }
307 
308  if( hasLocked && hasUnlocked )
309  {
310  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
311  }
312  else if( hasLocked )
313  {
314  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
315  }
316  else
317  {
318  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
319  }
320 
321 
322  m_StdButtonsOK->SetDefault();
323 
324  // Pressing ENTER when any of the text input fields is active applies changes
325  Connect( wxEVT_TEXT_ENTER, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onOkClick ),
326  NULL, this );
327 }
328 
329 
331 {
332  if( !check() )
333  return false;
334 
335  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
336  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
337 
338  for( auto item : m_items )
339  {
340  aCommit.Modify( item );
341 
342  switch( item->Type() )
343  {
344  case PCB_TRACE_T:
345  {
346  wxASSERT( m_tracks );
347  TRACK* t = static_cast<TRACK*>( item );
348 
350  {
351  wxPoint start = t->GetStart();
352 
353  if( m_trackStartX.Valid() )
354  start.x = m_trackStartX.GetValue();
355 
356  if( m_trackStartY.Valid() )
357  start.y = m_trackStartY.GetValue();
358 
359  t->SetStart( start );
360  }
361 
362  if( m_trackEndX.Valid() || m_trackEndY.Valid() )
363  {
364  wxPoint end = t->GetEnd();
365 
366  if( m_trackEndX.Valid() )
367  end.x = m_trackEndX.GetValue();
368 
369  if( m_trackEndY.Valid() )
370  end.y = m_trackEndY.GetValue();
371 
372  t->SetEnd( end );
373  }
374 
375  if( m_trackNetclass->IsChecked() )
376  {
377  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
378  }
379  else if( m_trackWidth.Valid() )
380  {
382  }
383 
385 
386  if( layer != UNDEFINED_LAYER )
387  t->SetLayer( (PCB_LAYER_ID) layer );
388 
389  if( changeLock )
390  t->SetLocked( setLock );
391 
393  {
394  printf("snc %d\n", m_NetComboBox->GetSelectedNet());
396  }
397 
398 
399  break;
400  }
401 
402  case PCB_VIA_T:
403  {
404  wxASSERT( m_vias );
405 
406  VIA* v = static_cast<VIA*>( item );
407 
408  if( m_viaX.Valid() || m_viaY.Valid() )
409  {
410  wxPoint pos = v->GetPosition();
411 
412  if( m_viaX.Valid() )
413  pos.x = m_viaX.GetValue();
414 
415  if( m_viaY.Valid() )
416  pos.y = m_viaY.GetValue();
417 
418  v->SetPosition( pos );
419  }
420 
421  if( m_ViaTypeChoice->GetSelection() != 3)
422  {
423  switch( m_ViaTypeChoice->GetSelection() )
424  {
425  case 0:
426  v->SetViaType( VIA_THROUGH );
427  v->SanitizeLayers();
428  break;
429  case 1:
430  v->SetViaType( VIA_MICROVIA );
431  break;
432  case 2:
434  break;
435  default:
436  break;
437  }
438 
439  }
440 
441  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
442  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
443 
444  if (startLayer != UNDEFINED_LAYER )
445  v->SetTopLayer( startLayer );
446 
447  if (endLayer != UNDEFINED_LAYER )
448  v->SetBottomLayer( endLayer );
449 
450  v->SanitizeLayers();
451 
452  if( m_viaNetclass->IsChecked() )
453  {
454  switch( v->GetViaType() )
455  {
456  default:
457  wxFAIL_MSG("Unhandled via type");
458  // fall through
459 
460  case VIA_THROUGH:
461  case VIA_BLIND_BURIED:
462  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
463  v->SetDrill( v->GetNetClass()->GetViaDrill() );
464  break;
465 
466  case VIA_MICROVIA:
467  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
468  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
469 
470  break;
471  }
472  }
473  else
474  {
475  if( m_viaDiameter.Valid() )
477 
478  if( m_viaDrill.Valid() )
479  v->SetDrill( m_viaDrill.GetValue() );
480 
481  }
482 
484  {
485  printf("snc %d\n", m_NetComboBox->GetSelectedNet());
487  }
488 
489  if( changeLock )
490  v->SetLocked( setLock );
491 
492  break;
493  }
494 
495  default:
496  wxASSERT( false );
497  break;
498  }
499  }
500 
501  return true;
502 }
503 
504 
505 void DIALOG_TRACK_VIA_PROPERTIES::onClose( wxCloseEvent& aEvent )
506 {
507  EndModal( 0 );
508 }
509 
510 
512 {
513  bool enableNC = aEvent.IsChecked();
514 
515  m_TrackWidthLabel->Enable( !enableNC );
516  m_TrackWidthCtrl->Enable( !enableNC );
517  m_TrackWidthUnit->Enable( !enableNC );
518 }
519 
520 
522 {
523  bool enableNC = aEvent.IsChecked();
524 
525  m_DesignRuleVias->Enable( !enableNC );
526  m_DesignRuleViasCtrl->Enable( !enableNC );
527  m_DesignRuleViasUnit->Enable( !enableNC );
528 
529  m_ViaDiameterLabel->Enable( !enableNC );
530  m_ViaDiameterCtrl->Enable( !enableNC );
531  m_ViaDiameterUnit->Enable( !enableNC );
532 
533  m_ViaDrillLabel->Enable( !enableNC );
534  m_ViaDrillCtrl->Enable( !enableNC );
535  m_ViaDrillUnit->Enable( !enableNC );
536 }
537 
538 
539 void DIALOG_TRACK_VIA_PROPERTIES::onCancelClick( wxCommandEvent& aEvent )
540 {
541  EndModal( 0 );
542 }
543 
544 
545 void DIALOG_TRACK_VIA_PROPERTIES::onOkClick( wxCommandEvent& aEvent )
546 {
547  if( check() )
548  EndModal( 1 );
549 }
550 
551 
552 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
553 {
554  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
555 
556  wxString msg = StringFromValue( g_UserUnit, viaDimension->m_Diameter, false );
557  m_ViaDiameterCtrl->ChangeValue( msg );
558 
559  msg = StringFromValue( g_UserUnit, viaDimension->m_Drill, false );
560  m_ViaDrillCtrl->ChangeValue( msg );
561 }
562 
563 
564 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
565 {
566  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
567 
568  if( m_vias )
569  {
570  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
571  {
572  m_ViaStartLayer->Enable();
573  m_ViaEndLayer->Enable();
574  }
575  else
576  {
579 
580  m_ViaStartLayer->Enable( false );
581  m_ViaEndLayer->Enable( false );
582  }
583  }
584 
585 }
586 
587 
589 {
590  bool trackNetclass = m_trackNetclass->IsChecked();
591  bool viaNetclass = m_trackNetclass->IsChecked();
592 
593  if( m_tracks && !trackNetclass && m_trackWidth.Valid() && m_trackWidth.GetValue() <= 0 )
594  {
595  DisplayError( GetParent(), _( "Invalid track width" ) );
596  m_TrackWidthCtrl->SetFocus();
597  return false;
598  }
599 
600  if( m_vias && !viaNetclass )
601  {
602  if( m_viaDiameter.Valid() && m_viaDiameter.GetValue() <= 0 )
603  {
604  DisplayError( GetParent(), _( "Invalid via diameter" ) );
605  m_ViaDiameterCtrl->SetFocus();
606  return false;
607  }
608 
609  if( m_viaDrill.Valid() && m_viaDrill.GetValue() <= 0 )
610  {
611  DisplayError( GetParent(), _( "Invalid via drill size" ) );
612  m_ViaDrillCtrl->SetFocus();
613  return false;
614  }
615 
617  {
618  DisplayError( GetParent(), _( "Via drill size has to be smaller than via diameter" ) );
619  m_ViaDrillCtrl->SetFocus();
620  return false;
621  }
622 
623  }
624 
625  if( m_vias)
626  {
628  {
629  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
630  return false;
631  }
632  }
633 
634  return true;
635 }
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:137
Struct VIA_DIMENSION is a small helper container to handle a stock of specific vias each with unique ...
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:106
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
PCB_LAYER_ID BottomLayer() const
void onTrackNetclassCheck(wxCommandEvent &aEvent) override
void SetViaType(VIATYPE_T aViaType)
Definition: class_track.h:456
bool check() const
Checks if the dialog values are correct.
void SetPosition(const wxPoint &aPoint) override
Definition: class_track.h:428
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
This file is part of the common library.
void SetEnd(const wxPoint &aEnd)
Definition: class_track.h:118
std::vector< int > m_TrackWidthList
Track width list.
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetBoard(BOARD *aBoard)
const SELECTION & m_items
Selected items to be modified.
bool m_tracks
Flag that determines if the dialog displays track properties.
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:204
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:696
bool m_vias
Flag that determines if the dialog displays via properties.
BOARD * GetBoard() const
Class COMMIT.
Definition: commit.h:71
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
VIATYPE_T
Definition: class_track.h:50
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
virtual int GetValue() const
Function GetValue Returns the current value in Internal Units.
Definition: unit_binder.cpp:64
const wxPoint & GetEnd() const
Definition: class_track.h:119
Functions relatives to tracks, vias and segments used to fill zones.
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
void onCancelClick(wxCommandEvent &aEvent) override
void SetWidth(int aWidth)
Definition: class_track.h:115
bool IsUniqueNetSelected() const
void SetLocked(bool aLocked) override
Function SetLocked modifies &#39;lock&#39; status for of the item.
Definition: class_track.h:142
PCB_LAYER_ID
A quick note on layer IDs:
const auto NULLOPT
Definition: optional.h:9
VIATYPE_T GetViaType() const
Definition: class_track.h:455
std::shared_ptr< NETCLASS > GetNetClass() const
Function GetNetClass returns the NETCLASS for this item.
const wxPoint & GetStart() const
Definition: class_track.h:122
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:484
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
int SetLayerSelection(LAYER_NUM layer)
DIALOG_TRACK_VIA_PROPERTIES(PCB_BASE_FRAME *aParent, const SELECTION &aItems)
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
bool SetLayersHotkeys(bool value)
const wxPoint GetPosition() const override
Definition: class_track.h:427
void onViaSelect(wxCommandEvent &aEvent)
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
void SetSelectedNet(int aNetcode)
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void onViaEdit(wxCommandEvent &aEvent)
void onOkClick(wxCommandEvent &aEvent) override
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
void SetMultiple(bool aMultiple=true)
PCB_LAYER_ID TopLayer() const
int GetWidth() const
Definition: class_track.h:116
void onViaNetclassCheck(wxCommandEvent &aEvent) override
void SetTopLayer(PCB_LAYER_ID aLayer)
void onClose(wxCloseEvent &aEvent) override
LAYER_NUM GetLayerSelection() const
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: class_track.h:463
void setCommonVal(const OPT< T > &aVal, wxTextEntry *aTxtEntry, UNIT_BINDER &aBinder)
Sets wxTextEntry to the value stored in OPT<T> or "<...>" if it is not available. ...
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Vias size and drill list.
boost::optional< T > OPT
Definition: optional.h:7
void SetBottomLayer(PCB_LAYER_ID aLayer)
void SetStart(const wxPoint &aStart)
Definition: class_track.h:121
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
Class DIALOG_TRACK_VIA_PROPERTIES_BASE.
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via...
bool Valid() const
Function Valid Returns true if the text control contains a real number.
Definition: unit_binder.cpp:72
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:74
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
bool Apply(COMMIT &aCommit)
Applies values from the dialog to the selected items.