KiCad PCB EDA Suite
dialog_drc.h
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) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 2009 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 
27 #ifndef _DIALOG_DRC_H_
28 #define _DIALOG_DRC_H_
29 
30 #include <wx/htmllbox.h>
31 #include <fctsys.h>
32 #include <pcbnew.h>
33 #include <rc_item.h>
34 #include <class_marker_pcb.h>
35 #include <class_board.h>
36 #include <dialog_drc_base.h>
38 
39 
41 
42 
43 #define DIALOG_DRC_WINDOW_NAME "DialogDrcWindowName"
44 
45 class
47 {
48 public:
50  DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
51  ~DIALOG_DRC();
52 
53  void SetDrcRun() { m_drcRun = true; }
54  void SetFootprintTestsRun() { m_footprintTestsRun = true; }
55 
56  void SetMarkersProvider( RC_ITEMS_PROVIDER* aProvider );
57  void SetUnconnectedProvider( RC_ITEMS_PROVIDER* aProvider );
58  void SetFootprintsProvider( RC_ITEMS_PROVIDER* aProvider );
59 
60 private:
68  bool writeReport( const wxString& aFullFileName );
69 
70  void initValues();
71  void syncCheckboxes();
72  void updateDisplayedCounts();
73 
74  void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
75  void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
76  void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
77 
78  void OnSeverity( wxCommandEvent& aEvent ) override;
79  void OnSaveReport( wxCommandEvent& aEvent ) override;
80 
81  void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
82  void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
83  void OnRunDRCClick( wxCommandEvent& aEvent ) override;
84 
85  // These require special handling while the DRC tests are running.
86  void OnCancelClick( wxCommandEvent& aEvent ) override;
87  void OnClose( wxCloseEvent& event ) override;
88 
89  // Updates data which can be modified outside the dialog
90  void OnActivateDlg( wxActivateEvent& aEvent ) override;
91 
92  void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
93 
94  void deleteAllMarkers( bool aIncludeExclusions );
95  void refreshBoardEditor();
96 
97  // PROGRESS_REPORTER calls
98  bool updateUI() override;
99  void AdvancePhase( const wxString& aMessage ) override;
100  void SetCurrentProgress( double aProgress ) override;
101 
102  BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }
103 
104  BOARD* m_currentBoard; // the board currently on test
106  bool m_running;
107  std::atomic<bool> m_cancelled;
108  bool m_drcRun;
110 
114 
117 
120 
123 
125 };
126 
127 #endif // _DIALOG_DRC_H_
128 
BOARD_DESIGN_SETTINGS & bds()
Definition: dialog_drc.h:102
RC_TREE_MODEL * m_markerTreeModel
Definition: dialog_drc.h:116
Class DIALOG_DRC_BASE.
A progress reporter for use in multi-threaded environments.
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:105
bool m_footprintTestsRun
Definition: dialog_drc.h:109
wxString m_footprintsTitleTemplate
Definition: dialog_drc.h:113
void SetDrcRun()
Definition: dialog_drc.h:53
void SetFootprintTestsRun()
Definition: dialog_drc.h:54
RC_ITEMS_PROVIDER * m_markersProvider
Definition: dialog_drc.h:115
BOARD * m_currentBoard
Definition: dialog_drc.h:104
Provide an abstract interface of a RC_ITEM* list manager.
Definition: rc_item.h:42
RC_ITEMS_PROVIDER * m_unconnectedItemsProvider
Definition: dialog_drc.h:118
wxString m_markersTitleTemplate
Definition: dialog_drc.h:111
Markers used to show a drc problem on boards.
RC_ITEMS_PROVIDER * m_footprintWarningsProvider
Definition: dialog_drc.h:121
RC_TREE_MODEL * m_footprintWarningsTreeModel
Definition: dialog_drc.h:122
std::atomic< bool > m_cancelled
Definition: dialog_drc.h:107
RC_TREE_MODEL * m_unconnectedTreeModel
Definition: dialog_drc.h:119
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
PCB_EDIT_FRAME is the main frame for Pcbnew.
bool m_drcRun
Definition: dialog_drc.h:108
int m_severities
Definition: dialog_drc.h:124
bool m_running
Definition: dialog_drc.h:106
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:112
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.