KiCad PCB EDA Suite
dialog_drc.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
9  * Copyright (C) 2009-2016 Dick Hollenbeck, dick@softplc.com
10  * Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, you may find one here:
24  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
25  * or you may search the http://www.gnu.org website for the version 2 license,
26  * or you may write to the Free Software Foundation, Inc.,
27  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28  */
29 
30 #include <fctsys.h>
31 #include <kiface_i.h>
32 #include <confirm.h>
34 #include <pgm_base.h>
35 #include <dialog_drc.h>
36 #include <wxPcbStruct.h>
37 #include <base_units.h>
39 #include <class_draw_panel_gal.h>
40 #include <view/view.h>
41 
42 /* class DIALOG_DRC_CONTROL: a dialog to set DRC parameters (clearance, min cooper size)
43  * and run DRC tests
44  */
45 
46 // Keywords for read and write config
47 #define TestMissingCourtyardKey wxT( "TestMissingCourtyard" )
48 #define TestFootprintCourtyardKey wxT( "TestFootprintCourtyard" )
49 
50 
52  wxWindow* aParent ) :
53  DIALOG_DRC_CONTROL_BASE( aParent )
54 {
56  m_tester = aTester;
57  m_brdEditor = aEditorFrame;
60 
61  InitValues();
62 
63  // Now all widgets have the size fixed, call FinishDialogSettings
65 }
66 
68 {
71 }
72 
73 void DIALOG_DRC_CONTROL::OnActivateDlg( wxActivateEvent& event )
74 {
76  {
77  // If m_currentBoard is not the current parent board,
78  // (for instance because a new board was loaded),
79  // close the dialog, because many pointers are now invalid
80  // in lists
81  SetReturnCode( wxID_CANCEL );
82  Close();
83  m_tester->DestroyDRCDialog( wxID_CANCEL );
84  return;
85  }
86 
87  // updating data which can be modified outside the dialog (DRC parameters, units ...)
88  // because the dialog is not modal
91 }
92 
93 
95 {
99 
103 }
104 
105 
107 {
108  // Connect events and objects
109  m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK,
110  wxMouseEventHandler(
112  m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_RIGHT_UP,
113  wxMouseEventHandler(
115  m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK,
116  wxMouseEventHandler( DIALOG_DRC_CONTROL::
117  OnLeftDClickUnconnected ), NULL, this );
118  m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP,
119  wxMouseEventHandler(
121 
122  m_DeleteCurrentMarkerButton->Enable( false );
123 
125 
126  // read options
127  bool value;
128  m_config->Read( TestMissingCourtyardKey, &value, false );
129  m_cbCourtyardMissing->SetValue( value );
130  m_config->Read( TestFootprintCourtyardKey, &value, false );
131  m_cbCourtyardOverlap->SetValue( value );
132 
133 
134  // Set the initial "enabled" status of the browse button and the text
135  // field for report name
136  wxCommandEvent junk;
137  OnReportCheckBoxClicked( junk );
138 
139  Layout(); // adding the units above expanded Clearance text, now resize.
140 
141  SetFocus();
142 }
143 
144 /* accept DRC parameters (min clearance value and min sizes
145 */
147 {
151 
153 }
154 
155 
156 void DIALOG_DRC_CONTROL::SetRptSettings( bool aEnable, const wxString& aFileName )
157 {
158  m_RptFilenameCtrl->Enable( aEnable );
159  m_BrowseButton->Enable( aEnable );
160  m_CreateRptCtrl->SetValue( aEnable );
161  m_RptFilenameCtrl->SetValue( aFileName );
162 }
163 
164 void DIALOG_DRC_CONTROL::GetRptSettings( bool* aEnable, wxString& aFileName )
165 {
166  *aEnable = m_CreateRptCtrl->GetValue();
167  aFileName = m_RptFilenameCtrl->GetValue();
168 }
169 
170 void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
171 {
172  wxString reportName;
173 
174  bool make_report = m_CreateRptCtrl->IsChecked();
175 
176  if( make_report ) // Create a rpt file
177  {
178  reportName = m_RptFilenameCtrl->GetValue();
179 
180  if( reportName.IsEmpty() )
181  {
182  wxCommandEvent dummy;
184  }
185 
186  if( !reportName.IsEmpty() )
187  reportName = makeValidFileNameReport();
188  }
189 
190  SetDrcParmeters();
191  m_tester->SetSettings( true, // Pad to pad DRC test enabled
192  true, // unconnected pads DRC test enabled
193  true, // DRC test for zones enabled
194  true, // DRC test for keepout areas enabled
195  m_cbCourtyardOverlap->GetValue(),
196  m_cbCourtyardMissing->GetValue(),
197  reportName, make_report );
198 
199  DelDRCMarkers();
200 
201  wxBeginBusyCursor();
202 
203  // run all the tests, with no UI at this time.
204  m_Messages->Clear();
205  wxSafeYield(); // Allows time slice to refresh the m_Messages window
206  m_brdEditor->GetBoard()->m_Status_Pcb = 0; // Force full connectivity and ratsnest recalculations
208  m_Notebook->ChangeSelection( 0 ); // display the 1at tab "...Markers ..."
209 
210 
211  // Generate the report
212  if( !reportName.IsEmpty() )
213  {
214  if( writeReport( reportName ) )
215  {
216  wxString msg;
217  msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
218 
219  wxString caption( _( "Disk File Report Completed" ) );
220  wxMessageDialog popupWindow( this, msg, caption );
221  popupWindow.ShowModal();
222  }
223  else
224  DisplayError( this, wxString::Format( _( "Unable to create report file '%s' "),
225  GetChars( reportName ) ) );
226  }
227 
228  wxEndBusyCursor();
229 
230  RedrawDrawPanel();
231 }
232 
233 
234 void DIALOG_DRC_CONTROL::OnDeleteAllClick( wxCommandEvent& event )
235 {
236  DelDRCMarkers();
237  RedrawDrawPanel();
239 }
240 
241 
242 void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
243 {
244  wxString reportName;
245 
246  bool make_report = m_CreateRptCtrl->IsChecked();
247 
248  if( make_report ) // Create a file rpt
249  {
250  reportName = m_RptFilenameCtrl->GetValue();
251 
252  if( reportName.IsEmpty() )
253  {
254  wxCommandEvent junk;
256  }
257 
258  if( !reportName.IsEmpty() )
259  reportName = makeValidFileNameReport();
260  }
261 
262  SetDrcParmeters();
263 
264  m_tester->SetSettings( true, // Pad to pad DRC test enabled
265  true, // unconnected pads DRC test enabled
266  true, // DRC test for zones enabled
267  true, // DRC test for keepout areas enabled
268  m_cbCourtyardOverlap->GetValue(),
269  m_cbCourtyardMissing->GetValue(),
270  reportName, make_report );
271 
272  DelDRCMarkers();
273 
274  wxBeginBusyCursor();
275 
276  m_Messages->Clear();
278 
279  m_Notebook->ChangeSelection( 1 ); // display the 2nd tab "Unconnected..."
280 
281  // Generate the report
282  if( !reportName.IsEmpty() )
283  {
284  if( writeReport( reportName ) )
285  {
286  wxString msg;
287  msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
288  wxString caption( _( "Disk File Report Completed" ) );
289  wxMessageDialog popupWindow( this, msg, caption );
290  popupWindow.ShowModal();
291  }
292  else
293  DisplayError( this, wxString::Format( _( "Unable to create report file '%s' "),
294  GetChars( reportName ) ) );
295  }
296 
298 
299  wxEndBusyCursor();
300 
301  /* there is currently nothing visible on the DrawPanel for unconnected pads
302  * RedrawDrawPanel();
303  */
304 }
305 
306 
308 {
309  wxFileName fn = m_brdEditor->GetBoard()->GetFileName();
310  fn.SetExt( ReportFileExtension );
311  wxString prj_path = Prj().GetProjectPath();
312 
313  wxFileDialog dlg( this, _( "Save DRC Report File" ), prj_path,
314  fn.GetFullName(), ReportFileWildcard,
315  wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
316 
317  if( dlg.ShowModal() == wxID_CANCEL )
318  return;
319 
320  m_RptFilenameCtrl->SetValue( dlg.GetPath() );
321 }
322 
323 
324 void DIALOG_DRC_CONTROL::OnOkClick( wxCommandEvent& event )
325 {
326  SetReturnCode( wxID_OK );
327  SetDrcParmeters();
328 
329  // The dialog can be modal or not modal.
330  // Leave the DRC caller destroy (or not) the dialog
331  m_tester->DestroyDRCDialog( wxID_OK );
332 }
333 
334 
335 void DIALOG_DRC_CONTROL::OnCancelClick( wxCommandEvent& event )
336 {
337  SetReturnCode( wxID_CANCEL );
338 
339  // The dialog can be modal or not modal.
340  // Leave the DRC caller destroy (or not) the dialog
341  m_tester->DestroyDRCDialog( wxID_CANCEL );
342 }
343 
344 
349 void DIALOG_DRC_CONTROL::OnReportCheckBoxClicked( wxCommandEvent& event )
350 {
351  m_RptFilenameCtrl->Enable( m_CreateRptCtrl->IsChecked() );
352  m_BrowseButton->Enable( m_CreateRptCtrl->IsChecked() );
353 }
354 
355 
356 void DIALOG_DRC_CONTROL::OnLeftDClickClearance( wxMouseEvent& event )
357 {
358  event.Skip();
359 
360  // I am assuming that the double click actually changed the selected item.
361  // please verify this.
362  int selection = m_ClearanceListBox->GetSelection();
363 
364  if( selection != wxNOT_FOUND )
365  {
366  // Find the selected MARKER in the PCB, position cursor there.
367  // Then close the dialog.
368  const DRC_ITEM* item = m_ClearanceListBox->GetItem( selection );
369 
370  if( item )
371  {
372  m_brdEditor->CursorGoto( item->GetPointA() );
374 
375  if( !IsModal() )
376  {
377  // turn control over to m_brdEditor, hide this DIALOG_DRC_CONTROL window,
378  // no destruction so we can preserve listbox cursor
379  Show( false );
380 
381  // We do not want the clarification popup window.
382  // when releasing the left button in the main window
384  }
385  }
386  }
387 }
388 
389 
390 void DIALOG_DRC_CONTROL::OnPopupMenu( wxCommandEvent& event )
391 {
392  int source = event.GetId();
393 
394  const DRC_ITEM* item = 0;
395  wxPoint pos;
396 
397  int selection;
398 
399  switch( source )
400  {
402  selection = m_UnconnectedListBox->GetSelection();
403  item = m_UnconnectedListBox->GetItem( selection );
404  pos = item->GetPointA();
405  break;
406 
408  selection = m_UnconnectedListBox->GetSelection();
409  item = m_UnconnectedListBox->GetItem( selection );
410  pos = item->GetPointB();
411  break;
412 
413  case ID_POPUP_MARKERS_A:
414  selection = m_ClearanceListBox->GetSelection();
415  item = m_ClearanceListBox->GetItem( selection );
416  pos = item->GetPointA();
417  break;
418 
419  case ID_POPUP_MARKERS_B:
420  selection = m_ClearanceListBox->GetSelection();
421  item = m_ClearanceListBox->GetItem( selection );
422  pos = item->GetPointB();
423  break;
424  }
425 
426  if( item )
427  {
428  m_brdEditor->CursorGoto( pos );
430 
431  if( !IsModal() )
432  Show( false );
433  }
434 }
435 
436 
437 void DIALOG_DRC_CONTROL::OnRightUpUnconnected( wxMouseEvent& event )
438 {
439  event.Skip();
440 
441  // popup menu to go to either of the items listed in the DRC_ITEM.
442 
443  int selection = m_UnconnectedListBox->GetSelection();
444 
445  if( selection != wxNOT_FOUND )
446  {
447  wxMenu menu;
448  wxMenuItem* mItem;
449  const DRC_ITEM* dItem = m_UnconnectedListBox->GetItem( selection );
450 
451  mItem = new wxMenuItem( &menu, ID_POPUP_UNCONNECTED_A, dItem->GetTextA() );
452  menu.Append( mItem );
453 
454  if( dItem->HasSecondItem() )
455  {
456  mItem = new wxMenuItem( &menu, ID_POPUP_UNCONNECTED_B, dItem->GetTextB() );
457  menu.Append( mItem );
458  }
459 
460  PopupMenu( &menu );
461  }
462 }
463 
464 
465 void DIALOG_DRC_CONTROL::OnRightUpClearance( wxMouseEvent& event )
466 {
467  event.Skip();
468 
469  // popup menu to go to either of the items listed in the DRC_ITEM.
470 
471  int selection = m_ClearanceListBox->GetSelection();
472 
473  if( selection != wxNOT_FOUND )
474  {
475  wxMenu menu;
476  wxMenuItem* mItem;
477  const DRC_ITEM* dItem = m_ClearanceListBox->GetItem( selection );
478 
479  mItem = new wxMenuItem( &menu, ID_POPUP_MARKERS_A, dItem->GetTextA() );
480  menu.Append( mItem );
481 
482  if( dItem->HasSecondItem() )
483  {
484  mItem = new wxMenuItem( &menu, ID_POPUP_MARKERS_B, dItem->GetTextB() );
485  menu.Append( mItem );
486  }
487 
488  PopupMenu( &menu );
489  }
490 }
491 
492 
494 {
495  event.Skip();
496 
497  // I am assuming that the double click actually changed the selected item.
498  // please verify this.
499  int selection = m_UnconnectedListBox->GetSelection();
500 
501  if( selection != wxNOT_FOUND )
502  {
503  // Find the selected DRC_ITEM in the listbox, position cursor there,
504  // at the first of the two pads.
505  // Then hide the dialog.
506  const DRC_ITEM* item = m_UnconnectedListBox->GetItem( selection );
507  if( item )
508  {
509  m_brdEditor->CursorGoto( item->GetPointA() );
511 
512  if( !IsModal() )
513  {
514  Show( false );
515 
516  // We do not want the clarification popup window.
517  // when releasing the left button in the main window
519  }
520  }
521  }
522 }
523 
524 /* called when switching from Error list to Unconnected list
525  * To avoid mistakes, the current marker is selection is cleared
526  */
527 void DIALOG_DRC_CONTROL::OnChangingMarkerList( wxNotebookEvent& event )
528 {
529  m_DeleteCurrentMarkerButton->Enable( false );
530  m_ClearanceListBox->SetSelection( -1 );
531  m_UnconnectedListBox->SetSelection( -1 );
532 }
533 
534 void DIALOG_DRC_CONTROL::OnMarkerSelectionEvent( wxCommandEvent& event )
535 {
536  int selection = event.GetSelection();
537 
538  if( selection != wxNOT_FOUND )
539  {
540  // until a MARKER is selected, this button is not enabled.
541  m_DeleteCurrentMarkerButton->Enable( true );
542 
543  // Find the selected DRC_ITEM in the listbox, position cursor there,
544  // at the first of the two pads.
545  const DRC_ITEM* item = m_ClearanceListBox->GetItem( selection );
546  if( item )
547  {
548  m_brdEditor->CursorGoto( item->GetPointA(), false );
550  }
551  }
552 
553  event.Skip();
554 }
555 
556 
558 {
559  int selection = event.GetSelection();
560 
561  if( selection != wxNOT_FOUND )
562  {
563  // until a MARKER is selected, this button is not enabled.
564  m_DeleteCurrentMarkerButton->Enable( true );
565 
566  // Find the selected DRC_ITEM in the listbox, position cursor there,
567  // at the first of the two pads.
568  const DRC_ITEM* item = m_UnconnectedListBox->GetItem( selection );
569  if( item )
570  {
571  m_brdEditor->CursorGoto( item->GetPointA(), false );
573  }
574  }
575 
576  event.Skip();
577 }
578 
579 
581 {
583 }
584 
585 
587 {
588  m_brdEditor->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker
591  m_DeleteCurrentMarkerButton->Enable( false );
592 }
593 
594 
596 {
597  wxFileName fn = m_RptFilenameCtrl->GetValue();
598 
599  if( !fn.HasExt() )
600  {
601  fn.SetExt( ReportFileExtension );
602  m_RptFilenameCtrl->SetValue( fn.GetFullPath() );
603  }
604 
605  // Ensure it is an absolute filename. if it is given relative
606  // it will be made relative to the project
607  if( !fn.IsAbsolute() )
608  {
609  wxString prj_path = Prj().GetProjectPath();
610  fn.MakeAbsolute( prj_path );
611  }
612 
613  return fn.GetFullPath();
614 }
615 
616 
617 bool DIALOG_DRC_CONTROL::writeReport( const wxString& aFullFileName )
618 {
619  FILE* fp = wxFopen( aFullFileName, wxT( "w" ) );
620 
621  if( fp == NULL )
622  return false;
623 
624  int count;
625 
626  fprintf( fp, "** Drc report for %s **\n",
628 
629  wxDateTime now = wxDateTime::Now();
630 
631  fprintf( fp, "** Created on %s **\n", TO_UTF8( now.Format( wxT( "%F %T" ) ) ) );
632 
633  count = m_ClearanceListBox->GetItemCount();
634 
635  fprintf( fp, "\n** Found %d DRC errors **\n", count );
636 
637  for( int i = 0; i<count; ++i )
638  fprintf( fp, "%s", TO_UTF8( m_ClearanceListBox->GetItem( i )->ShowReport()) );
639 
640  count = m_UnconnectedListBox->GetItemCount();
641 
642  fprintf( fp, "\n** Found %d unconnected pads **\n", count );
643 
644  for( int i = 0; i<count; ++i )
645  fprintf( fp, "%s", TO_UTF8( m_UnconnectedListBox->GetItem( i )->ShowReport() ) );
646 
647  fprintf( fp, "\n** End of Report **\n" );
648 
649  fclose( fp );
650 
651  return true;
652 }
653 
654 
655 void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
656 {
657  int selectedIndex;
658  int curTab = m_Notebook->GetSelection();
659 
660  if( curTab == 0 )
661  {
662  selectedIndex = m_ClearanceListBox->GetSelection();
663 
664  if( selectedIndex != wxNOT_FOUND )
665  {
666  m_ClearanceListBox->DeleteItem( selectedIndex );
667 
668  // redraw the pcb
669  RedrawDrawPanel();
670  }
671  }
672  else if( curTab == 1 )
673  {
674  selectedIndex = m_UnconnectedListBox->GetSelection();
675 
676  if( selectedIndex != wxNOT_FOUND )
677  {
678  m_UnconnectedListBox->DeleteItem( selectedIndex );
679 
680  /* these unconnected DRC_ITEMs are not currently visible on the pcb
681  * RedrawDrawPanel();
682  */
683  }
684  }
685 
687 }
688 
689 
691 {
692  int marker_count = m_ClearanceListBox->GetItemCount();
693  int unconnected_count = m_UnconnectedListBox->GetItemCount();
694 
695  m_MarkerCount->SetLabelText( wxString::Format( "%d", marker_count ) );
696  m_UnconnectedCount->SetLabelText( wxString::Format( "%d", unconnected_count ) );
697 }
void DeleteItem(int aIndex)
Function DeleteElement will delete one of the items in the list.
void DestroyDRCDialog(int aReason)
Function DestroyDRCDialog deletes this ui dialog box and zeros out its pointer to remember the state ...
Definition: drc.cpp:97
DIALOG_DRC_CONTROL(DRC *aTester, PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
Definition: dialog_drc.cpp:51
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:690
#define ID_CLEARANCE_LIST
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. ...
void OnMarkerSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:534
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
bool HasSecondItem() const
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
void OnUnconnectedSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:557
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:465
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:299
void OnStartdrcClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC
Definition: dialog_drc.cpp:170
void GetRptSettings(bool *aEnable, wxString &aFileName)
Definition: dialog_drc.cpp:164
wxCheckBox * m_CreateRptCtrl
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
wxString ShowReport() const
Function ShowReport translates this object into a text string suitable for saving to disk in a report...
void SetCurItem(BOARD_ITEM *aItem, bool aDisplayInfo=true)
Function SetCurItem sets the currently selected item and displays it in the MsgPanel.
wxTextCtrl * m_RptFilenameCtrl
void OnActivateDlg(wxActivateEvent &event) override
handler for activate event, updating data which can be modified outside the dialog (DRC parameters) ...
Definition: dialog_drc.cpp:73
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:595
wxStaticText * m_ViaMinUnit
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:356
const wxPoint & GetPointB() const
BOARD * GetBoard() const
wxButton * m_DeleteCurrentMarkerButton
void ListUnconnectedPads()
Function ListUnconnectedPad gathers a list of all the unconnected pads and shows them in the dialog...
Definition: drc.cpp:326
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void SkipNextLeftButtonReleaseEvent()
function SkipNextLeftButtonReleaseEvent after calling this function, if the left mouse button is down...
Definition: draw_frame.cpp:275
void OnDeleteAllClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL
Definition: dialog_drc.cpp:234
DRCLISTBOX * m_UnconnectedListBox
void OnListUnconnectedClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED
Definition: dialog_drc.cpp:242
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:57
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
void CursorGoto(const wxPoint &aPos, bool aWarp=true)
Function CursorGoto positions the cursor at a given coordinate and reframes the drawing if the reques...
wxTextCtrl * m_SetViaMinSizeCtrl
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
Class DIALOG_DRC_CONTROL_BASE.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxStaticText * m_MicroViaMinUnit
#define ID_POPUP_MARKERS_A
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:563
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
void DeleteAllItems()
Function DeleteAllItems deletes all items in the list.
const wxString & GetFileName() const
Definition: class_board.h:237
DRCLISTBOX * m_ClearanceListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
#define TestMissingCourtyardKey
Definition: dialog_drc.cpp:47
int m_TrackMinWidth
track min value for width ((min copper size value
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:493
int m_ViasMinSize
vias (not micro vias) min diameter
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:479
wxCheckBox * m_cbCourtyardMissing
wxStaticText * m_UnconnectedCount
#define ID_POPUP_UNCONNECTED_B
The common library.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:101
void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aDesignSettings)
Function SetDesignSettings.
Definition: class_board.h:540
wxConfigBase * m_config
Definition: dialog_drc.h:150
wxCheckBox * m_cbCourtyardOverlap
#define ID_POPUP_MARKERS_B
void OnReportCheckBoxClicked(wxCommandEvent &event) override
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX
Definition: dialog_drc.cpp:349
#define ID_POPUP_UNCONNECTED_A
int m_MicroViasMinSize
micro vias (not vias) min diameter
int ValueFromTextCtrl(const wxTextCtrl &aTextCtr)
Convert the number Value in a string according to the internal units and the selected unit (g_UserUni...
Definition: base_units.cpp:384
void OnCancelClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
Definition: dialog_drc.cpp:335
bool Show(bool show) override
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:307
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
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:617
const wxString & GetTextA() const
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:265
void OnPopupMenu(wxCommandEvent &event)
Definition: dialog_drc.cpp:390
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
see class PGM_BASE
void OnDeleteOneClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE
Definition: dialog_drc.cpp:655
const wxPoint & GetPointA() const
void OnOkClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
Definition: dialog_drc.cpp:324
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
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
Class DRC is the Design Rule Checker, and performs all the DRC tests.
Definition: drc_stuff.h:158
wxStaticText * m_MarkerCount
wxTextCtrl * m_SetMicroViakMinSizeCtrl
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
wxStaticText * m_TrackMinWidthUnit
const wxString ReportFileExtension
const wxString ReportFileWildcard
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
void SetSettings(bool aPad2PadTest, bool aUnconnectedTest, bool aZonesTest, bool aKeepoutTest, bool aCourtyardTest, bool aCourtyardMissingTest, const wxString &aReportName, bool aSaveReport)
Function SetSettings saves all the UI or test settings and may be called before running the tests...
Definition: drc_stuff.h:500
void OnRightUpUnconnected(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:437
wxTextCtrl * m_SetTrackMinWidthCtrl
void OnChangingMarkerList(wxNotebookEvent &event) override
Definition: dialog_drc.cpp:527
const wxString & GetTextB() const
void RunTests(wxTextCtrl *aMessages=NULL)
Function RunTests will actually run all the tests specified with a previous call to SetSettings() ...
Definition: drc.cpp:192
#define ID_UNCONNECTED_LIST
#define TestFootprintCourtyardKey
Definition: dialog_drc.cpp:48
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:149
BOARD * m_currentBoard
Definition: dialog_drc.h:147
void SetRptSettings(bool aEnable, const wxString &aFileName)
Enable/disable the report file creation.
Definition: dialog_drc.cpp:156
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240