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  // Configure display origin transforms
64 
65  VIATYPE viaType = VIATYPE::NOT_DEFINED;
66 
69  m_TrackLayerCtrl->SetBoardFrame( aParent );
71 
74  m_ViaStartLayer->SetBoardFrame( aParent );
76 
79  m_ViaEndLayer->SetBoardFrame( aParent );
81 
82  bool nets = false;
83  int net = 0;
84  bool hasLocked = false;
85  bool hasUnlocked = false;
86 
87  // Look for values that are common for every item that is selected
88  for( EDA_ITEM* item : m_items )
89  {
90  if( !nets )
91  {
92  net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode();
93  nets = true;
94  }
95  else if( net != static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode() )
96  {
97  net = -1;
98  }
99 
100  switch( item->Type() )
101  {
102  case PCB_TRACE_T:
103  case PCB_ARC_T:
104  {
105  const TRACK* t = static_cast<const TRACK*>( item );
106 
107  if( !m_tracks ) // first track in the list
108  {
111  m_trackEndX.SetValue( t->GetEnd().x );
112  m_trackEndY.SetValue( t->GetEnd().y );
115  m_tracks = true;
116  }
117  else // check if values are the same for every selected track
118  {
119  if( m_trackStartX.GetValue() != t->GetStart().x )
121 
122  if( m_trackStartY.GetValue() != t->GetStart().y )
124 
125  if( m_trackEndX.GetValue() != t->GetEnd().x )
127 
128  if( m_trackEndY.GetValue() != t->GetEnd().y )
130 
131  if( m_trackWidth.GetValue() != t->GetWidth() )
133 
135  {
139  }
140  }
141 
142  if( t->IsLocked() )
143  hasLocked = true;
144  else
145  hasUnlocked = true;
146 
147  break;
148  }
149 
150  case PCB_VIA_T:
151  {
152  const VIA* v = static_cast<const VIA*>( item );
153 
154  if( !m_vias ) // first via in the list
155  {
156  m_viaX.SetValue( v->GetPosition().x );
157  m_viaY.SetValue( v->GetPosition().y );
160  m_vias = true;
161  viaType = v->GetViaType();
164  }
165  else // check if values are the same for every selected via
166  {
167  if( m_viaX.GetValue() != v->GetPosition().x )
169 
170  if( m_viaY.GetValue() != v->GetPosition().y )
172 
173  if( m_viaDiameter.GetValue() != v->GetWidth() )
175 
176  if( m_viaDrill.GetValue() != v->GetDrillValue() )
178 
179  if( viaType != v->GetViaType() )
180  viaType = VIATYPE::NOT_DEFINED;
181 
183  {
187  }
188 
190  {
194  }
195  }
196 
197  if( v->IsLocked() )
198  hasLocked = true;
199  else
200  hasUnlocked = true;
201 
202  break;
203  }
204 
205  default:
206  {
207  wxASSERT( false );
208  break;
209  }
210  }
211  }
212 
213  m_netSelector->SetBoard( aParent->GetBoard() );
214  m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
215 
216  if ( net >= 0 )
217  {
219  }
220  else
221  {
224  }
225 
226  wxASSERT( m_tracks || m_vias );
227 
228  if( m_vias )
229  {
231 
232  int viaSelection = wxNOT_FOUND;
233 
234  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
235  {
236  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
237  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false, true )
238  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false, true );
239  m_DesignRuleViasCtrl->Append( msg, viaDimension );
240 
241  if( viaSelection == wxNOT_FOUND
242  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
243  && m_viaDrill.GetValue() == viaDimension->m_Drill )
244  {
245  viaSelection = ii;
246  }
247  }
248 
249  m_DesignRuleViasCtrl->SetSelection( viaSelection );
250 
252 
253  m_ViaTypeChoice->Enable();
254 
255  switch( viaType )
256  {
257  case VIATYPE::THROUGH:
258  m_ViaTypeChoice->SetSelection( 0 );
259  break;
260  case VIATYPE::MICROVIA:
261  m_ViaTypeChoice->SetSelection( 1 );
262  break;
264  m_ViaTypeChoice->SetSelection( 2 );
265  break;
267  m_ViaTypeChoice->SetSelection( wxNOT_FOUND );
268  break;
269  }
270 
271  m_ViaStartLayer->Enable( viaType != VIATYPE::THROUGH );
272  m_ViaEndLayer->Enable( viaType != VIATYPE::THROUGH );
273  }
274  else
275  {
276  m_MainSizer->Hide( m_sbViaSizer, true );
277  }
278 
279  if( m_tracks )
280  {
282 
283  int widthSelection = wxNOT_FOUND;
284 
285  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
286  {
287  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
288  wxString msg = StringFromValue( m_units, width, false, true );
289  m_DesignRuleWidthsCtrl->Append( msg );
290 
291  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
292  widthSelection = ii;
293  }
294 
295  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
296 
298  }
299  else
300  {
301  m_MainSizer->Hide( m_sbTrackSizer, true );
302  }
303 
304  if( hasLocked && hasUnlocked )
305  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
306  else if( hasLocked )
307  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
308  else
309  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
310 
312 
313  m_StdButtonsOK->SetDefault();
314 
315  // Now all widgets have the size fixed, call FinishDialogSettings
317 }
318 
319 
320 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& changingPads )
321 {
322  wxString msg;
323 
324  if( changingPads.size() == 1 )
325  {
326  D_PAD* pad = *changingPads.begin();
327  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
328  "Do you wish to continue?" ),
329  pad->GetParent()->GetReference(),
330  pad->GetName(),
331  m_netSelector->GetValue() );
332  }
333  else if( changingPads.size() == 2 )
334  {
335  D_PAD* pad1 = *changingPads.begin();
336  D_PAD* pad2 = *( ++changingPads.begin() );
337  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
338  "Do you wish to continue?" ),
339  pad1->GetParent()->GetReference(),
340  pad1->GetName(),
341  pad2->GetParent()->GetReference(),
342  pad2->GetName(),
343  m_netSelector->GetValue() );
344  }
345  else
346  {
347  msg.Printf( _( "This will change the net assigned to %lu connected pads to %s.\n"
348  "Do you wish to continue?" ),
349  static_cast<unsigned long>( changingPads.size() ),
350  m_netSelector->GetValue() );
351  }
352 
353  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
354  dlg.SetOKLabel( _( "Continue" ) );
355  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
356 
357  return dlg.ShowModal() == wxID_OK;
358 }
359 
360 
362 {
363  auto connectivity = m_frame->GetBoard()->GetConnectivity();
364  int newNetCode = m_netSelector->GetSelectedNetcode();
365  std::vector<D_PAD*> changingPads;
366 
367  if ( !m_netSelector->IsIndeterminate() )
368  {
369  std::set<D_PAD*> connectedPads;
370 
371  for( auto& item : m_items )
372  {
373  const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_MODULE_T, EOT };
374  auto connectedItems = connectivity->GetConnectedItems( static_cast<BOARD_CONNECTED_ITEM*>( item ), ourTypes, true );
375  for ( auto citem : connectedItems )
376  {
377  if( citem->Type() == PCB_PAD_T )
378  {
379  connectedPads.insert( static_cast<D_PAD*>( citem ) );
380  }
381  }
382  }
383 
384  for( D_PAD* pad : connectedPads )
385  {
386  if( pad->GetNetCode() != newNetCode )
387  changingPads.push_back( pad );
388  }
389  }
390 
391  // Run validations:
392 
393  if( changingPads.size() )
394  {
395  if( !confirmPadChange( changingPads ) )
396  return false;
397  }
398 
399  if( m_vias )
400  {
401  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
402  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
403  return false;
404 
405  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
406  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
408  {
409  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
410  m_ViaDrillCtrl->SelectAll();
411  m_ViaDrillCtrl->SetFocus();
412  return false;
413  }
414 
417  {
418  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
419  return false;
420  }
421  }
422 
423  if( m_tracks )
424  {
425  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
426  return false;
427  }
428 
429  // If we survived that, then save the changes:
430 
431  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
432  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
433 
434  for( auto item : m_items )
435  {
436  m_commit.Modify( item );
437 
438  switch( item->Type() )
439  {
440  case PCB_TRACE_T:
441  case PCB_ARC_T:
442  {
443  wxASSERT( m_tracks );
444  TRACK* t = static_cast<TRACK*>( item );
445 
447  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
448 
450  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
451 
453  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
454 
456  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
457 
458  if( m_trackNetclass->IsChecked() )
459  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
460  else if( !m_trackWidth.IsIndeterminate() )
462 
464 
465  if( layer != UNDEFINED_LAYER )
466  t->SetLayer( (PCB_LAYER_ID) layer );
467 
468  if( changeLock )
469  t->SetLocked( setLock );
470 
471  if ( !m_netSelector->IsIndeterminate() )
473 
474  break;
475  }
476 
477  case PCB_VIA_T:
478  {
479  wxASSERT( m_vias );
480  VIA* v = static_cast<VIA*>( item );
481 
482  if( !m_viaX.IsIndeterminate() )
483  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
484 
485  if( !m_viaY.IsIndeterminate() )
486  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
487 
488  switch( m_ViaTypeChoice->GetSelection() )
489  {
490  case 0:
492  v->SanitizeLayers();
493  break;
494  case 1:
496  break;
497  case 2:
499  break;
500  default:
501  break;
502  }
503 
504  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
505  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
506 
507  if (startLayer != UNDEFINED_LAYER )
508  v->SetTopLayer( startLayer );
509 
510  if (endLayer != UNDEFINED_LAYER )
511  v->SetBottomLayer( endLayer );
512 
513  v->SanitizeLayers();
514 
515  if( m_viaNetclass->IsChecked() )
516  {
517  switch( v->GetViaType() )
518  {
519  default:
520  wxFAIL_MSG("Unhandled via type");
522 
523  case VIATYPE::THROUGH:
525  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
526  v->SetDrill( v->GetNetClass()->GetViaDrill() );
527  break;
528 
529  case VIATYPE::MICROVIA:
530  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
531  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
532  break;
533  }
534  }
535  else
536  {
539 
540  if( !m_viaDrill.IsIndeterminate() )
541  v->SetDrill( m_viaDrill.GetValue() );
542  }
543 
544  if ( !m_netSelector->IsIndeterminate() )
546 
547  if( changeLock )
548  v->SetLocked( setLock );
549 
550  break;
551  }
552 
553  default:
554  wxASSERT( false );
555  break;
556  }
557  }
558 
559  if ( !m_netSelector->IsIndeterminate() )
560  {
561  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
562  // outwards. We therefore have to update the connected pads in order for the net
563  // change to "stick".
564  for( D_PAD* pad : changingPads )
565  {
566  m_commit.Modify( pad );
567  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
568  }
569  }
570 
571  m_commit.Push( _( "Edit track/via properties" ) );
572 
573  return true;
574 }
575 
576 
578 {
579  bool enableNC = aEvent.IsChecked();
580 
581  m_DesignRuleWidths->Enable( !enableNC );
582  m_DesignRuleWidthsCtrl->Enable( !enableNC );
583  m_DesignRuleWidthsUnits->Enable( !enableNC );
584 
585  m_trackWidth.Enable( !enableNC );
586 }
587 
588 
589 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
590 {
591  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
592  m_TrackWidthCtrl->SelectAll();
593 }
594 
595 
596 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
597 {
598  m_DesignRuleWidthsCtrl->SetStringSelection( m_TrackWidthCtrl->GetValue() );
599 }
600 
601 
603 {
604  bool enableNC = aEvent.IsChecked();
605 
606  m_DesignRuleVias->Enable( !enableNC );
607  m_DesignRuleViasCtrl->Enable( !enableNC );
608  m_DesignRuleViasUnit->Enable( !enableNC );
609 
610  m_viaDiameter.Enable( !enableNC );
611  m_viaDrill.Enable( !enableNC );
612 }
613 
614 
615 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
616 {
617  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
618 
619  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
620  m_viaDrill.ChangeValue( viaDimension->m_Drill );
621 }
622 
623 
624 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
625 {
626  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
627 
628  if( m_vias )
629  {
630  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
631  {
632  m_ViaStartLayer->Enable();
633  m_ViaEndLayer->Enable();
634  }
635  else
636  {
639 
640  m_ViaStartLayer->Enable( false );
641  m_ViaEndLayer->Enable( false );
642  }
643  }
644 }
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:136
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.
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:421
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:112
void onWidthSelect(wxCommandEvent &aEvent) override
std::vector< int > m_TrackWidthList
void SetNotAllowedLayerSet(LSET aMask)
const wxPoint & GetStart() const
Definition: class_track.h:116
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:742
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
bool SetNetCode(int aNetCode, bool aNoAssert)
Sets net using a net code.
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
COMMIT.
Definition: commit.h:71
int GetSelectedNetcode()
const NETINFO_LIST & GetNetInfo() const
Definition: class_board.h:713
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:88
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:109
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:451
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:141
PCB_LAYER_ID
A quick note on layer IDs:
int GetTrackWidth() const
Definition: netclass.h:168
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:174
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:345
void onViaSelect(wxCommandEvent &aEvent) override
bool IsIndeterminate()
const wxString & GetName() const
Definition: class_pad.h:132
int SetLayerSelection(LAYER_NUM layer)
bool confirmPadChange(const std::vector< D_PAD * > &connectedPads)
int GetuViaDiameter() const
Definition: netclass.h:177
void SetNetInfo(NETINFO_LIST *aNetInfoList)
bool SetLayersHotkeys(bool value)
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:111
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:110
#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:483
VIATYPE GetViaType() const
Definition: class_track.h:381
int GetViaDiameter() const
Definition: netclass.h:171
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:113
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:115
int GetuViaDrill() const
Definition: netclass.h:180
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Function SetOriginTransform Sets the current origin transform mode.
Definition: unit_binder.h:171
BOARD * GetBoard() const
Class DIALOG_TRACK_VIA_PROPERTIES_BASE.
#define GEOMETRY_MIN_SIZE
Definition: class_track.h:80
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
wxPoint GetPosition() const override
Definition: class_track.h:420
#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: class_track.h:382
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...