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 <rc_item.h>
32 #include <pcb_marker.h>
33 #include <board.h>
34 #include <dialog_drc_base.h>
36 
37 
39 
40 
41 #define DIALOG_DRC_WINDOW_NAME "DialogDrcWindowName"
42 
43 class
45 {
46 public:
48  DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
49  ~DIALOG_DRC();
50 
51  void SetDrcRun() { m_drcRun = true; }
52  void SetFootprintTestsRun() { m_footprintTestsRun = true; }
53 
54  void SetMarkersProvider( RC_ITEMS_PROVIDER* aProvider );
55  void SetUnconnectedProvider( RC_ITEMS_PROVIDER* aProvider );
56  void SetFootprintsProvider( RC_ITEMS_PROVIDER* aProvider );
57 
58  void PrevMarker();
59  void NextMarker();
60  void SelectMarker( const PCB_MARKER* aMarker );
61 
62  void ExcludeMarker();
63 
64 private:
72  bool writeReport( const wxString& aFullFileName );
73 
74  void initValues();
75  void syncCheckboxes();
76  void updateDisplayedCounts();
77 
78  void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
79  void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
80  void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
81 
82  void OnSeverity( wxCommandEvent& aEvent ) override;
83  void OnSaveReport( wxCommandEvent& aEvent ) override;
84 
85  void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
86  void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
87  void OnRunDRCClick( wxCommandEvent& aEvent ) override;
88 
89  void OnErrorLinkClicked( wxHtmlLinkEvent& event ) override;
90 
91  // These require special handling while the DRC tests are running.
92  void OnCancelClick( wxCommandEvent& aEvent ) override;
93  void OnClose( wxCloseEvent& event ) override;
94 
95  // Updates data which can be modified outside the dialog
96  void OnActivateDlg( wxActivateEvent& aEvent ) override;
97 
98  void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
99 
100  void centerMarkerIdleHandler( wxIdleEvent& aEvent );
101 
102  void deleteAllMarkers( bool aIncludeExclusions );
103  void refreshEditor();
104 
105  // PROGRESS_REPORTER calls
106  bool updateUI() override;
107  void AdvancePhase( const wxString& aMessage ) override;
108 
109  BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }
110 
111  BOARD* m_currentBoard; // the board currently on test
113  bool m_running;
114  std::atomic<bool> m_cancelled;
115  bool m_drcRun;
117 
121 
124 
127 
130 
132 
133  int m_severities; // A mask of SEVERITY flags
134 };
135 
136 #endif // _DIALOG_DRC_H_
137 
BOARD_DESIGN_SETTINGS & bds()
Definition: dialog_drc.h:109
Class DIALOG_DRC_BASE.
bool m_footprintTestsRun
Definition: dialog_drc.h:116
wxString m_footprintsTitleTemplate
Definition: dialog_drc.h:120
void SetDrcRun()
Definition: dialog_drc.h:51
void SetFootprintTestsRun()
Definition: dialog_drc.h:52
RC_ITEMS_PROVIDER * m_markersProvider
Definition: dialog_drc.h:122
BOARD * m_currentBoard
Definition: dialog_drc.h:111
Provide an abstract interface of a RC_ITEM* list manager.
Definition: rc_item.h:45
RC_ITEMS_PROVIDER * m_unconnectedItemsProvider
Definition: dialog_drc.h:125
wxString m_markersTitleTemplate
Definition: dialog_drc.h:118
RC_ITEMS_PROVIDER * m_footprintWarningsProvider
Definition: dialog_drc.h:128
RC_TREE_MODEL * m_footprintWarningsTreeModel
Definition: dialog_drc.h:129
std::atomic< bool > m_cancelled
Definition: dialog_drc.h:114
RC_TREE_MODEL * m_unconnectedTreeModel
Definition: dialog_drc.h:126
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
The main frame for Pcbnew.
bool m_drcRun
Definition: dialog_drc.h:115
int m_severities
Definition: dialog_drc.h:133
RC_TREE_MODEL * m_markersTreeModel
Definition: dialog_drc.h:123
PCB_EDIT_FRAME * m_frame
Definition: dialog_drc.h:112
const PCB_MARKER * m_centerMarkerOnIdle
Definition: dialog_drc.h:131
bool m_running
Definition: dialog_drc.h:113
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:119
Container for design settings for a BOARD object.