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 <board_commit.h>
34 #include <macros.h>
35 
37  const PCBNEW_SELECTION& aItems,
38  COMMIT& aCommit ) :
40  m_frame( aParent ),
41  m_items( aItems ),
42  m_commit( aCommit ),
43  m_trackStartX( aParent, m_TrackStartXLabel, m_TrackStartXCtrl, m_TrackStartXUnit ),
44  m_trackStartY( aParent, m_TrackStartYLabel, m_TrackStartYCtrl, m_TrackStartYUnit ),
45  m_trackEndX( aParent, m_TrackEndXLabel, m_TrackEndXCtrl, m_TrackEndXUnit ),
46  m_trackEndY( aParent, m_TrackEndYLabel, m_TrackEndYCtrl, m_TrackEndYUnit ),
47  m_trackWidth( aParent, m_TrackWidthLabel, m_TrackWidthCtrl, m_TrackWidthUnit, true, false ),
48  m_viaX( aParent, m_ViaXLabel, m_ViaXCtrl, m_ViaXUnit ),
49  m_viaY( aParent, m_ViaYLabel, m_ViaYCtrl, m_ViaYUnit ),
50  m_viaDiameter( aParent, m_ViaDiameterLabel, m_ViaDiameterCtrl, m_ViaDiameterUnit, true, false ),
51  m_viaDrill( aParent, m_ViaDrillLabel, m_ViaDrillCtrl, m_ViaDrillUnit, true, false ),
52  m_tracks( false ),
53  m_vias( false )
54 {
55  wxASSERT( !m_items.Empty() );
56 
57  VIATYPE viaType = VIATYPE::NOT_DEFINED;
58 
61  m_TrackLayerCtrl->SetBoardFrame( aParent );
63 
66  m_ViaStartLayer->SetBoardFrame( aParent );
68 
71  m_ViaEndLayer->SetBoardFrame( aParent );
73 
74  bool nets = false;
75  int net = 0;
76  bool hasLocked = false;
77  bool hasUnlocked = false;
78 
79  // Look for values that are common for every item that is selected
80  for( EDA_ITEM* item : m_items )
81  {
82  if( !nets )
83  {
84  net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode();
85  nets = true;
86  }
87  else if( net != static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode() )
88  {
89  net = -1;
90  }
91 
92  switch( item->Type() )
93  {
94  case PCB_TRACE_T:
95  case PCB_ARC_T:
96  {
97  const TRACK* t = static_cast<const TRACK*>( item );
98 
99  if( !m_tracks ) // first track in the list
100  {
103  m_trackEndX.SetValue( t->GetEnd().x );
104  m_trackEndY.SetValue( t->GetEnd().y );
107  m_tracks = true;
108  }
109  else // check if values are the same for every selected track
110  {
111  if( m_trackStartX.GetValue() != t->GetStart().x )
113 
114  if( m_trackStartY.GetValue() != t->GetStart().y )
116 
117  if( m_trackEndX.GetValue() != t->GetEnd().x )
119 
120  if( m_trackEndY.GetValue() != t->GetEnd().y )
122 
123  if( m_trackWidth.GetValue() != t->GetWidth() )
125 
127  {
131  }
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 = VIATYPE::NOT_DEFINED;
173 
175  {
179  }
180 
182  {
186  }
187  }
188 
189  if( v->IsLocked() )
190  hasLocked = true;
191  else
192  hasUnlocked = true;
193 
194  break;
195  }
196 
197  default:
198  {
199  wxASSERT( false );
200  break;
201  }
202  }
203  }
204 
205  m_netSelector->SetBoard( aParent->GetBoard() );
206  m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
207 
208  if ( net >= 0 )
209  {
211  }
212  else
213  {
216  }
217 
218  wxASSERT( m_tracks || m_vias );
219 
220  if( m_vias )
221  {
223 
224  int viaSelection = wxNOT_FOUND;
225 
226  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
227  {
228  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
229  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false, true )
230  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false, true );
231  m_DesignRuleViasCtrl->Append( msg, viaDimension );
232 
233  if( viaSelection == wxNOT_FOUND
234  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
235  && m_viaDrill.GetValue() == viaDimension->m_Drill )
236  {
237  viaSelection = ii;
238  }
239  }
240 
241  m_DesignRuleViasCtrl->SetSelection( viaSelection );
242 
244 
245  m_ViaTypeChoice->Enable();
246 
247  switch( viaType )
248  {
249  case VIATYPE::THROUGH:
250  m_ViaTypeChoice->SetSelection( 0 );
251  break;
252  case VIATYPE::MICROVIA:
253  m_ViaTypeChoice->SetSelection( 1 );
254  break;
256  m_ViaTypeChoice->SetSelection( 2 );
257  break;
259  m_ViaTypeChoice->SetSelection( wxNOT_FOUND );
260  break;
261  }
262 
263  m_ViaStartLayer->Enable( viaType != VIATYPE::THROUGH );
264  m_ViaEndLayer->Enable( viaType != VIATYPE::THROUGH );
265  }
266  else
267  {
268  m_MainSizer->Hide( m_sbViaSizer, true );
269  }
270 
271  if( m_tracks )
272  {
274 
275  int widthSelection = wxNOT_FOUND;
276 
277  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
278  {
279  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
280  wxString msg = StringFromValue( m_units, width, false, true );
281  m_DesignRuleWidthsCtrl->Append( msg );
282 
283  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
284  widthSelection = ii;
285  }
286 
287  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
288 
290  }
291  else
292  {
293  m_MainSizer->Hide( m_sbTrackSizer, true );
294  }
295 
296  if( hasLocked && hasUnlocked )
297  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
298  else if( hasLocked )
299  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
300  else
301  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
302 
304 
305  m_StdButtonsOK->SetDefault();
306 
307  // Now all widgets have the size fixed, call FinishDialogSettings
309 }
310 
311 
312 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& changingPads )
313 {
314  wxString msg;
315 
316  if( changingPads.size() == 1 )
317  {
318  D_PAD* pad = *changingPads.begin();
319  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
320  "Do you wish to continue?" ),
321  pad->GetParent()->GetReference(),
322  pad->GetName(),
323  m_netSelector->GetValue() );
324  }
325  else if( changingPads.size() == 2 )
326  {
327  D_PAD* pad1 = *changingPads.begin();
328  D_PAD* pad2 = *( ++changingPads.begin() );
329  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
330  "Do you wish to continue?" ),
331  pad1->GetParent()->GetReference(),
332  pad1->GetName(),
333  pad2->GetParent()->GetReference(),
334  pad2->GetName(),
335  m_netSelector->GetValue() );
336  }
337  else
338  {
339  msg.Printf( _( "This will change the net assigned to %lu connected pads to %s.\n"
340  "Do you wish to continue?" ),
341  static_cast<unsigned long>( changingPads.size() ),
342  m_netSelector->GetValue() );
343  }
344 
345  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
346  dlg.SetOKLabel( _( "Continue" ) );
347  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
348 
349  return dlg.ShowModal() == wxID_OK;
350 }
351 
352 
354 {
355  auto connectivity = m_frame->GetBoard()->GetConnectivity();
356  int newNetCode = m_netSelector->GetSelectedNetcode();
357  std::vector<D_PAD*> changingPads;
358 
359  if ( !m_netSelector->IsIndeterminate() )
360  {
361  std::set<D_PAD*> connectedPads;
362 
363  for( auto& item : m_items )
364  {
365  const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_MODULE_T, EOT };
366  auto connectedItems = connectivity->GetConnectedItems( static_cast<BOARD_CONNECTED_ITEM*>( item ), ourTypes, true );
367  for ( auto citem : connectedItems )
368  {
369  if( citem->Type() == PCB_PAD_T )
370  {
371  connectedPads.insert( static_cast<D_PAD*>( citem ) );
372  }
373  }
374  }
375 
376  for( D_PAD* pad : connectedPads )
377  {
378  if( pad->GetNetCode() != newNetCode )
379  changingPads.push_back( pad );
380  }
381  }
382 
383  // Run validations:
384 
385  if( changingPads.size() )
386  {
387  if( !confirmPadChange( changingPads ) )
388  return false;
389  }
390 
391  if( m_vias )
392  {
393  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
394  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
395  return false;
396 
397  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
398  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
400  {
401  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
402  m_ViaDrillCtrl->SelectAll();
403  m_ViaDrillCtrl->SetFocus();
404  return false;
405  }
406 
409  {
410  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
411  return false;
412  }
413  }
414 
415  if( m_tracks )
416  {
417  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
418  return false;
419  }
420 
421  // If we survived that, then save the changes:
422 
423  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
424  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
425 
426  for( auto item : m_items )
427  {
428  m_commit.Modify( item );
429 
430  switch( item->Type() )
431  {
432  case PCB_TRACE_T:
433  case PCB_ARC_T:
434  {
435  wxASSERT( m_tracks );
436  TRACK* t = static_cast<TRACK*>( item );
437 
439  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
440 
442  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
443 
445  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
446 
448  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
449 
450  if( m_trackNetclass->IsChecked() )
451  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
452  else if( !m_trackWidth.IsIndeterminate() )
454 
456 
457  if( layer != UNDEFINED_LAYER )
458  t->SetLayer( (PCB_LAYER_ID) layer );
459 
460  if( changeLock )
461  t->SetLocked( setLock );
462 
463  if ( !m_netSelector->IsIndeterminate() )
465 
466  break;
467  }
468 
469  case PCB_VIA_T:
470  {
471  wxASSERT( m_vias );
472  VIA* v = static_cast<VIA*>( item );
473 
474  if( !m_viaX.IsIndeterminate() )
475  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
476 
477  if( !m_viaY.IsIndeterminate() )
478  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
479 
480  switch( m_ViaTypeChoice->GetSelection() )
481  {
482  case 0:
484  v->SanitizeLayers();
485  break;
486  case 1:
488  break;
489  case 2:
491  break;
492  default:
493  break;
494  }
495 
496  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
497  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
498 
499  if (startLayer != UNDEFINED_LAYER )
500  v->SetTopLayer( startLayer );
501 
502  if (endLayer != UNDEFINED_LAYER )
503  v->SetBottomLayer( endLayer );
504 
505  v->SanitizeLayers();
506 
507  if( m_viaNetclass->IsChecked() )
508  {
509  switch( v->GetViaType() )
510  {
511  default:
512  wxFAIL_MSG("Unhandled via type");
514 
515  case VIATYPE::THROUGH:
517  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
518  v->SetDrill( v->GetNetClass()->GetViaDrill() );
519  break;
520 
521  case VIATYPE::MICROVIA:
522  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
523  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
524  break;
525  }
526  }
527  else
528  {
531 
532  if( !m_viaDrill.IsIndeterminate() )
533  v->SetDrill( m_viaDrill.GetValue() );
534  }
535 
536  if ( !m_netSelector->IsIndeterminate() )
538 
539  if( changeLock )
540  v->SetLocked( setLock );
541 
542  break;
543  }
544 
545  default:
546  wxASSERT( false );
547  break;
548  }
549  }
550 
551  if ( !m_netSelector->IsIndeterminate() )
552  {
553  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
554  // outwards. We therefore have to update the connected pads in order for the net
555  // change to "stick".
556  for( D_PAD* pad : changingPads )
557  {
558  m_commit.Modify( pad );
559  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
560  }
561  }
562 
563  m_commit.Push( _( "Edit track/via properties" ) );
564 
565  return true;
566 }
567 
568 
570 {
571  bool enableNC = aEvent.IsChecked();
572 
573  m_DesignRuleWidths->Enable( !enableNC );
574  m_DesignRuleWidthsCtrl->Enable( !enableNC );
575  m_DesignRuleWidthsUnits->Enable( !enableNC );
576 
577  m_trackWidth.Enable( !enableNC );
578 }
579 
580 
581 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
582 {
583  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
584  m_TrackWidthCtrl->SelectAll();
585 }
586 
587 
588 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
589 {
590  m_DesignRuleWidthsCtrl->SetStringSelection( m_TrackWidthCtrl->GetValue() );
591 }
592 
593 
595 {
596  bool enableNC = aEvent.IsChecked();
597 
598  m_DesignRuleVias->Enable( !enableNC );
599  m_DesignRuleViasCtrl->Enable( !enableNC );
600  m_DesignRuleViasUnit->Enable( !enableNC );
601 
602  m_viaDiameter.Enable( !enableNC );
603  m_viaDrill.Enable( !enableNC );
604 }
605 
606 
607 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
608 {
609  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
610 
611  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
612  m_viaDrill.ChangeValue( viaDimension->m_Drill );
613 }
614 
615 
616 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
617 {
618  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
619 
620  if( m_vias )
621  {
622  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
623  {
624  m_ViaStartLayer->Enable();
625  m_ViaEndLayer->Enable();
626  }
627  else
628  {
631 
632  m_ViaStartLayer->Enable( false );
633  m_ViaEndLayer->Enable( false );
634  }
635  }
636 }
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:133
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
void SetIndeterminateString(const wxString &aString)
Struct VIA_DIMENSION is a small helper container to handle a stock of specific vias each with unique ...
DIALOG_TRACK_VIA_PROPERTIES(PCB_BASE_FRAME *aParent, const PCBNEW_SELECTION &aItems, COMMIT &aCommit)
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:53
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project Overloaded in FOOTPRINT_EDIT_FRAME.
#define KI_FALLTHROUGH
void onTrackNetclassCheck(wxCommandEvent &aEvent) override
#define INDETERMINATE_STATE
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:407
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:114
void onWidthSelect(wxCommandEvent &aEvent) override
std::vector< int > m_TrackWidthList
void SetNotAllowedLayerSet(LSET aMask)
const wxPoint & GetStart() const
Definition: class_track.h:118
void SetBoard(BOARD *aBoard)
NETCLASS * GetNetClass() const
Function GetNetClassPtr returns the NETCLASS for this item.
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:735
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void onViaEdit(wxCommandEvent &aEvent) override
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
COMMIT.
Definition: commit.h:71
int GetSelectedNetcode()
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)
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:114
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
A single base class (TRACK) represents both tracks and vias, with subclasses for curved tracks (ARC) ...
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
This file contains miscellaneous commonly used macros and functions.
void SetWidth(int aWidth)
Definition: class_track.h:111
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:433
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:138
PCB_LAYER_ID
A quick note on layer IDs:
int GetTrackWidth() const
Definition: netclass.h:172
void onWidthEdit(wxCommandEvent &aEvent) override
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
VIATYPE
Definition: class_track.h:68
void SetSelectedNetcode(int aNetcode)
int GetViaDrill() const
Definition: netclass.h:178
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:355
void onViaSelect(wxCommandEvent &aEvent) override
bool IsIndeterminate()
const wxString & GetName() const
Definition: class_pad.h:128
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Sets net using a net code.
int SetLayerSelection(LAYER_NUM layer)
bool confirmPadChange(const std::vector< D_PAD * > &connectedPads)
int GetuViaDiameter() const
Definition: netclass.h:181
void SetNetInfo(NETINFO_LIST *aNetInfoList)
bool SetLayersHotkeys(bool value)
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:739
const wxPoint GetPosition() const override
Definition: class_track.h:406
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:121
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
void SetUndefinedLayerName(const wxString &aName)
MODULE * GetParent() const
Definition: class_pad.h:107
EDA_UNITS m_units
Definition: dialog_shim.h:197
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED, bool aUseMils=false)
Function Validate Validates the control against the given range, informing the user of any errors fou...
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:112
#define _(s)
Definition: 3d_actions.cpp:33
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...
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: class_track.h:442
VIATYPE GetViaType() const
Definition: class_track.h:368
int GetViaDiameter() const
Definition: netclass.h:175
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
PCB_LAYER_ID TopLayer() const
const wxPoint & GetEnd() const
Definition: class_track.h:115
std::vector< VIA_DIMENSION > m_ViasDimensionsList
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
void SetBottomLayer(PCB_LAYER_ID aLayer)
int ShowModal() override
Definition: confirm.cpp:95
void SetStart(const wxPoint &aStart)
Definition: class_track.h:117
int GetuViaDrill() const
Definition: netclass.h:184
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
BOARD * GetBoard() const
Class DIALOG_TRACK_VIA_PROPERTIES_BASE.
#define GEOMETRY_MIN_SIZE
Definition: class_track.h:82
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
void SetViaType(VIATYPE aViaType)
Definition: class_track.h:369
PCB_LAYER_ID BottomLayer() const
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233
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.
virtual void ChangeValue(int aValue)
Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units c...