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 
36  const PCBNEW_SELECTION& aItems,
37  COMMIT& aCommit ) :
39  m_frame( aParent ),
40  m_items( aItems ),
41  m_commit( aCommit ),
42  m_trackStartX( aParent, m_TrackStartXLabel, m_TrackStartXCtrl, m_TrackStartXUnit ),
43  m_trackStartY( aParent, m_TrackStartYLabel, m_TrackStartYCtrl, m_TrackStartYUnit ),
44  m_trackEndX( aParent, m_TrackEndXLabel, m_TrackEndXCtrl, m_TrackEndXUnit ),
45  m_trackEndY( aParent, m_TrackEndYLabel, m_TrackEndYCtrl, m_TrackEndYUnit ),
46  m_trackWidth( aParent, m_TrackWidthLabel, m_TrackWidthCtrl, m_TrackWidthUnit, true, false ),
47  m_viaX( aParent, m_ViaXLabel, m_ViaXCtrl, m_ViaXUnit ),
48  m_viaY( aParent, m_ViaYLabel, m_ViaYCtrl, m_ViaYUnit ),
49  m_viaDiameter( aParent, m_ViaDiameterLabel, m_ViaDiameterCtrl, m_ViaDiameterUnit, true, false ),
50  m_viaDrill( aParent, m_ViaDrillLabel, m_ViaDrillCtrl, m_ViaDrillUnit, true, false ),
51  m_tracks( false ),
52  m_vias( false )
53 {
54  wxASSERT( !m_items.Empty() );
55 
56  VIATYPE viaType = VIATYPE::NOT_DEFINED;
57 
58  m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
59 
62  m_TrackLayerCtrl->SetBoardFrame( aParent );
64 
67  m_ViaStartLayer->SetBoardFrame( aParent );
69 
72  m_ViaEndLayer->SetBoardFrame( aParent );
74 
75  bool nets = false;
76  int net = 0;
77  bool hasLocked = false;
78  bool hasUnlocked = false;
79 
80  // Look for values that are common for every item that is selected
81  for( auto& item : m_items )
82  {
83  if( !nets )
84  {
85  net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode();
86  nets = true;
87  }
88  else if( net != static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode() )
89  {
90  net = -1;
91  }
92 
93  switch( item->Type() )
94  {
95  case PCB_TRACE_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 
128  }
129 
130  if( t->IsLocked() )
131  hasLocked = true;
132  else
133  hasUnlocked = true;
134 
135  break;
136  }
137 
138  case PCB_VIA_T:
139  {
140  const VIA* v = static_cast<const VIA*>( item );
141 
142  if( !m_vias ) // first via in the list
143  {
144  m_viaX.SetValue( v->GetPosition().x );
145  m_viaY.SetValue( v->GetPosition().y );
148  m_vias = true;
149  viaType = v->GetViaType();
152  }
153  else // check if values are the same for every selected via
154  {
155  if( m_viaX.GetValue() != v->GetPosition().x )
157 
158  if( m_viaY.GetValue() != v->GetPosition().y )
160 
161  if( m_viaDiameter.GetValue() != v->GetWidth() )
163 
164  if( m_viaDrill.GetValue() != v->GetDrillValue() )
166 
167  if( viaType != v->GetViaType() )
168  viaType = VIATYPE::NOT_DEFINED;
169 
172 
175  }
176 
177  if( v->IsLocked() )
178  hasLocked = true;
179  else
180  hasUnlocked = true;
181 
182  break;
183  }
184 
185  default:
186  {
187  wxASSERT( false );
188  break;
189  }
190  }
191  }
192 
193  if ( net >= 0 )
195  else
197 
198  wxASSERT( m_tracks || m_vias );
199 
200  if( m_vias )
201  {
203 
204  int viaSelection = wxNOT_FOUND;
205 
206  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
207  {
208  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
209  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false, true )
210  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false, true );
211  m_DesignRuleViasCtrl->Append( msg, viaDimension );
212 
213  if( viaSelection == wxNOT_FOUND
214  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
215  && m_viaDrill.GetValue() == viaDimension->m_Drill )
216  {
217  viaSelection = ii;
218  }
219  }
220 
221  m_DesignRuleViasCtrl->SetSelection( viaSelection );
222 
224 
225  m_ViaTypeChoice->Enable();
226 
227  switch( viaType )
228  {
229  case VIATYPE::THROUGH:
230  m_ViaTypeChoice->SetSelection( 0 );
231  break;
232  case VIATYPE::MICROVIA:
233  m_ViaTypeChoice->SetSelection( 1 );
234  break;
236  m_ViaTypeChoice->SetSelection( 2 );
237  break;
239  m_ViaTypeChoice->SetSelection( 3 );
240  break;
241  }
242 
243  m_ViaStartLayer->Enable( viaType != VIATYPE::THROUGH );
244  m_ViaEndLayer->Enable( viaType != VIATYPE::THROUGH );
245  }
246  else
247  {
248  m_MainSizer->Hide( m_sbViaSizer, true );
249  }
250 
251  if( m_tracks )
252  {
254 
255  int widthSelection = wxNOT_FOUND;
256 
257  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
258  {
259  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
260  wxString msg = StringFromValue( m_units, width, false, true );
261  m_DesignRuleWidthsCtrl->Append( msg );
262 
263  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
264  widthSelection = ii;
265  }
266 
267  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
268 
270  }
271  else
272  {
273  m_MainSizer->Hide( m_sbTrackSizer, true );
274  }
275 
276  if( hasLocked && hasUnlocked )
277  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
278  else if( hasLocked )
279  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
280  else
281  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
282 
284 
285  m_StdButtonsOK->SetDefault();
286 
287  // Now all widgets have the size fixed, call FinishDialogSettings
289 }
290 
291 
292 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& changingPads )
293 {
294  wxString msg;
295 
296  if( changingPads.size() == 1 )
297  {
298  D_PAD* pad = *changingPads.begin();
299  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
300  "Do you wish to continue?" ),
301  pad->GetParent()->GetReference(),
302  pad->GetName(),
303  m_netSelector->GetValue() );
304  }
305  else if( changingPads.size() == 2 )
306  {
307  D_PAD* pad1 = *changingPads.begin();
308  D_PAD* pad2 = *( ++changingPads.begin() );
309  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
310  "Do you wish to continue?" ),
311  pad1->GetParent()->GetReference(),
312  pad1->GetName(),
313  pad2->GetParent()->GetReference(),
314  pad2->GetName(),
315  m_netSelector->GetValue() );
316  }
317  else
318  {
319  msg.Printf( _( "This will change the net assigned to %lu connected pads to %s.\n"
320  "Do you wish to continue?" ),
321  static_cast<unsigned long>( changingPads.size() ),
322  m_netSelector->GetValue() );
323  }
324 
325  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
326  dlg.SetOKLabel( _( "Continue" ) );
327  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
328 
329  return dlg.ShowModal() == wxID_OK;
330 }
331 
332 
334 {
335  auto connectivity = m_frame->GetBoard()->GetConnectivity();
336  int newNetCode = m_netSelector->GetSelectedNetcode();
337  std::vector<D_PAD*> changingPads;
338 
339  if ( !m_netSelector->IsIndeterminate() )
340  {
341  std::set<D_PAD*> connectedPads;
342 
343  for( auto& item : m_items )
344  {
345  const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_MODULE_T, EOT };
346  auto connectedItems = connectivity->GetConnectedItems( static_cast<BOARD_CONNECTED_ITEM*>( item ), ourTypes, true );
347  for ( auto citem : connectedItems )
348  {
349  if( citem->Type() == PCB_PAD_T )
350  {
351  connectedPads.insert( static_cast<D_PAD*>( citem ) );
352  }
353  }
354  }
355 
356  for( D_PAD* pad : connectedPads )
357  {
358  if( pad->GetNetCode() != newNetCode )
359  changingPads.push_back( pad );
360  }
361  }
362 
363  // Run validations:
364 
365  if( changingPads.size() )
366  {
367  if( !confirmPadChange( changingPads ) )
368  return false;
369  }
370 
371  if( m_vias )
372  {
373  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
374  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
375  return false;
376 
377  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
378  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
380  {
381  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
382  m_ViaDrillCtrl->SelectAll();
383  m_ViaDrillCtrl->SetFocus();
384  return false;
385  }
386 
389  {
390  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
391  return false;
392  }
393  }
394 
395  if( m_tracks )
396  {
397  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
398  return false;
399  }
400 
401  // If we survived that, then save the changes:
402 
403  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
404  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
405 
406  for( auto item : m_items )
407  {
408  m_commit.Modify( item );
409 
410  switch( item->Type() )
411  {
412  case PCB_TRACE_T:
413  {
414  wxASSERT( m_tracks );
415  TRACK* t = static_cast<TRACK*>( item );
416 
418  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
419 
421  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
422 
424  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
425 
427  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
428 
429  if( m_trackNetclass->IsChecked() )
430  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
431  else if( !m_trackWidth.IsIndeterminate() )
433 
435 
436  if( layer != UNDEFINED_LAYER )
437  t->SetLayer( (PCB_LAYER_ID) layer );
438 
439  if( changeLock )
440  t->SetLocked( setLock );
441 
442  if ( !m_netSelector->IsIndeterminate() )
444 
445  break;
446  }
447 
448  case PCB_VIA_T:
449  {
450  wxASSERT( m_vias );
451  VIA* v = static_cast<VIA*>( item );
452 
453  if( !m_viaX.IsIndeterminate() )
454  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
455 
456  if( !m_viaY.IsIndeterminate() )
457  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
458 
459  if( m_ViaTypeChoice->GetSelection() != 3)
460  {
461  switch( m_ViaTypeChoice->GetSelection() )
462  {
463  default:
464  case 0:
466  v->SanitizeLayers();
467  break;
468  case 1:
470  break;
471  case 2:
473  break;
474  }
475  }
476 
477  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
478  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
479 
480  if (startLayer != UNDEFINED_LAYER )
481  v->SetTopLayer( startLayer );
482 
483  if (endLayer != UNDEFINED_LAYER )
484  v->SetBottomLayer( endLayer );
485 
486  v->SanitizeLayers();
487 
488  if( m_viaNetclass->IsChecked() )
489  {
490  switch( v->GetViaType() )
491  {
492  default:
493  wxFAIL_MSG("Unhandled via type");
494  // fall through
495 
496  case VIATYPE::THROUGH:
498  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
499  v->SetDrill( v->GetNetClass()->GetViaDrill() );
500  break;
501 
502  case VIATYPE::MICROVIA:
503  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
504  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
505  break;
506  }
507  }
508  else
509  {
512 
513  if( !m_viaDrill.IsIndeterminate() )
514  v->SetDrill( m_viaDrill.GetValue() );
515  }
516 
517  if ( !m_netSelector->IsIndeterminate() )
519 
520  if( changeLock )
521  v->SetLocked( setLock );
522 
523  break;
524  }
525 
526  default:
527  wxASSERT( false );
528  break;
529  }
530  }
531 
532  if ( !m_netSelector->IsIndeterminate() )
533  {
534  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
535  // outwards. We therefore have to update the connected pads in order for the net
536  // change to "stick".
537  for( D_PAD* pad : changingPads )
538  {
539  m_commit.Modify( pad );
540  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
541  }
542  }
543 
544  m_commit.Push( _( "Edit track/via properties" ) );
545 
546  return true;
547 }
548 
549 
551 {
552  bool enableNC = aEvent.IsChecked();
553 
554  m_DesignRuleWidths->Enable( !enableNC );
555  m_DesignRuleWidthsCtrl->Enable( !enableNC );
556  m_DesignRuleWidthsUnits->Enable( !enableNC );
557 
558  m_trackWidth.Enable( !enableNC );
559 }
560 
561 
562 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
563 {
564  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
565  m_TrackWidthCtrl->SelectAll();
566 }
567 
568 
569 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
570 {
571  m_DesignRuleWidthsCtrl->SetStringSelection( m_TrackWidthCtrl->GetValue() );
572 }
573 
574 
576 {
577  bool enableNC = aEvent.IsChecked();
578 
579  m_DesignRuleVias->Enable( !enableNC );
580  m_DesignRuleViasCtrl->Enable( !enableNC );
581  m_DesignRuleViasUnit->Enable( !enableNC );
582 
583  m_viaDiameter.Enable( !enableNC );
584  m_viaDrill.Enable( !enableNC );
585 }
586 
587 
588 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
589 {
590  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
591 
592  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
593  m_viaDrill.ChangeValue( viaDimension->m_Drill );
594 }
595 
596 
597 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
598 {
599  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
600 
601  if( m_vias )
602  {
603  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
604  {
605  m_ViaStartLayer->Enable();
606  m_ViaEndLayer->Enable();
607  }
608  else
609  {
612 
613  m_ViaStartLayer->Enable( false );
614  m_ViaEndLayer->Enable( false );
615  }
616  }
617 }
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:124
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
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
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
void onTrackNetclassCheck(wxCommandEvent &aEvent) override
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:310
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:105
void onWidthSelect(wxCommandEvent &aEvent) override
std::vector< int > m_TrackWidthList
void SetNotAllowedLayerSet(LSET aMask)
const wxPoint & GetStart() const
Definition: class_track.h:109
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:709
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
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:219
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)
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:115
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
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils)
Get the units string for a given units type.
Definition: base_units.cpp:452
Definitions for tracks, vias and zones.
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
void SetWidth(int aWidth)
Definition: class_track.h:102
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:436
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:129
PCB_LAYER_ID
A quick note on layer IDs:
void onWidthEdit(wxCommandEvent &aEvent) override
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:300
void onViaSelect(wxCommandEvent &aEvent) override
bool IsIndeterminate()
const wxString & GetName() const
Definition: class_pad.h:203
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)
void SetNetInfo(NETINFO_LIST *aNetInfoList)
virtual bool Validate(long long int aMin, long long int aMax, bool setFocusOnError=true)
Function Validate Validates the control against the given range, informing the user of any errors fou...
bool SetLayersHotkeys(bool value)
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:737
const wxPoint GetPosition() const override
Definition: class_track.h:309
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
MODULE * GetParent() const
Definition: class_pad.h:167
EDA_UNITS m_units
Definition: dialog_shim.h:196
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:103
#define _(s)
Definition: 3d_actions.cpp:31
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:351
VIATYPE GetViaType() const
Definition: class_track.h:336
PCB_LAYER_ID TopLayer() const
const wxPoint & GetEnd() const
Definition: class_track.h:106
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
VIATYPE
Definition: class_track.h:60
void SetStart(const wxPoint &aStart)
Definition: class_track.h:108
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:74
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:341
PCB_LAYER_ID BottomLayer() const
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
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...