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, [email protected]
5 * Copyright (C) 2009 Dick Hollenbeck, [email protected]
6 * Copyright (C) 2004-2022 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 wxT( "DialogDrcWindowName" )
42
43class
45{
46public:
48 DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
50
55 void SetDrcRun() { m_drcRun = true; }
56
61 void SetFootprintTestsRun() { m_footprintTestsRun = true; }
62
66 void UpdateData();
67
68 void PrevMarker();
69 void NextMarker();
70 void SelectMarker( const PCB_MARKER* aMarker );
71
72 void ExcludeMarker();
73
74private:
81 bool writeReport( const wxString& aFullFileName );
82
83 void syncCheckboxes();
84 void updateDisplayedCounts();
85
86 void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
87 void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
88 void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
89 void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
90
91 void OnSeverity( wxCommandEvent& aEvent ) override;
92 void OnSaveReport( wxCommandEvent& aEvent ) override;
93
94 void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
95 void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
96 void OnRunDRCClick( wxCommandEvent& aEvent ) override;
97
98 void OnErrorLinkClicked( wxHtmlLinkEvent& event ) override;
99
100 // These require special handling while the DRC tests are running.
101 void OnCancelClick( wxCommandEvent& aEvent ) override;
102 void OnClose( wxCloseEvent& event ) override;
103
104 // Updates data which can be modified outside the dialog.
105 void OnActivateDlg( wxActivateEvent& aEvent ) override;
106
107 void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
108
109 void centerMarkerIdleHandler( wxIdleEvent& aEvent );
110
111 void deleteAllMarkers( bool aIncludeExclusions );
112 void refreshEditor();
113
114 // PROGRESS_REPORTER calls
115 bool updateUI() override;
116 void AdvancePhase( const wxString& aMessage ) override;
117
118 BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }
119
120 BOARD* m_currentBoard; // the board currently on test
125
130
131 std::shared_ptr<RC_ITEMS_PROVIDER> m_markersProvider;
132 std::shared_ptr<RC_ITEMS_PROVIDER> m_ratsnestProvider;
133 std::shared_ptr<RC_ITEMS_PROVIDER> m_fpWarningsProvider;
134
135 RC_TREE_MODEL* m_markersTreeModel; // wx reference-counted ptr
136 RC_TREE_MODEL* m_unconnectedTreeModel; // wx reference-counted ptr
137 RC_TREE_MODEL* m_fpWarningsTreeModel; // wx reference-counted ptr
138
140
141 int m_severities; // A mask of SEVERITY flags
142};
143
144#endif // _DIALOG_DRC_H_
145
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
Class DIALOG_DRC_BASE.
wxString m_footprintsTitleTemplate
Definition: dialog_drc.h:128
void SetFootprintTestsRun()
Called after running Footprint Tests.
Definition: dialog_drc.h:61
const PCB_MARKER * m_centerMarkerOnIdle
Definition: dialog_drc.h:139
std::shared_ptr< RC_ITEMS_PROVIDER > m_ratsnestProvider
Definition: dialog_drc.h:132
wxString m_markersTitleTemplate
Definition: dialog_drc.h:126
int m_severities
Definition: dialog_drc.h:141
bool m_footprintTestsRun
Definition: dialog_drc.h:124
RC_TREE_MODEL * m_fpWarningsTreeModel
Definition: dialog_drc.h:137
bool m_running
Definition: dialog_drc.h:122
void SetDrcRun()
Called after running DRC.
Definition: dialog_drc.h:55
BOARD_DESIGN_SETTINGS & bds()
Definition: dialog_drc.h:118
BOARD * m_currentBoard
Definition: dialog_drc.h:120
wxString m_ignoredTitleTemplate
Definition: dialog_drc.h:129
RC_TREE_MODEL * m_unconnectedTreeModel
Definition: dialog_drc.h:136
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:127
std::shared_ptr< RC_ITEMS_PROVIDER > m_fpWarningsProvider
Definition: dialog_drc.h:133
std::shared_ptr< RC_ITEMS_PROVIDER > m_markersProvider
Definition: dialog_drc.h:131
PCB_EDIT_FRAME * m_frame
Definition: dialog_drc.h:121
bool m_drcRun
Definition: dialog_drc.h:123
RC_TREE_MODEL * m_markersTreeModel
Definition: dialog_drc.h:135
The main frame for Pcbnew.
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.