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_T viaType = VIA_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  {
101  m_trackStartX.SetValue( t->GetStart().x );
102  m_trackStartY.SetValue( t->GetStart().y );
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 = VIA_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 VIA_THROUGH: m_ViaTypeChoice->SetSelection( 0 ); break;
230  case VIA_MICROVIA: m_ViaTypeChoice->SetSelection( 1 ); break;
231  case VIA_BLIND_BURIED: m_ViaTypeChoice->SetSelection( 2 ); break;
232  case VIA_NOT_DEFINED: m_ViaTypeChoice->SetSelection( 3 ); break;
233  }
234 
235  m_ViaStartLayer->Enable( viaType != VIA_THROUGH );
236  m_ViaEndLayer->Enable( viaType != VIA_THROUGH );
237  }
238  else
239  {
240  m_MainSizer->Hide( m_sbViaSizer, true );
241  }
242 
243  if( m_tracks )
244  {
246 
247  int widthSelection = wxNOT_FOUND;
248 
249  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
250  {
251  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
252  wxString msg = StringFromValue( m_units, width, false, true );
253  m_DesignRuleWidthsCtrl->Append( msg );
254 
255  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
256  widthSelection = ii;
257  }
258 
259  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
260 
262  }
263  else
264  {
265  m_MainSizer->Hide( m_sbTrackSizer, true );
266  }
267 
268  if( hasLocked && hasUnlocked )
269  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
270  else if( hasLocked )
271  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
272  else
273  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
274 
276 
277  m_StdButtonsOK->SetDefault();
278 
279  // Now all widgets have the size fixed, call FinishDialogSettings
281 }
282 
283 
284 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& changingPads )
285 {
286  wxString msg;
287 
288  if( changingPads.size() == 1 )
289  {
290  D_PAD* pad = *changingPads.begin();
291  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
292  "Do you wish to continue?" ),
293  pad->GetParent()->GetReference(),
294  pad->GetName(),
295  m_netSelector->GetValue() );
296  }
297  else if( changingPads.size() == 2 )
298  {
299  D_PAD* pad1 = *changingPads.begin();
300  D_PAD* pad2 = *( ++changingPads.begin() );
301  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
302  "Do you wish to continue?" ),
303  pad1->GetParent()->GetReference(),
304  pad1->GetName(),
305  pad2->GetParent()->GetReference(),
306  pad2->GetName(),
307  m_netSelector->GetValue() );
308  }
309  else
310  {
311  msg.Printf( _( "This will change the net assigned to %lu connected pads to %s.\n"
312  "Do you wish to continue?" ),
313  static_cast<unsigned long>( changingPads.size() ),
314  m_netSelector->GetValue() );
315  }
316 
317  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
318  dlg.SetOKLabel( _( "Continue" ) );
319  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
320 
321  return dlg.ShowModal() == wxID_OK;
322 }
323 
324 
326 {
327  auto connectivity = m_frame->GetBoard()->GetConnectivity();
328  int newNetCode = m_netSelector->GetSelectedNetcode();
329  std::vector<D_PAD*> changingPads;
330 
331  if ( !m_netSelector->IsIndeterminate() )
332  {
333  std::set<D_PAD*> connectedPads;
334 
335  for( auto& item : m_items )
336  {
337  const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_MODULE_T, EOT };
338  auto connectedItems = connectivity->GetConnectedItems( static_cast<BOARD_CONNECTED_ITEM*>( item ), ourTypes, true );
339  for ( auto citem : connectedItems )
340  {
341  if( citem->Type() == PCB_PAD_T )
342  {
343  connectedPads.insert( static_cast<D_PAD*>( citem ) );
344  }
345  }
346  }
347 
348  for( D_PAD* pad : connectedPads )
349  {
350  if( pad->GetNetCode() != newNetCode )
351  changingPads.push_back( pad );
352  }
353  }
354 
355  // Run validations:
356 
357  if( changingPads.size() )
358  {
359  if( !confirmPadChange( changingPads ) )
360  return false;
361  }
362 
363  if( m_vias )
364  {
365  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
366  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
367  return false;
368 
369  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
370  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
372  {
373  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
374  m_ViaDrillCtrl->SelectAll();
375  m_ViaDrillCtrl->SetFocus();
376  return false;
377  }
378 
381  {
382  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
383  return false;
384  }
385  }
386 
387  if( m_tracks )
388  {
389  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
390  return false;
391  }
392 
393  // If we survived that, then save the changes:
394 
395  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
396  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
397 
398  for( auto item : m_items )
399  {
400  m_commit.Modify( item );
401 
402  switch( item->Type() )
403  {
404  case PCB_TRACE_T:
405  {
406  wxASSERT( m_tracks );
407  TRACK* t = static_cast<TRACK*>( item );
408 
410  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
411 
413  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
414 
416  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
417 
419  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
420 
421  if( m_trackNetclass->IsChecked() )
422  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
423  else if( !m_trackWidth.IsIndeterminate() )
425 
427 
428  if( layer != UNDEFINED_LAYER )
429  t->SetLayer( (PCB_LAYER_ID) layer );
430 
431  if( changeLock )
432  t->SetLocked( setLock );
433 
434  if ( !m_netSelector->IsIndeterminate() )
436 
437  break;
438  }
439 
440  case PCB_VIA_T:
441  {
442  wxASSERT( m_vias );
443  VIA* v = static_cast<VIA*>( item );
444 
445  if( !m_viaX.IsIndeterminate() )
446  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
447 
448  if( !m_viaY.IsIndeterminate() )
449  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
450 
451  if( m_ViaTypeChoice->GetSelection() != 3)
452  {
453  switch( m_ViaTypeChoice->GetSelection() )
454  {
455  default:
456  case 0: v->SetViaType( VIA_THROUGH ); v->SanitizeLayers(); break;
457  case 1: v->SetViaType( VIA_MICROVIA ); break;
458  case 2: v->SetViaType( VIA_BLIND_BURIED ); break;
459  }
460  }
461 
462  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
463  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
464 
465  if (startLayer != UNDEFINED_LAYER )
466  v->SetTopLayer( startLayer );
467 
468  if (endLayer != UNDEFINED_LAYER )
469  v->SetBottomLayer( endLayer );
470 
471  v->SanitizeLayers();
472 
473  if( m_viaNetclass->IsChecked() )
474  {
475  switch( v->GetViaType() )
476  {
477  default:
478  wxFAIL_MSG("Unhandled via type");
479  // fall through
480 
481  case VIA_THROUGH:
482  case VIA_BLIND_BURIED:
483  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
484  v->SetDrill( v->GetNetClass()->GetViaDrill() );
485  break;
486 
487  case VIA_MICROVIA:
488  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
489  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
490  break;
491  }
492  }
493  else
494  {
497 
498  if( !m_viaDrill.IsIndeterminate() )
499  v->SetDrill( m_viaDrill.GetValue() );
500  }
501 
502  if ( !m_netSelector->IsIndeterminate() )
504 
505  if( changeLock )
506  v->SetLocked( setLock );
507 
508  break;
509  }
510 
511  default:
512  wxASSERT( false );
513  break;
514  }
515  }
516 
517  if ( !m_netSelector->IsIndeterminate() )
518  {
519  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
520  // outwards. We therefore have to update the connected pads in order for the net
521  // change to "stick".
522  for( D_PAD* pad : changingPads )
523  {
524  m_commit.Modify( pad );
525  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
526  }
527  }
528 
529  m_commit.Push( _( "Edit track/via properties" ) );
530 
531  return true;
532 }
533 
534 
536 {
537  bool enableNC = aEvent.IsChecked();
538 
539  m_DesignRuleWidths->Enable( !enableNC );
540  m_DesignRuleWidthsCtrl->Enable( !enableNC );
541  m_DesignRuleWidthsUnits->Enable( !enableNC );
542 
543  m_trackWidth.Enable( !enableNC );
544 }
545 
546 
547 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
548 {
549  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
550  m_TrackWidthCtrl->SelectAll();
551 }
552 
553 
554 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
555 {
556  m_DesignRuleWidthsCtrl->SetStringSelection( m_TrackWidthCtrl->GetValue() );
557 }
558 
559 
561 {
562  bool enableNC = aEvent.IsChecked();
563 
564  m_DesignRuleVias->Enable( !enableNC );
565  m_DesignRuleViasCtrl->Enable( !enableNC );
566  m_DesignRuleViasUnit->Enable( !enableNC );
567 
568  m_viaDiameter.Enable( !enableNC );
569  m_viaDrill.Enable( !enableNC );
570 }
571 
572 
573 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
574 {
575  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
576 
577  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
578  m_viaDrill.ChangeValue( viaDimension->m_Drill );
579 }
580 
581 
582 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
583 {
584  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
585 
586  if( m_vias )
587  {
588  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
589  {
590  m_ViaStartLayer->Enable();
591  m_ViaEndLayer->Enable();
592  }
593  else
594  {
597 
598  m_ViaStartLayer->Enable( false );
599  m_ViaEndLayer->Enable( false );
600  }
601  }
602 }
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
void SetViaType(VIATYPE_T aViaType)
Definition: class_track.h:347
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:320
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:699
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 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)
VIATYPE_T
Definition: class_track.h:60
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:118
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
Definitions for tracks, vias and zones.
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
void SetWidth(int aWidth)
Definition: class_track.h:102
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:416
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:310
void onViaSelect(wxCommandEvent &aEvent) override
bool IsIndeterminate()
VIATYPE_T GetViaType() const
Definition: class_track.h:346
const wxString & GetName() const
Definition: class_pad.h:195
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:750
#define _(s)
const wxPoint GetPosition() const override
Definition: class_track.h:319
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:119
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
MODULE * GetParent() const
Definition: class_pad.h:167
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
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:354
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
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:96
BOARD * GetBoard() const
EDA_UNITS_T m_units
Definition: dialog_shim.h:185
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,...
PCB_LAYER_ID BottomLayer() const
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
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 StringFromValue(EDA_UNITS_T aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:217
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit, bool aUseMils)
Get the units string for a given units type.
Definition: base_units.cpp:450
virtual void ChangeValue(int aValue)
Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units c...