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  * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
27 #include <pcb_layer_box_selector.h>
28 #include <tools/selection_tool.h>
29 #include <class_track.h>
30 #include <pcb_edit_frame.h>
31 #include <confirm.h>
33 #include <class_module.h>
34 #include <widgets/net_selector.h>
35 #include <board_commit.h>
36 
37 #define MIN_SIZE ( int )( 0.001 * IU_PER_MM )
38 
40  const SELECTION& aItems,
41  COMMIT& aCommit ) :
43  m_frame( aParent ),
44  m_items( aItems ),
45  m_commit( aCommit ),
46  m_trackStartX( aParent, m_TrackStartXLabel, m_TrackStartXCtrl, m_TrackStartXUnit ),
47  m_trackStartY( aParent, m_TrackStartYLabel, m_TrackStartYCtrl, m_TrackStartYUnit ),
48  m_trackEndX( aParent, m_TrackEndXLabel, m_TrackEndXCtrl, m_TrackEndXUnit ),
49  m_trackEndY( aParent, m_TrackEndYLabel, m_TrackEndYCtrl, m_TrackEndYUnit ),
50  m_trackWidth( aParent, m_TrackWidthLabel, m_TrackWidthCtrl, m_TrackWidthUnit, true, MIN_SIZE ),
51  m_viaX( aParent, m_ViaXLabel, m_ViaXCtrl, m_ViaXUnit ),
52  m_viaY( aParent, m_ViaYLabel, m_ViaYCtrl, m_ViaYUnit ),
53  m_viaDiameter( aParent, m_ViaDiameterLabel, m_ViaDiameterCtrl, m_ViaDiameterUnit, true, MIN_SIZE ),
54  m_viaDrill( aParent, m_ViaDrillLabel, m_ViaDrillCtrl, m_ViaDrillUnit, true, MIN_SIZE ),
55  m_tracks( false ),
56  m_vias( false )
57 {
58  wxASSERT( !m_items.Empty() );
59 
60  VIATYPE_T viaType = VIA_NOT_DEFINED;
61 
62  m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
63 
66  m_TrackLayerCtrl->SetBoardFrame( aParent );
68 
71  m_ViaStartLayer->SetBoardFrame( aParent );
73 
76  m_ViaEndLayer->SetBoardFrame( aParent );
78 
79  bool nets = false;
80  int net = 0;
81  bool hasLocked = false;
82  bool hasUnlocked = false;
83 
84  // Look for values that are common for every item that is selected
85  for( auto& item : m_items )
86  {
87  if( !nets )
88  {
89  net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode();
90  nets = true;
91  }
92  else if( net != static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode() )
93  {
94  net = -1;
95  }
96 
97  switch( item->Type() )
98  {
99  case PCB_TRACE_T:
100  {
101  const TRACK* t = static_cast<const TRACK*>( item );
102 
103  if( !m_tracks ) // first track in the list
104  {
107  m_trackEndX.SetValue( t->GetEnd().x );
108  m_trackEndY.SetValue( t->GetEnd().y );
111  m_tracks = true;
112  }
113  else // check if values are the same for every selected track
114  {
115  if( m_trackStartX.GetValue() != t->GetStart().x )
117 
118  if( m_trackStartY.GetValue() != t->GetStart().y )
120 
121  if( m_trackEndX.GetValue() != t->GetEnd().x )
123 
124  if( m_trackEndY.GetValue() != t->GetEnd().y )
126 
127  if( m_trackWidth.GetValue() != t->GetWidth() )
129 
132  }
133 
134  if( t->IsLocked() )
135  hasLocked = true;
136  else
137  hasUnlocked = true;
138 
139  break;
140  }
141 
142  case PCB_VIA_T:
143  {
144  const VIA* v = static_cast<const VIA*>( item );
145 
146  if( !m_vias ) // first via in the list
147  {
148  m_viaX.SetValue( v->GetPosition().x );
149  m_viaY.SetValue( v->GetPosition().y );
152  m_vias = true;
153  viaType = v->GetViaType();
156  }
157  else // check if values are the same for every selected via
158  {
159  if( m_viaX.GetValue() != v->GetPosition().x )
161 
162  if( m_viaY.GetValue() != v->GetPosition().y )
164 
165  if( m_viaDiameter.GetValue() != v->GetWidth() )
167 
168  if( m_viaDrill.GetValue() != v->GetDrillValue() )
170 
171  if( viaType != v->GetViaType() )
172  viaType = VIA_NOT_DEFINED;
173 
176 
179  }
180 
181  if( v->IsLocked() )
182  hasLocked = true;
183  else
184  hasUnlocked = true;
185 
186  break;
187  }
188 
189  default:
190  {
191  wxASSERT( false );
192  break;
193  }
194  }
195  }
196 
197  if ( net >= 0 )
199  else
201 
202  wxASSERT( m_tracks || m_vias );
203 
204  if( m_vias )
205  {
207 
208  int viaSelection = wxNOT_FOUND;
209 
210  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
211  {
212  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
213  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false, true )
214  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false, true );
215  m_DesignRuleViasCtrl->Append( msg, viaDimension );
216 
217  if( viaSelection == wxNOT_FOUND
218  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
219  && m_viaDrill.GetValue() == viaDimension->m_Drill )
220  {
221  viaSelection = ii;
222  }
223  }
224 
225  m_DesignRuleViasCtrl->SetSelection( viaSelection );
226 
227  m_DesignRuleViasCtrl->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaSelect ), NULL, this );
228  m_ViaDiameterCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
229  m_ViaDrillCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
230  m_ViaTypeChoice->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
231 
233 
234  m_ViaTypeChoice->Enable();
235 
236  switch( viaType )
237  {
238  case VIA_THROUGH: m_ViaTypeChoice->SetSelection( 0 ); break;
239  case VIA_MICROVIA: m_ViaTypeChoice->SetSelection( 1 ); break;
240  case VIA_BLIND_BURIED: m_ViaTypeChoice->SetSelection( 2 ); break;
241  case VIA_NOT_DEFINED: m_ViaTypeChoice->SetSelection( 3 ); break;
242  }
243 
244  m_ViaStartLayer->Enable( viaType != VIA_THROUGH );
245  m_ViaEndLayer->Enable( viaType != VIA_THROUGH );
246  }
247  else
248  {
249  m_MainSizer->Hide( m_sbViaSizer, true );
250  }
251 
252  if( m_tracks )
253  {
255 
256  int widthSelection = wxNOT_FOUND;
257 
258  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
259  {
260  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
261  wxString msg = StringFromValue( m_units, width, false, true );
262  m_DesignRuleWidthsCtrl->Append( msg );
263 
264  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
265  widthSelection = ii;
266  }
267 
268  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
269 
270  m_DesignRuleWidthsCtrl->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect ), NULL, this );
271  m_TrackWidthCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit ), NULL, this );
272 
274  }
275  else
276  {
277  m_MainSizer->Hide( m_sbTrackSizer, true );
278  }
279 
280  if( hasLocked && hasUnlocked )
281  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
282  else if( hasLocked )
283  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
284  else
285  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
286 
288 
289  m_StdButtonsOK->SetDefault();
290 
291  // Now all widgets have the size fixed, call FinishDialogSettings
293 }
294 
295 
296 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& changingPads )
297 {
298  wxString msg;
299 
300  if( changingPads.size() == 1 )
301  {
302  D_PAD* pad = *changingPads.begin();
303  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
304  "Do you wish to continue?" ),
305  pad->GetParent()->GetReference(),
306  pad->GetName(),
307  m_netSelector->GetValue() );
308  }
309  else if( changingPads.size() == 2 )
310  {
311  D_PAD* pad1 = *changingPads.begin();
312  D_PAD* pad2 = *( ++changingPads.begin() );
313  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
314  "Do you wish to continue?" ),
315  pad1->GetParent()->GetReference(),
316  pad1->GetName(),
317  pad2->GetParent()->GetReference(),
318  pad2->GetName(),
319  m_netSelector->GetValue() );
320  }
321  else
322  {
323  msg.Printf( _( "This will change the net assigned to %d connected pads to %s.\n"
324  "Do you wish to continue?" ),
325  changingPads.size(),
326  m_netSelector->GetValue() );
327  }
328 
329  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
330  dlg.SetOKLabel( _( "Continue" ) );
331  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
332 
333  return dlg.ShowModal() == wxID_OK;
334 }
335 
336 
338 {
339  auto connectivity = m_frame->GetBoard()->GetConnectivity();
340  int newNetCode = m_netSelector->GetSelectedNetcode();
341  std::vector<D_PAD*> changingPads;
342 
343  if ( !m_netSelector->IsIndeterminate() )
344  {
345  std::set<D_PAD*> connectedPads;
346 
347  for( auto& item : m_items )
348  {
349  auto boardItem = static_cast<BOARD_CONNECTED_ITEM*>( item );
350  connectivity->GetConnectedPads( boardItem, &connectedPads );
351  }
352 
353  for( D_PAD* pad : connectedPads )
354  {
355  if( pad->GetNetCode() != newNetCode )
356  changingPads.push_back( pad );
357  }
358  }
359 
360  // Run validations:
361 
362  if( changingPads.size() )
363  {
364  if( !confirmPadChange( changingPads ) )
365  return false;
366  }
367 
368  if( m_vias )
369  {
370  if( !m_viaDiameter.Validate( true ) || !m_viaDrill.Validate( true ) )
371  return false;
372 
373  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
374  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
376  {
377  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
378  m_ViaDrillCtrl->SelectAll();
379  m_ViaDrillCtrl->SetFocus();
380  return false;
381  }
382 
385  {
386  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
387  return false;
388  }
389  }
390 
391  if( m_tracks )
392  {
393  if( !m_trackWidth.Validate( true ) )
394  return false;
395  }
396 
397  // If we survived that, then save the changes:
398 
399  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
400  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
401 
402  for( auto item : m_items )
403  {
404  m_commit.Modify( item );
405 
406  switch( item->Type() )
407  {
408  case PCB_TRACE_T:
409  {
410  wxASSERT( m_tracks );
411  TRACK* t = static_cast<TRACK*>( item );
412 
414  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
415 
417  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
418 
420  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
421 
423  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
424 
425  if( m_trackNetclass->IsChecked() )
426  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
427  else if( !m_trackWidth.IsIndeterminate() )
429 
431 
432  if( layer != UNDEFINED_LAYER )
433  t->SetLayer( (PCB_LAYER_ID) layer );
434 
435  if( changeLock )
436  t->SetLocked( setLock );
437 
438  if ( !m_netSelector->IsIndeterminate() )
440 
441  break;
442  }
443 
444  case PCB_VIA_T:
445  {
446  wxASSERT( m_vias );
447  VIA* v = static_cast<VIA*>( item );
448 
449  if( !m_viaX.IsIndeterminate() )
450  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
451 
452  if( !m_viaY.IsIndeterminate() )
453  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
454 
455  if( m_ViaTypeChoice->GetSelection() != 3)
456  {
457  switch( m_ViaTypeChoice->GetSelection() )
458  {
459  default:
460  case 0: v->SetViaType( VIA_THROUGH ); v->SanitizeLayers(); break;
461  case 1: v->SetViaType( VIA_MICROVIA ); break;
462  case 2: v->SetViaType( VIA_BLIND_BURIED ); break;
463  }
464  }
465 
466  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
467  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
468 
469  if (startLayer != UNDEFINED_LAYER )
470  v->SetTopLayer( startLayer );
471 
472  if (endLayer != UNDEFINED_LAYER )
473  v->SetBottomLayer( endLayer );
474 
475  v->SanitizeLayers();
476 
477  if( m_viaNetclass->IsChecked() )
478  {
479  switch( v->GetViaType() )
480  {
481  default:
482  wxFAIL_MSG("Unhandled via type");
483  // fall through
484 
485  case VIA_THROUGH:
486  case VIA_BLIND_BURIED:
487  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
488  v->SetDrill( v->GetNetClass()->GetViaDrill() );
489  break;
490 
491  case VIA_MICROVIA:
492  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
493  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
494  break;
495  }
496  }
497  else
498  {
501 
502  if( !m_viaDrill.IsIndeterminate() )
503  v->SetDrill( m_viaDrill.GetValue() );
504  }
505 
506  if ( !m_netSelector->IsIndeterminate() )
508 
509  if( changeLock )
510  v->SetLocked( setLock );
511 
512  break;
513  }
514 
515  default:
516  wxASSERT( false );
517  break;
518  }
519  }
520 
521  if ( !m_netSelector->IsIndeterminate() )
522  {
523  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
524  // outwards. We therefore have to update the connected pads in order for the net
525  // change to "stick".
526  for( D_PAD* pad : changingPads )
527  {
528  m_commit.Modify( pad );
529  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
530  }
531  }
532 
533  m_commit.Push( _( "Edit track/via properties" ) );
534 
535  return true;
536 }
537 
538 
540 {
541  bool enableNC = aEvent.IsChecked();
542 
543  m_DesignRuleWidths->Enable( !enableNC );
544  m_DesignRuleWidthsCtrl->Enable( !enableNC );
545  m_DesignRuleWidthsUnits->Enable( !enableNC );
546 
547  m_trackWidth.Enable( !enableNC );
548 }
549 
550 
551 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
552 {
553  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
554 }
555 
556 
557 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
558 {
559  m_DesignRuleWidthsCtrl->SetSelection( wxNOT_FOUND );
560 }
561 
562 
564 {
565  bool enableNC = aEvent.IsChecked();
566 
567  m_DesignRuleVias->Enable( !enableNC );
568  m_DesignRuleViasCtrl->Enable( !enableNC );
569  m_DesignRuleViasUnit->Enable( !enableNC );
570 
571  m_viaDiameter.Enable( !enableNC );
572  m_viaDrill.Enable( !enableNC );
573 }
574 
575 
576 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
577 {
578  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
579 
580  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
581  m_viaDrill.ChangeValue( viaDimension->m_Drill );
582 }
583 
584 
585 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
586 {
587  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
588 
589  if( m_vias )
590  {
591  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
592  {
593  m_ViaStartLayer->Enable();
594  m_ViaEndLayer->Enable();
595  }
596  else
597  {
600 
601  m_ViaStartLayer->Enable( false );
602  m_ViaEndLayer->Enable( false );
603  }
604  }
605 }
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:137
virtual bool Validate(bool setFocusOnError=false)
Function Validate Validates the control, informing the user of any errors found.
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:116
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
void DoNotShowCheckbox(wxString file, int line)
Shows the &#39;do not show again&#39; checkbox
Definition: confirm.cpp:60
PCB_LAYER_ID BottomLayer() const
void onTrackNetclassCheck(wxCommandEvent &aEvent) override
void SetViaType(VIATYPE_T aViaType)
Definition: class_track.h:458
Helper class to create more flexible dialogs, including &#39;do not show again&#39; checkbox handling...
Definition: confirm.h:44
void SetPosition(const wxPoint &aPoint) override
Definition: class_track.h:430
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
void SetNotAllowedLayerSet(LSET aMask)
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:696
MODULE * GetParent() const
Definition: class_pad.h:162
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void onWidthSelect(wxCommandEvent &aEvent)
BOARD * GetBoard() const
Class COMMIT.
Definition: commit.h:71
int GetSelectedNetcode()
DIALOG_TRACK_VIA_PROPERTIES(PCB_BASE_FRAME *aParent, const SELECTION &aItems, COMMIT &aCommit)
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...
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:115
void onWidthEdit(wxCommandEvent &aEvent)
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 SetWidth(int aWidth)
Definition: class_track.h:115
virtual int GetValue()
Function GetValue Returns the current value in Internal Units.
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:
VIATYPE_T GetViaType() const
Definition: class_track.h:457
std::shared_ptr< NETCLASS > GetNetClass() const
Function GetNetClass returns the NETCLASS for this item.
#define INDETERMINATE
const wxPoint & GetStart() const
Definition: class_track.h:122
void SetSelectedNetcode(int aNetcode)
bool IsIndeterminate()
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
int SetLayerSelection(LAYER_NUM layer)
bool confirmPadChange(const std::vector< D_PAD * > &connectedPads)
const wxString & GetName() const
Definition: class_pad.h:190
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
void SetNetInfo(NETINFO_LIST *aNetInfoList)
bool SetLayersHotkeys(bool value)
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:750
const wxPoint GetPosition() const override
Definition: class_track.h:429
void onViaSelect(wxCommandEvent &aEvent)
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
void onViaEdit(wxCommandEvent &aEvent)
void SetIndeterminate()
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true)=0
Executes the changes.
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
PCB_LAYER_ID TopLayer() const
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:463
int GetWidth() const
Definition: class_track.h:116
void onViaNetclassCheck(wxCommandEvent &aEvent) override
void SetTopLayer(PCB_LAYER_ID aLayer)
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
LAYER_NUM GetLayerSelection() const
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: class_track.h:465
bool IsIndeterminate() const
Function IsIndeterminate Returns true if the control holds the indeterminate value (for instance...
std::vector< VIA_DIMENSION > m_ViasDimensionsList
void SetBottomLayer(PCB_LAYER_ID aLayer)
int ShowModal() override
Definition: confirm.cpp:102
wxString StringFromValue(EDA_UNITS_T aUnits, int aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:210
void SetStart(const wxPoint &aStart)
Definition: class_track.h:121
#define MIN_SIZE
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
Module description (excepted pads)
EDA_UNITS_T m_units
Definition: dialog_shim.h:172
Class DIALOG_TRACK_VIA_PROPERTIES_BASE.
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:296
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
void Enable(bool aEnable)
Function Enable Enables/diasables the label, widget and units label.
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit, bool aUseMils)
Get the units string for a given units type.
Definition: base_units.cpp:432
virtual void ChangeValue(int aValue)
Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units c...