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 
38  const SELECTION& aItems,
39  COMMIT& aCommit ) :
41  m_frame( aParent ),
42  m_items( aItems ),
43  m_commit( aCommit ),
44  m_trackStartX( aParent, m_TrackStartXLabel, m_TrackStartXCtrl, m_TrackStartXUnit ),
45  m_trackStartY( aParent, m_TrackStartYLabel, m_TrackStartYCtrl, m_TrackStartYUnit ),
46  m_trackEndX( aParent, m_TrackEndXLabel, m_TrackEndXCtrl, m_TrackEndXUnit ),
47  m_trackEndY( aParent, m_TrackEndYLabel, m_TrackEndYCtrl, m_TrackEndYUnit ),
48  m_trackWidth( aParent, m_TrackWidthLabel, m_TrackWidthCtrl, m_TrackWidthUnit, true ),
49  m_viaX( aParent, m_ViaXLabel, m_ViaXCtrl, m_ViaXUnit ),
50  m_viaY( aParent, m_ViaYLabel, m_ViaYCtrl, m_ViaYUnit ),
51  m_viaDiameter( aParent, m_ViaDiameterLabel, m_ViaDiameterCtrl, m_ViaDiameterUnit, true ),
52  m_viaDrill( aParent, m_ViaDrillLabel, m_ViaDrillCtrl, m_ViaDrillUnit, true ),
53  m_tracks( false ),
54  m_vias( false )
55 {
56  wxASSERT( !m_items.Empty() );
57 
58  VIATYPE_T viaType = VIA_NOT_DEFINED;
59 
60  m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
61 
64  m_TrackLayerCtrl->SetBoardFrame( aParent );
66 
69  m_ViaStartLayer->SetBoardFrame( aParent );
71 
74  m_ViaEndLayer->SetBoardFrame( aParent );
76 
77  bool nets = false;
78  int net = 0;
79  bool hasLocked = false;
80  bool hasUnlocked = false;
81 
82  // Look for values that are common for every item that is selected
83  for( auto& item : m_items )
84  {
85  if( !nets )
86  {
87  net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode();
88  nets = true;
89  }
90  else if( net != static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode() )
91  {
92  net = -1;
93  }
94 
95  switch( item->Type() )
96  {
97  case PCB_TRACE_T:
98  {
99  const TRACK* t = static_cast<const TRACK*>( item );
100 
101  if( !m_tracks ) // first track in the list
102  {
103  m_trackStartX.SetValue( t->GetStart().x );
104  m_trackStartY.SetValue( t->GetStart().y );
105  m_trackEndX.SetValue( t->GetEnd().x );
106  m_trackEndY.SetValue( t->GetEnd().y );
109  m_tracks = true;
110  }
111  else // check if values are the same for every selected track
112  {
113  if( m_trackStartX.GetValue() != t->GetStart().x )
115 
116  if( m_trackStartY.GetValue() != t->GetStart().y )
118 
119  if( m_trackEndX.GetValue() != t->GetEnd().x )
121 
122  if( m_trackEndY.GetValue() != t->GetEnd().y )
124 
125  if( m_trackWidth.GetValue() != t->GetWidth() )
127 
130  }
131 
132  if( t->IsLocked() )
133  hasLocked = true;
134  else
135  hasUnlocked = true;
136 
137  break;
138  }
139 
140  case PCB_VIA_T:
141  {
142  const VIA* v = static_cast<const VIA*>( item );
143 
144  if( !m_vias ) // first via in the list
145  {
146  m_viaX.SetValue( v->GetPosition().x );
147  m_viaY.SetValue( v->GetPosition().y );
150  m_vias = true;
151  viaType = v->GetViaType();
154  }
155  else // check if values are the same for every selected via
156  {
157  if( m_viaX.GetValue() != v->GetPosition().x )
159 
160  if( m_viaY.GetValue() != v->GetPosition().y )
162 
163  if( m_viaDiameter.GetValue() != v->GetWidth() )
165 
166  if( m_viaDrill.GetValue() != v->GetDrillValue() )
168 
169  if( viaType != v->GetViaType() )
170  viaType = VIA_NOT_DEFINED;
171 
174 
177  }
178 
179  if( v->IsLocked() )
180  hasLocked = true;
181  else
182  hasUnlocked = true;
183 
184  break;
185  }
186 
187  default:
188  {
189  wxASSERT( false );
190  break;
191  }
192  }
193  }
194 
195  if ( net >= 0 )
197  else
199 
200  wxASSERT( m_tracks || m_vias );
201 
202  if( m_vias )
203  {
205 
206  int viaSelection = wxNOT_FOUND;
207 
208  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
209  {
210  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
211  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false, true )
212  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false, true );
213  m_DesignRuleViasCtrl->Append( msg, viaDimension );
214 
215  if( viaSelection == wxNOT_FOUND
216  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
217  && m_viaDrill.GetValue() == viaDimension->m_Drill )
218  {
219  viaSelection = ii;
220  }
221  }
222 
223  m_DesignRuleViasCtrl->SetSelection( viaSelection );
224 
225  m_DesignRuleViasCtrl->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaSelect ), NULL, this );
226  m_ViaDiameterCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
227  m_ViaDrillCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
228  m_ViaTypeChoice->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
229 
231 
232  m_ViaTypeChoice->Enable();
233 
234  switch( viaType )
235  {
236  case VIA_THROUGH: m_ViaTypeChoice->SetSelection( 0 ); break;
237  case VIA_MICROVIA: m_ViaTypeChoice->SetSelection( 1 ); break;
238  case VIA_BLIND_BURIED: m_ViaTypeChoice->SetSelection( 2 ); break;
239  case VIA_NOT_DEFINED: m_ViaTypeChoice->SetSelection( 3 ); break;
240  }
241 
242  m_ViaStartLayer->Enable( viaType != VIA_THROUGH );
243  m_ViaEndLayer->Enable( viaType != VIA_THROUGH );
244  }
245  else
246  {
247  m_MainSizer->Hide( m_sbViaSizer, true );
248  }
249 
250  if( m_tracks )
251  {
253 
254  int widthSelection = wxNOT_FOUND;
255 
256  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
257  {
258  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
259  wxString msg = StringFromValue( m_units, width, false, true );
260  m_DesignRuleWidthsCtrl->Append( msg );
261 
262  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
263  widthSelection = ii;
264  }
265 
266  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
267 
268  m_DesignRuleWidthsCtrl->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect ), NULL, this );
269  m_TrackWidthCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit ), NULL, this );
270 
272  }
273  else
274  {
275  m_MainSizer->Hide( m_sbTrackSizer, true );
276  }
277 
278  if( hasLocked && hasUnlocked )
279  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
280  else if( hasLocked )
281  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
282  else
283  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
284 
286 
287  m_StdButtonsOK->SetDefault();
288 
289  // Now all widgets have the size fixed, call FinishDialogSettings
291 }
292 
293 
294 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& changingPads )
295 {
296  wxString msg;
297 
298  if( changingPads.size() == 1 )
299  {
300  D_PAD* pad = *changingPads.begin();
301  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
302  "Do you wish to continue?" ),
303  pad->GetParent()->GetReference(),
304  pad->GetName(),
305  m_netSelector->GetValue() );
306  }
307  else if( changingPads.size() == 2 )
308  {
309  D_PAD* pad1 = *changingPads.begin();
310  D_PAD* pad2 = *( ++changingPads.begin() );
311  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
312  "Do you wish to continue?" ),
313  pad1->GetParent()->GetReference(),
314  pad1->GetName(),
315  pad2->GetParent()->GetReference(),
316  pad2->GetName(),
317  m_netSelector->GetValue() );
318  }
319  else
320  {
321  msg.Printf( _( "This will change the net assigned to %d connected pads to %s.\n"
322  "Do you wish to continue?" ),
323  changingPads.size(),
324  m_netSelector->GetValue() );
325  }
326 
327  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
328  dlg.SetOKLabel( _( "Continue" ) );
329  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
330 
331  return dlg.ShowModal() == wxID_OK;
332 }
333 
334 
336 {
337  auto connectivity = m_frame->GetBoard()->GetConnectivity();
338  int newNetCode = m_netSelector->GetSelectedNetcode();
339  std::vector<D_PAD*> changingPads;
340 
341  if ( !m_netSelector->IsIndeterminate() )
342  {
343  std::set<D_PAD*> connectedPads;
344 
345  for( auto& item : m_items )
346  {
347  auto boardItem = static_cast<BOARD_CONNECTED_ITEM*>( item );
348  connectivity->GetConnectedPads( boardItem, &connectedPads );
349  }
350 
351  for( D_PAD* pad : connectedPads )
352  {
353  if( pad->GetNetCode() != newNetCode )
354  changingPads.push_back( pad );
355  }
356  }
357 
358  // Run validations:
359 
360  if( changingPads.size() )
361  {
362  if( !confirmPadChange( changingPads ) )
363  return false;
364  }
365 
366  if( m_vias )
367  {
368  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
369  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
370  return false;
371 
372  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
373  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
375  {
376  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
377  m_ViaDrillCtrl->SelectAll();
378  m_ViaDrillCtrl->SetFocus();
379  return false;
380  }
381 
384  {
385  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
386  return false;
387  }
388  }
389 
390  if( m_tracks )
391  {
392  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
393  return false;
394  }
395 
396  // If we survived that, then save the changes:
397 
398  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
399  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
400 
401  for( auto item : m_items )
402  {
403  m_commit.Modify( item );
404 
405  switch( item->Type() )
406  {
407  case PCB_TRACE_T:
408  {
409  wxASSERT( m_tracks );
410  TRACK* t = static_cast<TRACK*>( item );
411 
413  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
414 
416  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
417 
419  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
420 
422  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
423 
424  if( m_trackNetclass->IsChecked() )
425  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
426  else if( !m_trackWidth.IsIndeterminate() )
428 
430 
431  if( layer != UNDEFINED_LAYER )
432  t->SetLayer( (PCB_LAYER_ID) layer );
433 
434  if( changeLock )
435  t->SetLocked( setLock );
436 
437  if ( !m_netSelector->IsIndeterminate() )
439 
440  break;
441  }
442 
443  case PCB_VIA_T:
444  {
445  wxASSERT( m_vias );
446  VIA* v = static_cast<VIA*>( item );
447 
448  if( !m_viaX.IsIndeterminate() )
449  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
450 
451  if( !m_viaY.IsIndeterminate() )
452  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
453 
454  if( m_ViaTypeChoice->GetSelection() != 3)
455  {
456  switch( m_ViaTypeChoice->GetSelection() )
457  {
458  default:
459  case 0: v->SetViaType( VIA_THROUGH ); v->SanitizeLayers(); break;
460  case 1: v->SetViaType( VIA_MICROVIA ); break;
461  case 2: v->SetViaType( VIA_BLIND_BURIED ); break;
462  }
463  }
464 
465  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
466  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
467 
468  if (startLayer != UNDEFINED_LAYER )
469  v->SetTopLayer( startLayer );
470 
471  if (endLayer != UNDEFINED_LAYER )
472  v->SetBottomLayer( endLayer );
473 
474  v->SanitizeLayers();
475 
476  if( m_viaNetclass->IsChecked() )
477  {
478  switch( v->GetViaType() )
479  {
480  default:
481  wxFAIL_MSG("Unhandled via type");
482  // fall through
483 
484  case VIA_THROUGH:
485  case VIA_BLIND_BURIED:
486  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
487  v->SetDrill( v->GetNetClass()->GetViaDrill() );
488  break;
489 
490  case VIA_MICROVIA:
491  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
492  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
493  break;
494  }
495  }
496  else
497  {
500 
501  if( !m_viaDrill.IsIndeterminate() )
502  v->SetDrill( m_viaDrill.GetValue() );
503  }
504 
505  if ( !m_netSelector->IsIndeterminate() )
507 
508  if( changeLock )
509  v->SetLocked( setLock );
510 
511  break;
512  }
513 
514  default:
515  wxASSERT( false );
516  break;
517  }
518  }
519 
520  if ( !m_netSelector->IsIndeterminate() )
521  {
522  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
523  // outwards. We therefore have to update the connected pads in order for the net
524  // change to "stick".
525  for( D_PAD* pad : changingPads )
526  {
527  m_commit.Modify( pad );
528  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
529  }
530  }
531 
532  m_commit.Push( _( "Edit track/via properties" ) );
533 
534  return true;
535 }
536 
537 
539 {
540  bool enableNC = aEvent.IsChecked();
541 
542  m_DesignRuleWidths->Enable( !enableNC );
543  m_DesignRuleWidthsCtrl->Enable( !enableNC );
544  m_DesignRuleWidthsUnits->Enable( !enableNC );
545 
546  m_trackWidth.Enable( !enableNC );
547 }
548 
549 
550 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
551 {
552  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
553 }
554 
555 
556 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
557 {
558  m_DesignRuleWidthsCtrl->SetSelection( wxNOT_FOUND );
559 }
560 
561 
563 {
564  bool enableNC = aEvent.IsChecked();
565 
566  m_DesignRuleVias->Enable( !enableNC );
567  m_DesignRuleViasCtrl->Enable( !enableNC );
568  m_DesignRuleViasUnit->Enable( !enableNC );
569 
570  m_viaDiameter.Enable( !enableNC );
571  m_viaDrill.Enable( !enableNC );
572 }
573 
574 
575 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
576 {
577  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
578 
579  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
580  m_viaDrill.ChangeValue( viaDimension->m_Drill );
581 }
582 
583 
584 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
585 {
586  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
587 
588  if( m_vias )
589  {
590  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
591  {
592  m_ViaStartLayer->Enable();
593  m_ViaEndLayer->Enable();
594  }
595  else
596  {
599 
600  m_ViaStartLayer->Enable( false );
601  m_ViaEndLayer->Enable( false );
602  }
603  }
604 }
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:141
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:462
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:434
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:122
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.
virtual bool Validate(int aMin, int aMax, bool setFocusOnError=true)
Function Validate Validates the control against the given range, informing the user of any errors fou...
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:699
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:123
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:119
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:146
PCB_LAYER_ID
A quick note on layer IDs:
VIATYPE_T GetViaType() const
Definition: class_track.h:461
std::shared_ptr< NETCLASS > GetNetClass() const
Function GetNetClass returns the NETCLASS for this item.
#define INDETERMINATE
const wxPoint & GetStart() const
Definition: class_track.h:126
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:756
const wxPoint GetPosition() const override
Definition: class_track.h:433
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:462
int GetWidth() const
Definition: class_track.h:120
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:469
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:125
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.
#define GEOMETRY_MIN_SIZE
Definition: class_track.h:64
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:297
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...