KiCad PCB EDA Suite
dialog_drc.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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2009-2016 Dick Hollenbeck, dick@softplc.com
6  * Copyright (C) 2004-2020 KiCad Developers, see AUTHORS.txt for contributors.
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 
26 #include <base_units.h>
27 #include <bitmaps.h>
28 #include <collectors.h>
29 #include <confirm.h>
30 #include <dialog_drc.h>
31 #include <fctsys.h>
32 #include <kiface_i.h>
33 #include <pcb_edit_frame.h>
34 #include <pcbnew_settings.h>
35 #include <pgm_base.h>
36 #include <tool/tool_manager.h>
37 #include <tools/pcb_actions.h>
39 #include <rc_item.h>
40 #include <wx/wupdlock.h>
41 #include <widgets/ui_common.h>
42 #include <pcb_layer_widget.h>
43 
44 
45 DIALOG_DRC::DIALOG_DRC( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent ) :
46  DIALOG_DRC_BASE( aParent ),
47  m_trackMinWidth( aEditorFrame, m_MinWidthLabel, m_MinWidthCtrl, m_MinWidthUnits, true ),
48  m_viaMinSize( aEditorFrame, m_ViaMinLabel, m_ViaMinCtrl, m_ViaMinUnits, true ),
49  m_uviaMinSize( aEditorFrame, m_uViaMinLabel, m_uViaMinCtrl, m_uViaMinUnits, true ),
50  m_markersProvider( nullptr ),
51  m_markerTreeModel( nullptr ),
52  m_unconnectedItemsProvider( nullptr ),
53  m_unconnectedTreeModel( nullptr ),
54  m_footprintWarningsProvider( nullptr ),
55  m_footprintWarningsTreeModel( nullptr ),
57 {
58  SetName( DIALOG_DRC_WINDOW_NAME ); // Set a window name to be able to find it
59 
60  m_tester = aTester;
61  m_brdEditor = aEditorFrame;
63 
65  m_markerDataView->AssociateModel( m_markerTreeModel );
66 
69 
72 
73  m_Notebook->SetSelection( 0 );
74 
75  // We use a sdbSizer here to get the order right, which is platform-dependent
76  m_sdbSizer1OK->SetLabel( _( "Run DRC" ) );
77  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
78  m_sizerButtons->Layout();
79 
80  m_sdbSizer1OK->SetDefault();
81 
82  initValues();
84 
86 }
87 
88 
90 {
91  m_brdEditor->FocusOnItem( nullptr );
92 
94  settings->m_DrcDialog.refill_zones = m_cbRefillZones->GetValue();
96  settings->m_DrcDialog.test_footprints = m_cbTestFootprints->GetValue();
98 
99  m_markerTreeModel->DecRef();
100 }
101 
102 
103 void DIALOG_DRC::OnActivateDlg( wxActivateEvent& aEvent )
104 {
106  {
107  // If m_currentBoard is not the current parent board,
108  // (for instance because a new board was loaded),
109  // close the dialog, because many pointers are now invalid
110  // in lists
111  SetReturnCode( wxID_CANCEL );
112  Close();
113  m_tester->DestroyDRCDialog( wxID_CANCEL );
114  return;
115  }
116 
117  // updating data which can be modified outside the dialog (DRC parameters, units ...)
118  // because the dialog is not modal
120 
125 }
126 
127 
129 {
130  m_trackMinWidth.SetValue( bds().m_TrackMinWidth );
131  m_viaMinSize.SetValue( bds().m_ViasMinSize );
132  m_uviaMinSize.SetValue( bds().m_MicroViasMinSize );
133 }
134 
135 
137 {
138  m_markersTitleTemplate = m_Notebook->GetPageText( 0 );
139  m_unconnectedTitleTemplate = m_Notebook->GetPageText( 1 );
140  m_footprintsTitleTemplate = m_Notebook->GetPageText( 2 );
141 
143 
144  auto cfg = m_brdEditor->GetPcbNewSettings();
145 
146  m_cbRefillZones->SetValue( cfg->m_DrcDialog.refill_zones );
147  m_cbReportAllTrackErrors->SetValue( cfg->m_DrcDialog.test_track_to_zone );
148  m_cbTestFootprints->SetValue( cfg->m_DrcDialog.test_footprints );
149 
150  m_severities = cfg->m_DrcDialog.severities;
154 
155  Layout(); // adding the units above expanded Clearance text, now resize.
156 
157  SetFocus();
158 }
159 
160 
162 {
166 }
167 
168 
169 // Don't globally define this; different facilities use different definitions of "ALL"
171 
172 
174 {
175  m_showAll->SetValue( m_severities == RPT_SEVERITY_ALL );
179 }
180 
181 
182 void DIALOG_DRC::OnRunDRCClick( wxCommandEvent& aEvent )
183 {
186  m_tester->m_refillZones = m_cbRefillZones->GetValue();
189 
192 
193  wxBeginBusyCursor();
194  wxWindowDisabler disabler;
195 
196  // run all the tests, with no UI at this time.
197  m_Messages->Clear();
198  wxSafeYield(); // Allows time slice to refresh the Messages
200 
201  m_Notebook->ChangeSelection( 0 ); // display the "Problems/Markers" tab
202 
203  wxEndBusyCursor();
204 
206 
207  wxSafeYield();
208  Raise();
209  m_Notebook->GetPage( m_Notebook->GetSelection() )->SetFocus();
210 }
211 
212 
214 {
215  m_markersProvider = aProvider;
218 }
219 
220 
222 {
223  m_unconnectedItemsProvider = aProvider;
226 }
227 
228 
230 {
231  m_footprintWarningsProvider = aProvider;
234 }
235 
236 
237 void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent )
238 {
239  const KIID& itemID = RC_TREE_MODEL::ToUUID( aEvent.GetItem() );
240  BOARD_ITEM* item = m_brdEditor->GetBoard()->GetItem( itemID );
241  LSET visibleLayers = m_brdEditor->GetBoard()->GetVisibleLayers();
242  WINDOW_THAWER thawer( m_brdEditor );
243 
244  if( item && ( item->GetLayerSet() & visibleLayers ) == 0 )
245  {
246  if( IsOK( this, wxString::Format( _( "Item not currently visible.\nShow the '%s' layer?" ),
247  item->GetLayerName() ) ) )
248  {
249  m_brdEditor->GetLayerManager()->SetLayerVisible( item->GetLayer(), true );
250  }
251  }
252 
253  m_brdEditor->FocusOnItem( item );
255 
256  aEvent.Skip();
257 }
258 
259 
260 void DIALOG_DRC::OnDRCItemDClick( wxDataViewEvent& aEvent )
261 {
262  if( aEvent.GetItem().IsOk() )
263  {
264  // turn control over to m_brdEditor, hide this DIALOG_DRC window,
265  // no destruction so we can preserve listbox cursor
266  if( !IsModal() )
267  Show( false );
268  }
269 
270  aEvent.Skip();
271 }
272 
273 
274 void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
275 {
276  RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() );
277 
278  if( !node )
279  return;
280 
281  RC_ITEM* rcItem = node->m_RcItem;
282  wxString listName;
283  wxMenu menu;
284  wxString msg;
285 
286  switch( bds().m_DRCSeverities[ rcItem->GetErrorCode() ] )
287  {
288  case RPT_SEVERITY_ERROR: listName = _( "errors" ); break;
289  case RPT_SEVERITY_WARNING: listName = _( "warnings" ); break;
290  default: listName = _( "appropriate" ); break;
291  }
292 
293  if( rcItem->GetParent()->IsExcluded() )
294  {
295  menu.Append( 1, _( "Remove exclusion for this violation" ),
296  wxString::Format( _( "It will be placed back in the %s list" ), listName ) );
297  }
298  else
299  {
300  menu.Append( 2, _( "Exclude this violation" ),
301  wxString::Format( _( "It will be excluded from the %s list" ), listName ) );
302  }
303 
304  menu.AppendSeparator();
305 
306  if( bds().m_DRCSeverities[ rcItem->GetErrorCode() ] == RPT_SEVERITY_WARNING )
307  {
308  msg.Printf( _( "Change severity to Error for all '%s' violations" ),
309  rcItem->GetErrorText(),
310  _( "Violation severities can also be edited in the Board Setup... dialog" ) );
311  menu.Append( 3, msg );
312  }
313  else
314  {
315  msg.Printf( _( "Change severity to Warning for all '%s' violations" ),
316  rcItem->GetErrorText(),
317  _( "Violation severities can also be edited in the Board Setup... dialog" ) );
318  menu.Append( 4, msg );
319  }
320 
321  msg.Printf( _( "Ignore all '%s' violations" ),
322  rcItem->GetErrorText(),
323  _( "Violations will not be checked or reported" ) );
324  menu.Append( 5, msg );
325 
326  menu.AppendSeparator();
327 
328  menu.Append( 6, _( "Edit violation severities..." ), _( "Open the Board Setup... dialog" ) );
329 
330  bool modified = false;
331 
332  switch( GetPopupMenuSelectionFromUser( menu ) )
333  {
334  case 1:
335  node->m_RcItem->GetParent()->SetExcluded( false );
336 
337  // Update view
338  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
339  modified = true;
340  break;
341 
342  case 2:
343  node->m_RcItem->GetParent()->SetExcluded( true );
344 
345  // Update view
347  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
348  else
349  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->DeleteCurrentItem( false );
350 
351  modified = true;
352  break;
353 
354  case 3:
356 
357  // Rebuild model and view
358  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markersProvider );
359  modified = true;
360  break;
361 
362  case 4:
364 
365  // Rebuild model and view
366  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markersProvider );
367  modified = true;
368  break;
369 
370  case 5:
371  {
373 
374  std::vector<MARKER_PCB*>& markers = m_brdEditor->GetBoard()->Markers();
376 
377  for( unsigned i = 0; i < markers.size(); )
378  {
379  if( markers[i]->GetRCItem()->GetErrorCode() == rcItem->GetErrorCode() )
380  {
381  view->Remove( markers.at( i ) );
382  markers.erase( markers.begin() + i );
383  }
384  else
385  ++i;
386  }
387 
388  // Rebuild model and view
389  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markersProvider );
390  modified = true;
391  }
392  break;
393 
394  case 6:
395  m_brdEditor->ShowBoardSetupDialog( _( "Violation Severity" ) );
396  break;
397  }
398 
399  if( modified )
400  {
404  }
405 }
406 
407 
408 void DIALOG_DRC::OnSeverity( wxCommandEvent& aEvent )
409 {
410  int flag = 0;
411 
412  if( aEvent.GetEventObject() == m_showAll )
413  flag = RPT_SEVERITY_ALL;
414  else if( aEvent.GetEventObject() == m_showErrors )
415  flag = RPT_SEVERITY_ERROR;
416  else if( aEvent.GetEventObject() == m_showWarnings )
417  flag = RPT_SEVERITY_WARNING;
418  else if( aEvent.GetEventObject() == m_showExclusions )
419  flag = RPT_SEVERITY_EXCLUSION;
420 
421  if( aEvent.IsChecked() )
422  m_severities |= flag;
423  else if( aEvent.GetEventObject() == m_showAll )
425  else
426  m_severities &= ~flag;
427 
428  syncCheckboxes();
429 
430  // Set the provider's severity levels through the TreeModel so that the old tree
431  // can be torn down before the severity changes.
432  //
433  // It's not clear this is required, but we've had a lot of issues with wxDataView
434  // being cranky on various platforms.
435 
439 
441 }
442 
443 
444 void DIALOG_DRC::OnSaveReport( wxCommandEvent& aEvent )
445 {
446  wxFileName fn( "./DRC." + ReportFileExtension );
447 
448  wxFileDialog dlg( this, _( "Save Report to File" ), fn.GetPath(), fn.GetFullName(),
449  ReportFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
450 
451  if( dlg.ShowModal() != wxID_OK )
452  return;
453 
454  fn = dlg.GetPath();
455 
456  if( fn.GetExt().IsEmpty() )
457  fn.SetExt( ReportFileExtension );
458 
459  if( !fn.IsAbsolute() )
460  {
461  wxString prj_path = Prj().GetProjectPath();
462  fn.MakeAbsolute( prj_path );
463  }
464 
465  if( writeReport( fn.GetFullPath() ) )
466  {
467  m_Messages->AppendText( wxString::Format( _( "Report file '%s' created\n" ),
468  fn.GetFullPath() ) );
469  }
470  else
471  {
472  DisplayError( this, wxString::Format( _( "Unable to create report file '%s'" ),
473  fn.GetFullPath() ) );
474  }
475 }
476 
477 
478 void DIALOG_DRC::OnCancelClick( wxCommandEvent& aEvent )
479 {
480  m_brdEditor->FocusOnItem( nullptr );
481 
482  SetReturnCode( wxID_CANCEL );
484 
485  // The dialog can be modal or not modal.
486  // Leave the DRC caller destroy (or not) the dialog
487  m_tester->DestroyDRCDialog( wxID_CANCEL );
488 }
489 
490 
491 void DIALOG_DRC::OnChangingNotebookPage( wxNotebookEvent& aEvent )
492 {
493  // Shouldn't be necessary, but is on at least OSX
494  if( aEvent.GetSelection() >= 0 )
495  m_Notebook->ChangeSelection( (unsigned) aEvent.GetSelection() );
496 
497  m_markerDataView->UnselectAll();
498  m_unconnectedDataView->UnselectAll();
499  m_footprintsDataView->UnselectAll();
500 }
501 
502 
504 {
505  WINDOW_THAWER thawer( m_brdEditor );
506 
508 }
509 
510 
512 {
513  // Clear current selection list to avoid selection of deleted items
515 
518 }
519 
520 
521 bool DIALOG_DRC::writeReport( const wxString& aFullFileName )
522 {
523  FILE* fp = wxFopen( aFullFileName, wxT( "w" ) );
524 
525  if( fp == NULL )
526  return false;
527 
528  std::map<KIID, EDA_ITEM*> itemMap;
529  m_brdEditor->GetBoard()->FillItemMap( itemMap );
530 
531  int count;
532  EDA_UNITS units = GetUserUnits();
533 
534  fprintf( fp, "** Drc report for %s **\n", TO_UTF8( m_brdEditor->GetBoard()->GetFileName() ) );
535 
536  wxDateTime now = wxDateTime::Now();
537 
538  fprintf( fp, "** Created on %s **\n", TO_UTF8( now.Format( wxT( "%F %T" ) ) ) );
539 
540  count = m_markersProvider->GetCount();
541 
542  fprintf( fp, "\n** Found %d DRC violations **\n", count );
543 
544  for( int i = 0; i < count; ++i )
545  fprintf( fp, "%s", TO_UTF8( m_markersProvider->GetItem( i )->ShowReport( units, itemMap ) ) );
546 
548 
549  fprintf( fp, "\n** Found %d unconnected pads **\n", count );
550 
551  for( int i = 0; i < count; ++i )
552  fprintf( fp, "%s", TO_UTF8( m_unconnectedItemsProvider->GetItem( i )->ShowReport( units, itemMap ) ) );
553 
555 
556  fprintf( fp, "\n** Found %d Footprint errors **\n", count );
557 
558  for( int i = 0; i < count; ++i )
559  fprintf( fp, "%s", TO_UTF8( m_footprintWarningsProvider->GetItem( i )->ShowReport( units, itemMap ) ) );
560 
561 
562  fprintf( fp, "\n** End of Report **\n" );
563 
564  fclose( fp );
565 
566  return true;
567 }
568 
569 
570 void DIALOG_DRC::OnDeleteOneClick( wxCommandEvent& aEvent )
571 {
572  if( m_Notebook->GetSelection() == 0 )
573  {
574  // Clear the selection. It may be the selected DRC marker.
576 
578 
579  // redraw the pcb
581  }
582  else if( m_Notebook->GetSelection() == 1 )
583  {
585  }
586  else if( m_Notebook->GetSelection() == 2 )
587  {
589  }
590 
592 }
593 
594 
595 void DIALOG_DRC::OnDeleteAllClick( wxCommandEvent& aEvent )
596 {
598 
601 }
602 
603 
605 {
606  wxString msg;
607 
608  // First the tab headers:
609  //
610 
611  if( m_tester->m_drcRun )
612  {
614  m_Notebook->SetPageText( 0, msg );
615 
617  m_Notebook->SetPageText( 1, msg );
618 
621  else
622  {
624  msg.Replace( wxT( "%d" ), _( "not run" ) );
625  }
626  m_Notebook->SetPageText( 2, msg );
627  }
628  else
629  {
631  msg.Replace( wxT( "(%d)" ), wxEmptyString );
632  m_Notebook->SetPageText( 0, msg );
633 
635  msg.Replace( wxT( "(%d)" ), wxEmptyString );
636  m_Notebook->SetPageText( 1, msg );
637 
639  msg.Replace( wxT( "(%d)" ), wxEmptyString );
640  m_Notebook->SetPageText( 2, msg );
641  }
642 
643  // And now the badges:
644  //
645 
646  int numErrors = 0;
647  int numWarnings = 0;
648  int numExcluded = 0;
649 
650  if( m_markersProvider )
651  {
655  }
656 
658  {
662  }
663 
665  {
669  }
670 
671  m_errorsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_ERROR, numErrors, m_errorsBadge ) );
672  m_warningsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_WARNING, numWarnings, m_warningsBadge ) );
674 }
DIALOG_DRC(DRC *aTester, PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
Definition: dialog_drc.cpp:45
bool m_refillZones
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:62
wxCheckBox * m_showWarnings
void initValues()
Definition: dialog_drc.cpp:136
EDA_UNITS
Definition: common.h:198
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
UNIT_BINDER m_trackMinWidth
Definition: dialog_drc.h:105
void syncCheckboxes()
Definition: dialog_drc.cpp:173
wxCheckBox * m_cbTestFootprints
void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:284
wxButton * m_sdbSizer1Cancel
wxNotebook * m_Notebook
void DestroyDRCDialog(int aReason)
Deletes this ui dialog box and zeros out its pointer to remember the state of the dialog's existence.
void updateDisplayedCounts()
Definition: dialog_drc.cpp:604
BOARD_DESIGN_SETTINGS & bds()
Definition: dialog_drc.h:95
static int RPT_SEVERITY_ALL
Definition: dialog_drc.cpp:170
void OnDRCItemRClick(wxDataViewEvent &aEvent) override
Definition: dialog_drc.cpp:274
void SetProvider(RC_ITEMS_PROVIDER *aProvider)
Definition: rc_item.cpp:206
wxCheckBox * m_cbReportAllTrackErrors
Implementation of conversion functions that require both schematic and board internal units.
This file is part of the common library.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
RC_TREE_MODEL * m_markerTreeModel
Definition: dialog_drc.h:110
Class DIALOG_DRC_BASE.
std::map< int, int > m_DRCSeverities
RC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.
Definition: rc_item.h:77
void displayDRCValues()
Definition: dialog_drc.cpp:128
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:99
MARKERS & Markers()
Definition: class_board.h:285
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
bool writeReport(const wxString &aFullFileName)
Function writeReport outputs the MARKER items and unconnecte DRC_ITEMs with commentary to an open tex...
Definition: dialog_drc.cpp:521
void refreshBoardEditor()
Definition: dialog_drc.cpp:503
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:376
void OnDeleteOneClick(wxCommandEvent &aEvent) override
Definition: dialog_drc.cpp:570
wxString m_footprintsTitleTemplate
Definition: dialog_drc.h:103
LSET GetVisibleLayers() const
Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
UNIT_BINDER m_viaMinSize
Definition: dialog_drc.h:106
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:140
virtual int GetCount(int aSeverity=-1)=0
static KIID ToUUID(wxDataViewItem aItem)
Definition: rc_item.cpp:91
wxStaticBitmap * m_errorsBadge
RC_ITEMS_PROVIDER * m_markersProvider
Definition: dialog_drc.h:109
PCBNEW_SETTINGS * GetPcbNewSettings()
void OnDRCItemDClick(wxDataViewEvent &aEvent) override
Definition: dialog_drc.cpp:260
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
wxButton * m_sdbSizer1OK
const wxString & GetFileName() const
Definition: class_board.h:255
BOARD_ITEM * GetItem(const KIID &aID)
BOARD * m_currentBoard
Definition: dialog_drc.h:97
virtual RC_ITEM * GetItem(int aIndex)=0
Function GetItem retrieves a RC_ITEM by index.
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:122
void DeleteCurrentItem(bool aDeep)
Definition: rc_item.cpp:367
void SetSeverities(int aSeverities)
Definition: rc_item.cpp:212
Provide an abstract interface of a RC_ITEM* list manager.
Definition: rc_item.h:42
wxString GetErrorText() const
Definition: rc_item.h:169
void OnChangingNotebookPage(wxNotebookEvent &aEvent) override
Definition: dialog_drc.cpp:491
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:131
RC_ITEMS_PROVIDER * m_unconnectedItemsProvider
Definition: dialog_drc.h:112
DRC * m_tester
Definition: dialog_drc.h:98
wxCheckBox * m_showExclusions
Definition: common.h:68
wxString m_markersTitleTemplate
Definition: dialog_drc.h:101
int GetDRCItemCount() const
Definition: rc_item.h:236
bool m_testFootprints
wxCheckBox * m_cbRefillZones
virtual wxString ShowReport(EDA_UNITS aUnits, const std::map< KIID, EDA_ITEM * > &aItemMap) const
Function ShowReport translates this object into a text string suitable for saving to disk in a report...
Definition: rc_item.cpp:53
LSET is a set of PCB_LAYER_IDs.
wxStaticBitmap * m_warningsBadge
void SetExcluded(bool aExcluded)
Definition: marker_base.h:109
wxDataViewCtrl * m_footprintsDataView
#define NULL
RC_ITEMS_PROVIDER * m_footprintWarningsProvider
Definition: dialog_drc.h:115
wxBoxSizer * m_sizerButtons
void OnDeleteAllClick(wxCommandEvent &aEvent) override
Definition: dialog_drc.cpp:595
static RC_TREE_NODE * ToNode(wxDataViewItem aItem)
Definition: rc_item.h:220
wxString ReportFileWildcard()
EDA_BASE_FRAME * m_parentFrame
Definition: dialog_shim.h:211
void OnDRCItemSelected(wxDataViewEvent &aEvent) override
Definition: dialog_drc.cpp:237
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
RC_TREE_MODEL * m_footprintWarningsTreeModel
Definition: dialog_drc.h:116
int GetErrorCode() const
Definition: rc_item.h:160
void SetFootprintsProvider(RC_ITEMS_PROVIDER *aProvider)
Definition: dialog_drc.cpp:229
Definition of file extensions used in Kicad.
#define DIALOG_DRC_WINDOW_NAME
Definition: dialog_drc.h:44
Functions to provide common constants and other functions to assist in making a consistent UI.
void deleteAllMarkers()
Definition: dialog_drc.cpp:511
bool IsExcluded() const
Definition: marker_base.h:108
PCB_LAYER_WIDGET * GetLayerManager()
bool m_reportAllTrackErrors
bool m_drcRun
void OnRunDRCClick(wxCommandEvent &aEvent) override
Definition: dialog_drc.cpp:182
void SyncToolbars() override
Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state.
bool Show(bool show) override
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
RC_TREE_MODEL * m_unconnectedTreeModel
Definition: dialog_drc.h:113
wxDataViewCtrl * m_unconnectedDataView
bool m_testTracksAgainstZones
bool m_footprintsTested
void OnCancelClick(wxCommandEvent &aEvent) override
Definition: dialog_drc.cpp:478
void DeleteAllItems()
Definition: rc_item.cpp:406
void SetMarkersProvider(RC_ITEMS_PROVIDER *aProvider)
Definition: dialog_drc.cpp:213
RC_ITEM * m_RcItem
Definition: rc_item.h:205
wxDataViewCtrl * m_markerDataView
UNIT_BINDER m_uviaMinSize
Definition: dialog_drc.h:107
see class PGM_BASE
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
const std::string ReportFileExtension
wxBitmap MakeBadge(SEVERITY aStyle, int aCount, wxWindow *aWindow, int aDepth)
Definition: ui_common.cpp:36
#define _(s)
Definition: 3d_actions.cpp:33
wxStaticBitmap * m_exclusionsBadge
wxCheckBox * m_showErrors
Design Rule Checker object that performs all the DRC tests.
wxCheckBox * m_cbReportTracksToZonesErrors
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
wxCheckBox * m_showAll
PCB_EDIT_FRAME is the main frame for Pcbnew.
#define TO_UTF8(wxstring)
void OnActivateDlg(wxActivateEvent &aEvent) override
handler for activate event, updating data which can be modified outside the dialog (DRC parameters)
Definition: dialog_drc.cpp:103
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
MARKER_BASE * GetParent() const
Definition: rc_item.h:149
int m_severities
Definition: dialog_drc.h:118
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74
DIALOG_DRC m_DrcDialog
void SetLayerVisible(LAYER_NUM aLayer, bool isVisible)
Function SetLayerVisible sets aLayer visible or not.
BOARD * GetBoard() const
void setDRCParameters()
Definition: dialog_drc.cpp:161
VIEW.
Definition: view.h:61
void RunTests(wxTextCtrl *aMessages=NULL)
Run all the tests specified with a previous call to SetSettings()
void OnSaveReport(wxCommandEvent &aEvent) override
Definition: dialog_drc.cpp:444
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:283
void FocusOnItem(BOARD_ITEM *aItem)
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString, const wxString &aErrorMsg=wxEmptyString, int aErrorCtrlId=-1, int aErrorLine=-1, int aErrorCol=-1)
Function ShowBoardSetupDialog.
void SetUnconnectedProvider(RC_ITEMS_PROVIDER *aProvider)
Definition: dialog_drc.cpp:221
wxTextCtrl * m_Messages
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:102
void OnSeverity(wxCommandEvent &aEvent) override
Definition: dialog_drc.cpp:408