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  const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_MODULE_T, EOT };
348  auto connectedItems = connectivity->GetConnectedItems( static_cast<BOARD_CONNECTED_ITEM*>( item ), ourTypes, true );
349  for ( auto citem : connectedItems )
350  {
351  if( citem->Type() == PCB_PAD_T )
352  {
353  connectedPads.insert( static_cast<D_PAD*>( citem ) );
354  }
355  }
356  }
357 
358  for( D_PAD* pad : connectedPads )
359  {
360  if( pad->GetNetCode() != newNetCode )
361  changingPads.push_back( pad );
362  }
363  }
364 
365  // Run validations:
366 
367  if( changingPads.size() )
368  {
369  if( !confirmPadChange( changingPads ) )
370  return false;
371  }
372 
373  if( m_vias )
374  {
375  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
376  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
377  return false;
378 
379  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
380  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
382  {
383  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
384  m_ViaDrillCtrl->SelectAll();
385  m_ViaDrillCtrl->SetFocus();
386  return false;
387  }
388 
391  {
392  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
393  return false;
394  }
395  }
396 
397  if( m_tracks )
398  {
399  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
400  return false;
401  }
402 
403  // If we survived that, then save the changes:
404 
405  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
406  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
407 
408  for( auto item : m_items )
409  {
410  m_commit.Modify( item );
411 
412  switch( item->Type() )
413  {
414  case PCB_TRACE_T:
415  {
416  wxASSERT( m_tracks );
417  TRACK* t = static_cast<TRACK*>( item );
418 
420  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
421 
423  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
424 
426  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
427 
429  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
430 
431  if( m_trackNetclass->IsChecked() )
432  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
433  else if( !m_trackWidth.IsIndeterminate() )
435 
437 
438  if( layer != UNDEFINED_LAYER )
439  t->SetLayer( (PCB_LAYER_ID) layer );
440 
441  if( changeLock )
442  t->SetLocked( setLock );
443 
444  if ( !m_netSelector->IsIndeterminate() )
446 
447  break;
448  }
449 
450  case PCB_VIA_T:
451  {
452  wxASSERT( m_vias );
453  VIA* v = static_cast<VIA*>( item );
454 
455  if( !m_viaX.IsIndeterminate() )
456  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
457 
458  if( !m_viaY.IsIndeterminate() )
459  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
460 
461  if( m_ViaTypeChoice->GetSelection() != 3)
462  {
463  switch( m_ViaTypeChoice->GetSelection() )
464  {
465  default:
466  case 0: v->SetViaType( VIA_THROUGH ); v->SanitizeLayers(); break;
467  case 1: v->SetViaType( VIA_MICROVIA ); break;
468  case 2: v->SetViaType( VIA_BLIND_BURIED ); break;
469  }
470  }
471 
472  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
473  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
474 
475  if (startLayer != UNDEFINED_LAYER )
476  v->SetTopLayer( startLayer );
477 
478  if (endLayer != UNDEFINED_LAYER )
479  v->SetBottomLayer( endLayer );
480 
481  v->SanitizeLayers();
482 
483  if( m_viaNetclass->IsChecked() )
484  {
485  switch( v->GetViaType() )
486  {
487  default:
488  wxFAIL_MSG("Unhandled via type");
489  // fall through
490 
491  case VIA_THROUGH:
492  case VIA_BLIND_BURIED:
493  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
494  v->SetDrill( v->GetNetClass()->GetViaDrill() );
495  break;
496 
497  case VIA_MICROVIA:
498  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
499  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
500  break;
501  }
502  }
503  else
504  {
507 
508  if( !m_viaDrill.IsIndeterminate() )
509  v->SetDrill( m_viaDrill.GetValue() );
510  }
511 
512  if ( !m_netSelector->IsIndeterminate() )
514 
515  if( changeLock )
516  v->SetLocked( setLock );
517 
518  break;
519  }
520 
521  default:
522  wxASSERT( false );
523  break;
524  }
525  }
526 
527  if ( !m_netSelector->IsIndeterminate() )
528  {
529  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
530  // outwards. We therefore have to update the connected pads in order for the net
531  // change to "stick".
532  for( D_PAD* pad : changingPads )
533  {
534  m_commit.Modify( pad );
535  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
536  }
537  }
538 
539  m_commit.Push( _( "Edit track/via properties" ) );
540 
541  return true;
542 }
543 
544 
546 {
547  bool enableNC = aEvent.IsChecked();
548 
549  m_DesignRuleWidths->Enable( !enableNC );
550  m_DesignRuleWidthsCtrl->Enable( !enableNC );
551  m_DesignRuleWidthsUnits->Enable( !enableNC );
552 
553  m_trackWidth.Enable( !enableNC );
554 }
555 
556 
557 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
558 {
559  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
560 }
561 
562 
563 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
564 {
565  m_DesignRuleWidthsCtrl->SetSelection( wxNOT_FOUND );
566 }
567 
568 
570 {
571  bool enableNC = aEvent.IsChecked();
572 
573  m_DesignRuleVias->Enable( !enableNC );
574  m_DesignRuleViasCtrl->Enable( !enableNC );
575  m_DesignRuleViasUnit->Enable( !enableNC );
576 
577  m_viaDiameter.Enable( !enableNC );
578  m_viaDrill.Enable( !enableNC );
579 }
580 
581 
582 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
583 {
584  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
585 
586  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
587  m_viaDrill.ChangeValue( viaDimension->m_Drill );
588 }
589 
590 
591 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
592 {
593  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
594 
595  if( m_vias )
596  {
597  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
598  {
599  m_ViaStartLayer->Enable();
600  m_ViaEndLayer->Enable();
601  }
602  else
603  {
606 
607  m_ViaStartLayer->Enable( false );
608  m_ViaEndLayer->Enable( false );
609  }
610  }
611 }
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 ...
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
void DoNotShowCheckbox(wxString file, int line)
Shows the 'do not show again' checkbox
Definition: confirm.cpp:61
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
void onTrackNetclassCheck(wxCommandEvent &aEvent) override
void SetViaType(VIATYPE_T aViaType)
Definition: class_track.h:462
Helper class to create more flexible dialogs, including 'do not show again' 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)
const wxPoint & GetStart() const
Definition: class_track.h:126
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
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)
Class COMMIT.
Definition: commit.h:71
int GetSelectedNetcode()
DIALOG_TRACK_VIA_PROPERTIES(PCB_BASE_FRAME *aParent, const SELECTION &aItems, COMMIT &aCommit)
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
bool IsIndeterminate() const
Function IsIndeterminate Returns true if the control holds the indeterminate value (for instance,...
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
VIATYPE_T
Definition: class_track.h:50
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:116
void onWidthEdit(wxCommandEvent &aEvent)
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
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.
LAYER_NUM GetLayerSelection() const
class MODULE, a footprint
Definition: typeinfo.h:89
void SetLocked(bool aLocked) override
Function SetLocked modifies 'lock' status for of the item.
Definition: class_track.h:146
PCB_LAYER_ID
A quick note on layer IDs:
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
#define INDETERMINATE
void SetSelectedNetcode(int aNetcode)
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:297
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:462
bool IsIndeterminate()
VIATYPE_T GetViaType() const
Definition: class_track.h:461
const wxString & GetName() const
Definition: class_pad.h:190
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)
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)
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:116
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
MODULE * GetParent() const
Definition: class_pad.h:162
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 GetWidth() const
Definition: class_track.h:120
void onViaNetclassCheck(wxCommandEvent &aEvent) override
void SetTopLayer(PCB_LAYER_ID aLayer)
std::shared_ptr< NETCLASS > GetNetClass() const
Function GetNetClass returns the NETCLASS for this item.
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: class_track.h:469
PCB_LAYER_ID TopLayer() const
const wxPoint & GetEnd() const
Definition: class_track.h:123
std::vector< VIA_DIMENSION > m_ViasDimensionsList
void SetBottomLayer(PCB_LAYER_ID aLayer)
int ShowModal() override
Definition: confirm.cpp:103
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)
BOARD * GetBoard() const
EDA_UNITS_T m_units
Definition: dialog_shim.h:173
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,...
PCB_LAYER_ID BottomLayer() const
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:243
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...