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 
26 #include <core/kicad_algo.h>
28 #include <pcb_layer_box_selector.h>
30 #include <track.h>
31 #include <pcb_edit_frame.h>
32 #include <confirm.h>
34 #include <board_commit.h>
35 #include <macros.h>
36 
38  const PCB_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 ),
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 ),
52  m_viaDrill( aParent, m_ViaDrillLabel, m_ViaDrillCtrl, m_ViaDrillUnit ),
53  m_tracks( false ),
54  m_vias( false )
55 {
56  m_useCalculatedSize = true;
57 
58  wxASSERT( !m_items.Empty() );
59 
60  // Configure display origin transforms
67 
68  VIATYPE viaType = VIATYPE::NOT_DEFINED;
69 
72  m_TrackLayerCtrl->SetBoardFrame( aParent );
74 
77  m_ViaStartLayer->SetBoardFrame( aParent );
79 
82  m_ViaEndLayer->SetBoardFrame( aParent );
84 
85  bool nets = false;
86  int net = 0;
87  bool hasLocked = false;
88  bool hasUnlocked = false;
89 
90  // Look for values that are common for every item that is selected
91  for( EDA_ITEM* item : m_items )
92  {
93  if( !nets )
94  {
95  net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode();
96  nets = true;
97  }
98  else if( net != static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode() )
99  {
100  net = -1;
101  }
102 
103  switch( item->Type() )
104  {
105  case PCB_TRACE_T:
106  case PCB_ARC_T:
107  {
108  const TRACK* t = static_cast<const TRACK*>( item );
109 
110  if( !m_tracks ) // first track in the list
111  {
112  m_trackStartX.SetValue( t->GetStart().x );
113  m_trackStartY.SetValue( t->GetStart().y );
114  m_trackEndX.SetValue( t->GetEnd().x );
115  m_trackEndY.SetValue( t->GetEnd().y );
118  m_tracks = true;
119  }
120  else // check if values are the same for every selected track
121  {
122  if( m_trackStartX.GetValue() != t->GetStart().x )
124 
125  if( m_trackStartY.GetValue() != t->GetStart().y )
127 
128  if( m_trackEndX.GetValue() != t->GetEnd().x )
130 
131  if( m_trackEndY.GetValue() != t->GetEnd().y )
133 
134  if( m_trackWidth.GetValue() != t->GetWidth() )
136 
138  {
142  }
143  }
144 
145  if( t->IsLocked() )
146  hasLocked = true;
147  else
148  hasUnlocked = true;
149 
150  break;
151  }
152 
153  case PCB_VIA_T:
154  {
155  const VIA* v = static_cast<const VIA*>( item );
156 
157  if( !m_vias ) // first via in the list
158  {
159  m_viaX.SetValue( v->GetPosition().x );
160  m_viaY.SetValue( v->GetPosition().y );
163  m_vias = true;
164  viaType = v->GetViaType();
167  m_viaNotFree->SetValue( !v->GetIsFree() );
168  }
169  else // check if values are the same for every selected via
170  {
171  if( m_viaX.GetValue() != v->GetPosition().x )
173 
174  if( m_viaY.GetValue() != v->GetPosition().y )
176 
177  if( m_viaDiameter.GetValue() != v->GetWidth() )
179 
180  if( m_viaDrill.GetValue() != v->GetDrillValue() )
182 
183  if( viaType != v->GetViaType() )
184  viaType = VIATYPE::NOT_DEFINED;
185 
186  if( v->GetIsFree() != !m_viaNotFree->GetValue() )
187  m_viaNotFree->Set3StateValue( wxCHK_UNDETERMINED );
188 
190  {
194  }
195 
197  {
201  }
202  }
203 
204  if( v->IsLocked() )
205  hasLocked = true;
206  else
207  hasUnlocked = true;
208 
209  break;
210  }
211 
212  default:
213  {
214  wxASSERT( false );
215  break;
216  }
217  }
218  }
219 
220  m_netSelector->SetBoard( aParent->GetBoard() );
221  m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
222 
223  if ( net >= 0 )
224  {
226  }
227  else
228  {
231  }
232 
233  wxASSERT( m_tracks || m_vias );
234 
235  if( m_vias )
236  {
237  if( m_viaNotFree->GetValue() )
238  {
239  m_netSelectorLabel->Disable();
240  m_netSelector->Disable();
241  }
242 
244 
245  int viaSelection = wxNOT_FOUND;
246 
247  // 0 is the netclass place-holder
248  for( unsigned ii = 1; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
249  {
250  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
251  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false )
252  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false );
253  m_DesignRuleViasCtrl->Append( msg, viaDimension );
254 
255  if( viaSelection == wxNOT_FOUND
256  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
257  && m_viaDrill.GetValue() == viaDimension->m_Drill )
258  {
259  viaSelection = ii;
260  }
261  }
262 
263  m_DesignRuleViasCtrl->SetSelection( viaSelection );
264 
266 
267  m_ViaTypeChoice->Enable();
268 
269  switch( viaType )
270  {
271  case VIATYPE::THROUGH:
272  m_ViaTypeChoice->SetSelection( 0 );
273  break;
274  case VIATYPE::MICROVIA:
275  m_ViaTypeChoice->SetSelection( 1 );
276  break;
278  m_ViaTypeChoice->SetSelection( 2 );
279  break;
281  m_ViaTypeChoice->SetSelection( wxNOT_FOUND );
282  break;
283  }
284 
285  m_ViaStartLayer->Enable( viaType != VIATYPE::THROUGH );
286  m_ViaEndLayer->Enable( viaType != VIATYPE::THROUGH );
287  }
288  else
289  {
290  m_viaNotFree->Hide();
291  m_MainSizer->Hide( m_sbViaSizer, true );
292  }
293 
294  if( m_tracks )
295  {
297 
298  int widthSelection = wxNOT_FOUND;
299 
300  // 0 is the netclass place-holder
301  for( unsigned ii = 1; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
302  {
303  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
304  wxString msg = StringFromValue( m_units, width, false );
305  m_DesignRuleWidthsCtrl->Append( msg );
306 
307  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
308  widthSelection = ii;
309  }
310 
311  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
312 
314  }
315  else
316  {
317  m_MainSizer->Hide( m_sbTrackSizer, true );
318  }
319 
320  if( hasLocked && hasUnlocked )
321  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
322  else if( hasLocked )
323  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
324  else
325  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
326 
328 
329  m_StdButtonsOK->SetDefault();
330 
331  // Now all widgets have the size fixed, call FinishDialogSettings
333 }
334 
335 
336 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<PAD*>& changingPads )
337 {
338  wxString msg;
339 
340  if( changingPads.size() == 1 )
341  {
342  PAD* pad = *changingPads.begin();
343  msg.Printf( _( "Changing the net will also update %s pad %s to %s." ),
344  pad->GetParent()->GetReference(),
345  pad->GetName(),
346  m_netSelector->GetValue() );
347  }
348  else if( changingPads.size() == 2 )
349  {
350  PAD* pad1 = *changingPads.begin();
351  PAD* pad2 = *( ++changingPads.begin() );
352  msg.Printf( _( "Changing the net will also update %s pad %s and %s pad %s to %s." ),
353  pad1->GetParent()->GetReference(),
354  pad1->GetName(),
355  pad2->GetParent()->GetReference(),
356  pad2->GetName(),
357  m_netSelector->GetValue() );
358  }
359  else
360  {
361  msg.Printf( _( "Changing the net will also update %lu connected pads to %s." ),
362  static_cast<unsigned long>( changingPads.size() ),
363  m_netSelector->GetValue() );
364  }
365 
366  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
367  dlg.SetOKCancelLabels( _( "Change Nets" ), _( "Leave Nets Unchanged" ) );
368  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
369 
370  return dlg.ShowModal() == wxID_OK;
371 }
372 
373 
375 {
376  // Run validations:
377 
378  if( m_vias )
379  {
380  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
381  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
382  return false;
383 
384  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
385  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
387  {
388  DisplayError( GetParent(), _( "Via hole size must be smaller than via diameter" ) );
389  m_ViaDrillCtrl->SelectAll();
390  m_ViaDrillCtrl->SetFocus();
391  return false;
392  }
393 
396  {
397  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
398  return false;
399  }
400  }
401 
402  if( m_tracks )
403  {
404  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
405  return false;
406  }
407 
408  // If we survived that, then save the changes:
409  //
410  // We don't bother with updating the nets at this point as it will be useless (any connected
411  // pads will simply drive their existing nets back onto the track segments and vias).
412 
413  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
414  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
415 
416  for( EDA_ITEM* item : m_items )
417  {
418  m_commit.Modify( item );
419 
420  switch( item->Type() )
421  {
422  case PCB_TRACE_T:
423  case PCB_ARC_T:
424  {
425  wxASSERT( m_tracks );
426  TRACK* t = static_cast<TRACK*>( item );
427 
429  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
430 
432  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
433 
435  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
436 
438  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
439 
440  if( m_trackNetclass->IsChecked() )
441  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
442  else if( !m_trackWidth.IsIndeterminate() )
444 
446 
447  if( layer != UNDEFINED_LAYER )
448  t->SetLayer( (PCB_LAYER_ID) layer );
449 
450  if( changeLock )
451  t->SetLocked( setLock );
452 
453  break;
454  }
455 
456  case PCB_VIA_T:
457  {
458  wxASSERT( m_vias );
459  VIA* v = static_cast<VIA*>( item );
460 
461  if( !m_viaX.IsIndeterminate() )
462  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
463 
464  if( !m_viaY.IsIndeterminate() )
465  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
466 
467  if( m_viaNotFree->Get3StateValue() != wxCHK_UNDETERMINED )
468  v->SetIsFree( !m_viaNotFree->GetValue() );
469 
470  switch( m_ViaTypeChoice->GetSelection() )
471  {
472  case 0:
474  v->SanitizeLayers();
475  break;
476  case 1:
478  break;
479  case 2:
481  break;
482  default:
483  break;
484  }
485 
486  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
487  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
488 
489  if (startLayer != UNDEFINED_LAYER )
490  v->SetTopLayer( startLayer );
491 
492  if (endLayer != UNDEFINED_LAYER )
493  v->SetBottomLayer( endLayer );
494 
495  v->SanitizeLayers();
496 
497  if( m_viaNetclass->IsChecked() )
498  {
499  switch( v->GetViaType() )
500  {
501  default:
502  wxFAIL_MSG( "Unhandled via type" );
504 
505  case VIATYPE::THROUGH:
507  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
508  v->SetDrill( v->GetNetClass()->GetViaDrill() );
509  break;
510 
511  case VIATYPE::MICROVIA:
512  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
513  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
514  break;
515  }
516  }
517  else
518  {
521 
522  if( !m_viaDrill.IsIndeterminate() )
523  v->SetDrill( m_viaDrill.GetValue() );
524  }
525 
526  if( changeLock )
527  v->SetLocked( setLock );
528 
529  break;
530  }
531 
532  default:
533  wxASSERT( false );
534  break;
535  }
536  }
537 
538  m_commit.Push( _( "Edit track/via properties" ) );
539 
540  // Pushing the commit will have updated the connectivity so we can now test to see if we
541  // need to update any pad nets.
542 
543  auto connectivity = m_frame->GetBoard()->GetConnectivity();
544  int newNetCode = m_netSelector->GetSelectedNetcode();
545  bool updateNets = false;
546  std::vector<PAD*> changingPads;
547 
548  if ( !m_netSelector->IsIndeterminate() )
549  {
550  updateNets = true;
551 
552  for( EDA_ITEM* item : m_items )
553  {
554  const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_FOOTPRINT_T, EOT };
555  BOARD_CONNECTED_ITEM* boardItem = static_cast<BOARD_CONNECTED_ITEM*>( item );
556  auto connectedItems = connectivity->GetConnectedItems( boardItem, ourTypes, true );
557 
558  for ( BOARD_CONNECTED_ITEM* citem : connectedItems )
559  {
560  if( citem->Type() == PCB_PAD_T )
561  {
562  PAD* pad = static_cast<PAD*>( citem );
563 
564  if( pad->GetNetCode() != newNetCode && !alg::contains( changingPads, citem ) )
565  changingPads.push_back( pad );
566  }
567  }
568  }
569  }
570 
571  if( changingPads.size() && !confirmPadChange( changingPads ) )
572  updateNets = false;
573 
574  if( updateNets )
575  {
576  for( EDA_ITEM* item : m_items )
577  {
578  m_commit.Modify( item );
579 
580  switch( item->Type() )
581  {
582  case PCB_TRACE_T:
583  case PCB_ARC_T:
584  static_cast<TRACK*>( item )->SetNetCode( newNetCode );
585  break;
586 
587  case PCB_VIA_T:
588  static_cast<VIA*>( item )->SetNetCode( newNetCode );
589  break;
590 
591  default:
592  wxASSERT( false );
593  break;
594  }
595  }
596 
597  for( PAD* pad : changingPads )
598  {
599  m_commit.Modify( pad );
600  pad->SetNetCode( newNetCode );
601  }
602 
603  m_commit.Push( _( "Updating nets" ) );
604  }
605 
606  return true;
607 }
608 
609 
611 {
612  m_netSelectorLabel->Enable( !m_viaNotFree->GetValue() );
613  m_netSelector->Enable( !m_viaNotFree->GetValue() );
614 }
615 
616 
618 {
619  bool enableNC = aEvent.IsChecked();
620 
621  m_DesignRuleWidths->Enable( !enableNC );
622  m_DesignRuleWidthsCtrl->Enable( !enableNC );
623  m_DesignRuleWidthsUnits->Enable( !enableNC );
624 
625  m_trackWidth.Enable( !enableNC );
626 }
627 
628 
629 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
630 {
631  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
632  m_TrackWidthCtrl->SelectAll();
633 }
634 
635 
636 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
637 {
638  m_DesignRuleWidthsCtrl->SetStringSelection( m_TrackWidthCtrl->GetValue() );
639 }
640 
641 
643 {
644  bool enableNC = aEvent.IsChecked();
645 
646  m_DesignRuleVias->Enable( !enableNC );
647  m_DesignRuleViasCtrl->Enable( !enableNC );
648  m_DesignRuleViasUnit->Enable( !enableNC );
649 
650  m_viaDiameter.Enable( !enableNC );
651  m_viaDrill.Enable( !enableNC );
652 }
653 
654 
655 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
656 {
657  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
658 
659  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
660  m_viaDrill.ChangeValue( viaDimension->m_Drill );
661 }
662 
663 
664 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
665 {
666  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
667 
668  if( m_vias )
669  {
670  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
671  {
672  m_ViaStartLayer->Enable();
673  m_ViaEndLayer->Enable();
674  }
675  else
676  {
679 
680  m_ViaStartLayer->Enable( false );
681  m_ViaEndLayer->Enable( false );
682  }
683  }
684 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:252
void SetIndeterminateString(const wxString &aString)
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
Definition: track.h:343
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
Definition: commit.h:103
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
Definition: confirm.cpp:55
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
void onTrackNetclassCheck(wxCommandEvent &aEvent) override
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Definition: confirm.h:45
void SetPosition(const wxPoint &aPoint) override
Definition: track.h:412
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:194
This file is part of the common library.
void SetEnd(const wxPoint &aEnd)
Definition: track.h:112
void onWidthSelect(wxCommandEvent &aEvent) override
std::vector< int > m_TrackWidthList
void SetNotAllowedLayerSet(LSET aMask)
const wxPoint & GetStart() const
Definition: track.h:116
void SetBoard(BOARD *aBoard)
virtual NETCLASS * GetNetClass() const
Return the NETCLASS for this item.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
Definition: lset.cpp:773
void onViaEdit(wxCommandEvent &aEvent) override
bool GetIsFree() const
Checks if the via is a free via (as opposed to one created on a track by the router).
Definition: track.h:502
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
Represent a set of changes (additions, deletions or modifications) of a data model (e....
Definition: commit.h:71
int GetSelectedNetcode()
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:754
class PAD, a pad in a footprint
Definition: typeinfo.h:89
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:410
virtual void SetLocked(bool aLocked)
Modify the 'lock' status for of the item.
Definition: board_item.h:257
bool IsIndeterminate() const
Return true if the control holds the indeterminate value (for instance, if it represents a multiple s...
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
bool confirmPadChange(const std::vector< PAD * > &connectedPads)
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:98
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
This file contains miscellaneous commonly used macros and functions.
void SetWidth(int aWidth)
Definition: track.h:109
LAYER_NUM GetLayerSelection() const
PCB_LAYER_ID
A quick note on layer IDs:
int GetTrackWidth() const
Definition: netclass.h:128
void onWidthEdit(wxCommandEvent &aEvent) override
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: track.cpp:173
void SetSelectedNetcode(int aNetcode)
int GetViaDrill() const
Definition: netclass.h:136
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:416
void onViaSelect(wxCommandEvent &aEvent) override
const wxString & GetName() const
Definition: pad.h:133
#define GEOMETRY_MIN_SIZE
Definition: track.h:80
bool IsIndeterminate()
const wxString & GetReference() const
Definition: footprint.h:426
int SetLayerSelection(LAYER_NUM layer)
int GetuViaDiameter() const
Definition: netclass.h:140
void SetNetInfo(NETINFO_LIST *aNetInfoList)
bool SetLayersHotkeys(bool value)
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:81
DIALOG_TRACK_VIA_PROPERTIES(PCB_BASE_FRAME *aParent, const PCB_SELECTION &aItems, COMMIT &aCommit)
void onViaNotFreeClicked(wxCommandEvent &event) override
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:122
int LAYER_NUM
This can be replaced with int and removed.
void SetUndefinedLayerName(const wxString &aName)
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
FOOTPRINT * GetParent() const
Definition: pad.cpp:1334
EDA_UNITS m_units
Definition: dialog_shim.h:199
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void SetIndeterminate()
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true)=0
Revert the commit by restoring the modified items state.
virtual bool IsLocked() const
Definition: board_item.h:249
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
bool SetOKCancelLabels(const ButtonLabel &ok, const ButtonLabel &cancel) override
Shows the 'do not show again' checkbox.
Definition: confirm.h:56
int GetWidth() const
Definition: track.h:110
#define _(s)
Definition: 3d_actions.cpp:33
void onViaNetclassCheck(wxCommandEvent &aEvent) override
void SetTopLayer(PCB_LAYER_ID aLayer)
Definition: track.cpp:423
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: track.h:474
void SetIsFree(bool aFree=true)
Definition: track.h:503
VIATYPE GetViaType() const
Definition: track.h:373
int GetViaDiameter() const
Definition: netclass.h:132
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
PCB_LAYER_ID TopLayer() const
Definition: track.cpp:457
const wxPoint & GetEnd() const
Definition: track.h:113
std::vector< VIA_DIMENSION > m_ViasDimensionsList
virtual long long int GetValue()
Return the current value in Internal Units.
void SetBottomLayer(PCB_LAYER_ID aLayer)
Definition: track.cpp:429
int ShowModal() override
Definition: confirm.cpp:99
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:190
void SetStart(const wxPoint &aStart)
Definition: track.h:115
int GetuViaDrill() const
Definition: netclass.h:144
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
Definition: unit_binder.h:173
BOARD * GetBoard() const
Class DIALOG_TRACK_VIA_PROPERTIES_BASE.
VIATYPE
Definition: track.h:68
Definition: pad.h:60
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
Definition: track.cpp:469
wxPoint GetPosition() const override
Definition: track.h:411
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
Definition: base_units.h:48
void SetViaType(VIATYPE aViaType)
Definition: track.h:374
PCB_LAYER_ID BottomLayer() const
Definition: track.cpp:463
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
bool m_useCalculatedSize
Definition: dialog_shim.h:204
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
Definition: track.h:83
virtual void ChangeValue(int aValue)
Change the value (in Internal Units) for the text field, taking care of units conversion but does not...