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->SetBoard( aParent->GetBoard() );
59  m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
60 
63  m_TrackLayerCtrl->SetBoardFrame( aParent );
65 
68  m_ViaStartLayer->SetBoardFrame( aParent );
70 
73  m_ViaEndLayer->SetBoardFrame( aParent );
75 
76  bool nets = false;
77  int net = 0;
78  bool hasLocked = false;
79  bool hasUnlocked = false;
80 
81  // Look for values that are common for every item that is selected
82  for( auto& item : m_items )
83  {
84  if( !nets )
85  {
86  net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode();
87  nets = true;
88  }
89  else if( net != static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode() )
90  {
91  net = -1;
92  }
93 
94  switch( item->Type() )
95  {
96  case PCB_TRACE_T:
97  case PCB_ARC_T:
98  {
99  const TRACK* t = static_cast<const TRACK*>( item );
100 
101  if( !m_tracks ) // first track in the list
102  {
105  m_trackEndX.SetValue( t->GetEnd().x );
106  m_trackEndY.SetValue( t->GetEnd().y );
109  m_tracks = true;
110  }
111  else // check if values are the same for every selected track
112  {
113  if( m_trackStartX.GetValue() != t->GetStart().x )
115 
116  if( m_trackStartY.GetValue() != t->GetStart().y )
118 
119  if( m_trackEndX.GetValue() != t->GetEnd().x )
121 
122  if( m_trackEndY.GetValue() != t->GetEnd().y )
124 
125  if( m_trackWidth.GetValue() != t->GetWidth() )
127 
130  }
131 
132  if( t->IsLocked() )
133  hasLocked = true;
134  else
135  hasUnlocked = true;
136 
137  break;
138  }
139 
140  case PCB_VIA_T:
141  {
142  const VIA* v = static_cast<const VIA*>( item );
143 
144  if( !m_vias ) // first via in the list
145  {
146  m_viaX.SetValue( v->GetPosition().x );
147  m_viaY.SetValue( v->GetPosition().y );
150  m_vias = true;
151  viaType = v->GetViaType();
154  }
155  else // check if values are the same for every selected via
156  {
157  if( m_viaX.GetValue() != v->GetPosition().x )
159 
160  if( m_viaY.GetValue() != v->GetPosition().y )
162 
163  if( m_viaDiameter.GetValue() != v->GetWidth() )
165 
166  if( m_viaDrill.GetValue() != v->GetDrillValue() )
168 
169  if( viaType != v->GetViaType() )
170  viaType = VIATYPE::NOT_DEFINED;
171 
174 
177  }
178 
179  if( v->IsLocked() )
180  hasLocked = true;
181  else
182  hasUnlocked = true;
183 
184  break;
185  }
186 
187  default:
188  {
189  wxASSERT( false );
190  break;
191  }
192  }
193  }
194 
195  if ( net >= 0 )
197  else
199 
200  wxASSERT( m_tracks || m_vias );
201 
202  if( m_vias )
203  {
205 
206  int viaSelection = wxNOT_FOUND;
207 
208  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
209  {
210  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
211  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false, true )
212  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false, true );
213  m_DesignRuleViasCtrl->Append( msg, viaDimension );
214 
215  if( viaSelection == wxNOT_FOUND
216  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
217  && m_viaDrill.GetValue() == viaDimension->m_Drill )
218  {
219  viaSelection = ii;
220  }
221  }
222 
223  m_DesignRuleViasCtrl->SetSelection( viaSelection );
224 
226 
227  m_ViaTypeChoice->Enable();
228 
229  switch( viaType )
230  {
231  case VIATYPE::THROUGH:
232  m_ViaTypeChoice->SetSelection( 0 );
233  break;
234  case VIATYPE::MICROVIA:
235  m_ViaTypeChoice->SetSelection( 1 );
236  break;
238  m_ViaTypeChoice->SetSelection( 2 );
239  break;
241  m_ViaTypeChoice->SetSelection( wxNOT_FOUND );
242  break;
243  }
244 
245  m_ViaStartLayer->Enable( viaType != VIATYPE::THROUGH );
246  m_ViaEndLayer->Enable( viaType != VIATYPE::THROUGH );
247  }
248  else
249  {
250  m_MainSizer->Hide( m_sbViaSizer, true );
251  }
252 
253  if( m_tracks )
254  {
256 
257  int widthSelection = wxNOT_FOUND;
258 
259  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
260  {
261  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
262  wxString msg = StringFromValue( m_units, width, false, true );
263  m_DesignRuleWidthsCtrl->Append( msg );
264 
265  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
266  widthSelection = ii;
267  }
268 
269  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
270 
272  }
273  else
274  {
275  m_MainSizer->Hide( m_sbTrackSizer, true );
276  }
277 
278  if( hasLocked && hasUnlocked )
279  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
280  else if( hasLocked )
281  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
282  else
283  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
284 
286 
287  m_StdButtonsOK->SetDefault();
288 
289  // Now all widgets have the size fixed, call FinishDialogSettings
291 }
292 
293 
294 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& changingPads )
295 {
296  wxString msg;
297 
298  if( changingPads.size() == 1 )
299  {
300  D_PAD* pad = *changingPads.begin();
301  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
302  "Do you wish to continue?" ),
303  pad->GetParent()->GetReference(),
304  pad->GetName(),
305  m_netSelector->GetValue() );
306  }
307  else if( changingPads.size() == 2 )
308  {
309  D_PAD* pad1 = *changingPads.begin();
310  D_PAD* pad2 = *( ++changingPads.begin() );
311  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
312  "Do you wish to continue?" ),
313  pad1->GetParent()->GetReference(),
314  pad1->GetName(),
315  pad2->GetParent()->GetReference(),
316  pad2->GetName(),
317  m_netSelector->GetValue() );
318  }
319  else
320  {
321  msg.Printf( _( "This will change the net assigned to %lu connected pads to %s.\n"
322  "Do you wish to continue?" ),
323  static_cast<unsigned long>( changingPads.size() ),
324  m_netSelector->GetValue() );
325  }
326 
327  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
328  dlg.SetOKLabel( _( "Continue" ) );
329  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
330 
331  return dlg.ShowModal() == wxID_OK;
332 }
333 
334 
336 {
337  auto connectivity = m_frame->GetBoard()->GetConnectivity();
338  int newNetCode = m_netSelector->GetSelectedNetcode();
339  std::vector<D_PAD*> changingPads;
340 
341  if ( !m_netSelector->IsIndeterminate() )
342  {
343  std::set<D_PAD*> connectedPads;
344 
345  for( auto& item : m_items )
346  {
347  const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_MODULE_T, EOT };
348  auto connectedItems = connectivity->GetConnectedItems( static_cast<BOARD_CONNECTED_ITEM*>( item ), ourTypes, true );
349  for ( auto citem : connectedItems )
350  {
351  if( citem->Type() == PCB_PAD_T )
352  {
353  connectedPads.insert( static_cast<D_PAD*>( citem ) );
354  }
355  }
356  }
357 
358  for( D_PAD* pad : connectedPads )
359  {
360  if( pad->GetNetCode() != newNetCode )
361  changingPads.push_back( pad );
362  }
363  }
364 
365  // Run validations:
366 
367  if( changingPads.size() )
368  {
369  if( !confirmPadChange( changingPads ) )
370  return false;
371  }
372 
373  if( m_vias )
374  {
375  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
376  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
377  return false;
378 
379  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
380  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
382  {
383  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
384  m_ViaDrillCtrl->SelectAll();
385  m_ViaDrillCtrl->SetFocus();
386  return false;
387  }
388 
391  {
392  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
393  return false;
394  }
395  }
396 
397  if( m_tracks )
398  {
399  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
400  return false;
401  }
402 
403  // If we survived that, then save the changes:
404 
405  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
406  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
407 
408  for( auto item : m_items )
409  {
410  m_commit.Modify( item );
411 
412  switch( item->Type() )
413  {
414  case PCB_TRACE_T:
415  case PCB_ARC_T:
416  {
417  wxASSERT( m_tracks );
418  TRACK* t = static_cast<TRACK*>( item );
419 
421  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
422 
424  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
425 
427  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
428 
430  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
431 
432  if( m_trackNetclass->IsChecked() )
433  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
434  else if( !m_trackWidth.IsIndeterminate() )
436 
438 
439  if( layer != UNDEFINED_LAYER )
440  t->SetLayer( (PCB_LAYER_ID) layer );
441 
442  if( changeLock )
443  t->SetLocked( setLock );
444 
445  if ( !m_netSelector->IsIndeterminate() )
447 
448  break;
449  }
450 
451  case PCB_VIA_T:
452  {
453  wxASSERT( m_vias );
454  VIA* v = static_cast<VIA*>( item );
455 
456  if( !m_viaX.IsIndeterminate() )
457  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
458 
459  if( !m_viaY.IsIndeterminate() )
460  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
461 
462  switch( m_ViaTypeChoice->GetSelection() )
463  {
464  case 0:
466  v->SanitizeLayers();
467  break;
468  case 1:
470  break;
471  case 2:
473  break;
474  default:
475  break;
476  }
477 
478  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
479  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
480 
481  if (startLayer != UNDEFINED_LAYER )
482  v->SetTopLayer( startLayer );
483 
484  if (endLayer != UNDEFINED_LAYER )
485  v->SetBottomLayer( endLayer );
486 
487  v->SanitizeLayers();
488 
489  if( m_viaNetclass->IsChecked() )
490  {
491  switch( v->GetViaType() )
492  {
493  default:
494  wxFAIL_MSG("Unhandled via type");
495  // fall through
496 
497  case VIATYPE::THROUGH:
499  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
500  v->SetDrill( v->GetNetClass()->GetViaDrill() );
501  break;
502 
503  case VIATYPE::MICROVIA:
504  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
505  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
506  break;
507  }
508  }
509  else
510  {
513 
514  if( !m_viaDrill.IsIndeterminate() )
515  v->SetDrill( m_viaDrill.GetValue() );
516  }
517 
518  if ( !m_netSelector->IsIndeterminate() )
520 
521  if( changeLock )
522  v->SetLocked( setLock );
523 
524  break;
525  }
526 
527  default:
528  wxASSERT( false );
529  break;
530  }
531  }
532 
533  if ( !m_netSelector->IsIndeterminate() )
534  {
535  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
536  // outwards. We therefore have to update the connected pads in order for the net
537  // change to "stick".
538  for( D_PAD* pad : changingPads )
539  {
540  m_commit.Modify( pad );
541  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
542  }
543  }
544 
545  m_commit.Push( _( "Edit track/via properties" ) );
546 
547  return true;
548 }
549 
550 
552 {
553  bool enableNC = aEvent.IsChecked();
554 
555  m_DesignRuleWidths->Enable( !enableNC );
556  m_DesignRuleWidthsCtrl->Enable( !enableNC );
557  m_DesignRuleWidthsUnits->Enable( !enableNC );
558 
559  m_trackWidth.Enable( !enableNC );
560 }
561 
562 
563 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
564 {
565  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
566  m_TrackWidthCtrl->SelectAll();
567 }
568 
569 
570 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
571 {
572  m_DesignRuleWidthsCtrl->SetStringSelection( m_TrackWidthCtrl->GetValue() );
573 }
574 
575 
577 {
578  bool enableNC = aEvent.IsChecked();
579 
580  m_DesignRuleVias->Enable( !enableNC );
581  m_DesignRuleViasCtrl->Enable( !enableNC );
582  m_DesignRuleViasUnit->Enable( !enableNC );
583 
584  m_viaDiameter.Enable( !enableNC );
585  m_viaDrill.Enable( !enableNC );
586 }
587 
588 
589 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
590 {
591  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
592 
593  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
594  m_viaDrill.ChangeValue( viaDimension->m_Drill );
595 }
596 
597 
598 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
599 {
600  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
601 
602  if( m_vias )
603  {
604  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
605  {
606  m_ViaStartLayer->Enable();
607  m_ViaEndLayer->Enable();
608  }
609  else
610  {
613 
614  m_ViaStartLayer->Enable( false );
615  m_ViaEndLayer->Enable( false );
616  }
617  }
618 }
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:126
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
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:390
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:107
void onWidthSelect(wxCommandEvent &aEvent) override
std::vector< int > m_TrackWidthList
void SetNotAllowedLayerSet(LSET aMask)
const wxPoint & GetStart() const
Definition: class_track.h:111
void SetBoard(BOARD *aBoard)
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:234
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:467
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
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:104
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:131
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
VIATYPE
Definition: class_track.h:62
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:306
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:713
const wxPoint GetPosition() const override
Definition: class_track.h:389
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:105
#define _(s)
Definition: 3d_actions.cpp:33
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:431
VIATYPE GetViaType() const
Definition: class_track.h:416
PCB_LAYER_ID TopLayer() const
const wxPoint & GetEnd() const
Definition: class_track.h:108
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:110
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:76
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:421
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...