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 <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, 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, false ),
51  m_viaDrill( aParent, m_ViaDrillLabel, m_ViaDrillCtrl, m_ViaDrillUnit, 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  {
109  m_trackStartX.SetValue( t->GetStart().x );
110  m_trackStartY.SetValue( t->GetStart().y );
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  // 0 is the netclass place-holder
235  for( unsigned ii = 1; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
236  {
237  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
238  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false )
239  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false );
240  m_DesignRuleViasCtrl->Append( msg, viaDimension );
241 
242  if( viaSelection == wxNOT_FOUND
243  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
244  && m_viaDrill.GetValue() == viaDimension->m_Drill )
245  {
246  viaSelection = ii;
247  }
248  }
249 
250  m_DesignRuleViasCtrl->SetSelection( viaSelection );
251 
253 
254  m_ViaTypeChoice->Enable();
255 
256  switch( viaType )
257  {
258  case VIATYPE::THROUGH:
259  m_ViaTypeChoice->SetSelection( 0 );
260  break;
261  case VIATYPE::MICROVIA:
262  m_ViaTypeChoice->SetSelection( 1 );
263  break;
265  m_ViaTypeChoice->SetSelection( 2 );
266  break;
268  m_ViaTypeChoice->SetSelection( wxNOT_FOUND );
269  break;
270  }
271 
272  m_ViaStartLayer->Enable( viaType != VIATYPE::THROUGH );
273  m_ViaEndLayer->Enable( viaType != VIATYPE::THROUGH );
274  }
275  else
276  {
277  m_MainSizer->Hide( m_sbViaSizer, true );
278  }
279 
280  if( m_tracks )
281  {
283 
284  int widthSelection = wxNOT_FOUND;
285 
286  // 0 is the netclass place-holder
287  for( unsigned ii = 1; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
288  {
289  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
290  wxString msg = StringFromValue( m_units, width, false );
291  m_DesignRuleWidthsCtrl->Append( msg );
292 
293  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
294  widthSelection = ii;
295  }
296 
297  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
298 
300  }
301  else
302  {
303  m_MainSizer->Hide( m_sbTrackSizer, true );
304  }
305 
306  if( hasLocked && hasUnlocked )
307  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
308  else if( hasLocked )
309  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
310  else
311  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
312 
314 
315  m_StdButtonsOK->SetDefault();
316 
317  // Now all widgets have the size fixed, call FinishDialogSettings
319 }
320 
321 
322 bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<PAD*>& changingPads )
323 {
324  wxString msg;
325 
326  if( changingPads.size() == 1 )
327  {
328  PAD* pad = *changingPads.begin();
329  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
330  "Do you wish to continue?" ),
331  pad->GetParent()->GetReference(),
332  pad->GetName(),
333  m_netSelector->GetValue() );
334  }
335  else if( changingPads.size() == 2 )
336  {
337  PAD* pad1 = *changingPads.begin();
338  PAD* pad2 = *( ++changingPads.begin() );
339  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
340  "Do you wish to continue?" ),
341  pad1->GetParent()->GetReference(),
342  pad1->GetName(),
343  pad2->GetParent()->GetReference(),
344  pad2->GetName(),
345  m_netSelector->GetValue() );
346  }
347  else
348  {
349  msg.Printf( _( "This will change the net assigned to %lu connected pads to %s.\n"
350  "Do you wish to continue?" ),
351  static_cast<unsigned long>( changingPads.size() ),
352  m_netSelector->GetValue() );
353  }
354 
355  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
356  dlg.SetOKLabel( _( "Continue" ) );
357  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
358 
359  return dlg.ShowModal() == wxID_OK;
360 }
361 
362 
364 {
365  auto connectivity = m_frame->GetBoard()->GetConnectivity();
366  int newNetCode = m_netSelector->GetSelectedNetcode();
367  std::vector<PAD*> changingPads;
368 
369  if ( !m_netSelector->IsIndeterminate() )
370  {
371  std::set<PAD*> connectedPads;
372 
373  for( EDA_ITEM* item : m_items )
374  {
375  const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_FOOTPRINT_T, EOT };
376  auto connectedItems = connectivity->GetConnectedItems( static_cast<BOARD_CONNECTED_ITEM*>( item ), ourTypes, true );
377 
378  for ( BOARD_CONNECTED_ITEM* citem : connectedItems )
379  {
380  if( citem->Type() == PCB_PAD_T )
381  connectedPads.insert( static_cast<PAD*>( citem ) );
382  }
383  }
384 
385  for( PAD* pad : connectedPads )
386  {
387  if( pad->GetNetCode() != newNetCode )
388  changingPads.push_back( pad );
389  }
390  }
391 
392  // Run validations:
393 
394  if( changingPads.size() )
395  {
396  if( !confirmPadChange( changingPads ) )
397  return false;
398  }
399 
400  if( m_vias )
401  {
402  if( !m_viaDiameter.Validate( GEOMETRY_MIN_SIZE, INT_MAX )
403  || !m_viaDrill.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
404  return false;
405 
406  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
407  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
409  {
410  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
411  m_ViaDrillCtrl->SelectAll();
412  m_ViaDrillCtrl->SetFocus();
413  return false;
414  }
415 
418  {
419  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
420  return false;
421  }
422  }
423 
424  if( m_tracks )
425  {
426  if( !m_trackWidth.Validate( GEOMETRY_MIN_SIZE, INT_MAX ) )
427  return false;
428  }
429 
430  // If we survived that, then save the changes:
431 
432  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
433  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
434 
435  for( EDA_ITEM* item : m_items )
436  {
437  m_commit.Modify( item );
438 
439  switch( item->Type() )
440  {
441  case PCB_TRACE_T:
442  case PCB_ARC_T:
443  {
444  wxASSERT( m_tracks );
445  TRACK* t = static_cast<TRACK*>( item );
446 
448  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
449 
451  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
452 
454  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
455 
457  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
458 
459  if( m_trackNetclass->IsChecked() )
460  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
461  else if( !m_trackWidth.IsIndeterminate() )
463 
465 
466  if( layer != UNDEFINED_LAYER )
467  t->SetLayer( (PCB_LAYER_ID) layer );
468 
469  if( changeLock )
470  t->SetLocked( setLock );
471 
472  if ( !m_netSelector->IsIndeterminate() )
474 
475  break;
476  }
477 
478  case PCB_VIA_T:
479  {
480  wxASSERT( m_vias );
481  VIA* v = static_cast<VIA*>( item );
482 
483  if( !m_viaX.IsIndeterminate() )
484  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
485 
486  if( !m_viaY.IsIndeterminate() )
487  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
488 
489  switch( m_ViaTypeChoice->GetSelection() )
490  {
491  case 0:
493  v->SanitizeLayers();
494  break;
495  case 1:
497  break;
498  case 2:
500  break;
501  default:
502  break;
503  }
504 
505  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
506  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
507 
508  if (startLayer != UNDEFINED_LAYER )
509  v->SetTopLayer( startLayer );
510 
511  if (endLayer != UNDEFINED_LAYER )
512  v->SetBottomLayer( endLayer );
513 
514  v->SanitizeLayers();
515 
516  if( m_viaNetclass->IsChecked() )
517  {
518  switch( v->GetViaType() )
519  {
520  default:
521  wxFAIL_MSG("Unhandled via type");
523 
524  case VIATYPE::THROUGH:
526  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
527  v->SetDrill( v->GetNetClass()->GetViaDrill() );
528  break;
529 
530  case VIATYPE::MICROVIA:
531  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
532  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
533  break;
534  }
535  }
536  else
537  {
540 
541  if( !m_viaDrill.IsIndeterminate() )
542  v->SetDrill( m_viaDrill.GetValue() );
543  }
544 
545  if ( !m_netSelector->IsIndeterminate() )
547 
548  if( changeLock )
549  v->SetLocked( setLock );
550 
551  break;
552  }
553 
554  default:
555  wxASSERT( false );
556  break;
557  }
558  }
559 
560  if ( !m_netSelector->IsIndeterminate() )
561  {
562  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
563  // outwards. We therefore have to update the connected pads in order for the net
564  // change to "stick".
565  for( PAD* pad : changingPads )
566  {
567  m_commit.Modify( pad );
568  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
569  }
570  }
571 
572  m_commit.Push( _( "Edit track/via properties" ) );
573 
574  return true;
575 }
576 
577 
579 {
580  bool enableNC = aEvent.IsChecked();
581 
582  m_DesignRuleWidths->Enable( !enableNC );
583  m_DesignRuleWidthsCtrl->Enable( !enableNC );
584  m_DesignRuleWidthsUnits->Enable( !enableNC );
585 
586  m_trackWidth.Enable( !enableNC );
587 }
588 
589 
590 void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect( wxCommandEvent& aEvent )
591 {
592  m_TrackWidthCtrl->ChangeValue( m_DesignRuleWidthsCtrl->GetStringSelection() );
593  m_TrackWidthCtrl->SelectAll();
594 }
595 
596 
597 void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit( wxCommandEvent& aEvent )
598 {
599  m_DesignRuleWidthsCtrl->SetStringSelection( m_TrackWidthCtrl->GetValue() );
600 }
601 
602 
604 {
605  bool enableNC = aEvent.IsChecked();
606 
607  m_DesignRuleVias->Enable( !enableNC );
608  m_DesignRuleViasCtrl->Enable( !enableNC );
609  m_DesignRuleViasUnit->Enable( !enableNC );
610 
611  m_viaDiameter.Enable( !enableNC );
612  m_viaDrill.Enable( !enableNC );
613 }
614 
615 
616 void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
617 {
618  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
619 
620  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
621  m_viaDrill.ChangeValue( viaDimension->m_Drill );
622 }
623 
624 
625 void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
626 {
627  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
628 
629  if( m_vias )
630  {
631  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
632  {
633  m_ViaStartLayer->Enable();
634  m_ViaEndLayer->Enable();
635  }
636  else
637  {
640 
641  m_ViaStartLayer->Enable( false );
642  m_ViaEndLayer->Enable( false );
643  }
644  }
645 }
bool IsLocked() const override
Function IsLocked.
Definition: track.h:136
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:240
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)
Definition: track.h:354
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:54
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: track.h:423
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
Definition: board_item.h:206
This file is part of the common library.
void SetEnd(const wxPoint &aEnd)
Definition: track.h:112
void onWidthSelect(wxCommandEvent &aEvent) override
std::vector< int > m_TrackWidthList
void SetNotAllowedLayerSet(LSET aMask)
const wxPoint & GetStart() const
Definition: track.h:116
void SetBoard(BOARD *aBoard)
virtual NETCLASS * GetNetClass() const
Function GetNetClassPtr returns the NETCLASS for this item.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
Definition: lset.cpp:773
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: board.h:719
class 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:83
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:467
bool IsIndeterminate() const
Function IsIndeterminate Returns true if the control holds the indeterminate value (for instance,...
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
bool confirmPadChange(const std::vector< PAD * > &connectedPads)
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
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
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: track.h:109
LAYER_NUM GetLayerSelection() const
void SetLocked(bool aLocked) override
Function SetLocked modifies 'lock' status for of the item.
Definition: track.h:141
PCB_LAYER_ID
A quick note on layer IDs:
int GetTrackWidth() const
Definition: netclass.h:163
void onWidthEdit(wxCommandEvent &aEvent) override
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: track.cpp:170
void SetSelectedNetcode(int aNetcode)
int GetViaDrill() const
Definition: netclass.h:171
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:382
void onViaSelect(wxCommandEvent &aEvent) override
const wxString & GetName() const
Definition: pad.h:127
#define GEOMETRY_MIN_SIZE
Definition: track.h:80
bool IsIndeterminate()
int SetLayerSelection(LAYER_NUM layer)
int GetuViaDiameter() const
Definition: netclass.h:175
const wxString GetReference() const
Function GetReference.
Definition: footprint.h:433
void SetNetInfo(NETINFO_LIST *aNetInfoList)
bool SetLayersHotkeys(bool value)
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
int LAYER_NUM
This can be replaced with int and removed.
void SetUndefinedLayerName(const wxString &aName)
class FOOTPRINT, a footprint
Definition: typeinfo.h:89
FOOTPRINT * GetParent() const
EDA_UNITS m_units
Definition: dialog_shim.h:190
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void SetIndeterminate()
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true)=0
Executes the changes.
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Function Validate Validates the control against the given range, informing the user of any errors fou...
int GetWidth() const
Definition: track.h:110
#define _(s)
Definition: 3d_actions.cpp:33
void onViaNetclassCheck(wxCommandEvent &aEvent) override
void SetTopLayer(PCB_LAYER_ID aLayer)
Definition: track.cpp:410
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: track.h:485
VIATYPE GetViaType() const
Definition: track.h:384
int GetViaDiameter() const
Definition: netclass.h:167
EDA_ITEM is a base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148
PCB_LAYER_ID TopLayer() const
Definition: track.cpp:444
const wxPoint & GetEnd() const
Definition: 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)
Definition: track.cpp:416
int ShowModal() override
Definition: confirm.cpp:96
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:220
void SetStart(const wxPoint &aStart)
Definition: track.h:115
int GetuViaDrill() const
Definition: netclass.h:179
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:168
BOARD * GetBoard() const
Class DIALOG_TRACK_VIA_PROPERTIES_BASE.
VIATYPE
Definition: track.h:68
Definition: pad.h:59
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
Definition: track.cpp:456
wxPoint GetPosition() const override
Definition: track.h:422
#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: track.h:385
PCB_LAYER_ID BottomLayer() const
Definition: track.cpp:450
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
Definition: board_item.h:185
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.
Definition: track.h:83
virtual void ChangeValue(int aValue)
Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units c...