KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <chrono>
31#include <wx/htmllbox.h>
32#include <rc_item.h>
33#include <pcb_marker.h>
34#include <board.h>
35#include <dialog_drc_base.h>
37
38
40
41
42#define DIALOG_DRC_WINDOW_NAME wxT( "DialogDrcWindowName" )
43
44class
46{
47public:
49 DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
51
56 void SetDrcRun() { m_drcRun = true; }
57
62 void SetFootprintTestsRun() { m_footprintTestsRun = true; }
63
67 void UpdateData();
68
69 void PrevMarker();
70 void NextMarker();
71 void SelectMarker( const PCB_MARKER* aMarker );
72
73 void ExcludeMarker();
74
75private:
76 void syncCheckboxes();
77 void updateDisplayedCounts();
78
79 void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
80 void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
81 void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
82 void OnIgnoredItemRClick( wxListEvent& event ) override;
83 void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
84
85 void OnSeverity( wxCommandEvent& aEvent ) override;
86 void OnSaveReport( wxCommandEvent& aEvent ) override;
87
88 void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
89 void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
90 void OnRunDRCClick( wxCommandEvent& aEvent ) override;
91
92 void OnErrorLinkClicked( wxHtmlLinkEvent& event ) override;
93
94 // These require special handling while the DRC tests are running.
95 void OnCancelClick( wxCommandEvent& aEvent ) override;
96 void OnClose( wxCloseEvent& event ) override;
97
98 // Updates data which can be modified outside the dialog.
99 void OnActivateDlg( wxActivateEvent& aEvent ) override;
100
101 void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
102
103 void deleteAllMarkers( bool aIncludeExclusions );
104 void refreshEditor();
105
106 // PROGRESS_REPORTER calls
107 bool updateUI() override;
108 void AdvancePhase( const wxString& aMessage ) override;
109
110 BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }
111
112 BOARD* m_currentBoard; // the board currently on test
117
122
123 std::shared_ptr<RC_ITEMS_PROVIDER> m_markersProvider;
124 std::shared_ptr<RC_ITEMS_PROVIDER> m_ratsnestProvider;
125 std::shared_ptr<RC_ITEMS_PROVIDER> m_fpWarningsProvider;
126
127 RC_TREE_MODEL* m_markersTreeModel; // wx reference-counted ptr
128 RC_TREE_MODEL* m_unconnectedTreeModel; // wx reference-counted ptr
129 RC_TREE_MODEL* m_fpWarningsTreeModel; // wx reference-counted ptr
130
131 int m_severities; // A mask of SEVERITY flags
132
134 std::chrono::steady_clock::time_point m_lastUpdateUi;
135};
136
137#endif // _DIALOG_DRC_H_
138
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
Class DIALOG_DRC_BASE.
wxString m_footprintsTitleTemplate
Definition: dialog_drc.h:120
void SetFootprintTestsRun()
Called after running Footprint Tests.
Definition: dialog_drc.h:62
std::shared_ptr< RC_ITEMS_PROVIDER > m_ratsnestProvider
Definition: dialog_drc.h:124
wxString m_markersTitleTemplate
Definition: dialog_drc.h:118
int m_severities
Definition: dialog_drc.h:131
bool m_footprintTestsRun
Definition: dialog_drc.h:116
RC_TREE_MODEL * m_fpWarningsTreeModel
Definition: dialog_drc.h:129
bool m_running
Definition: dialog_drc.h:114
void SetDrcRun()
Called after running DRC.
Definition: dialog_drc.h:56
BOARD_DESIGN_SETTINGS & bds()
Definition: dialog_drc.h:110
std::chrono::steady_clock::time_point m_lastUpdateUi
Used to slow down the rate of yields in updateUi()
Definition: dialog_drc.h:134
BOARD * m_currentBoard
Definition: dialog_drc.h:112
wxString m_ignoredTitleTemplate
Definition: dialog_drc.h:121
RC_TREE_MODEL * m_unconnectedTreeModel
Definition: dialog_drc.h:128
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:119
std::shared_ptr< RC_ITEMS_PROVIDER > m_fpWarningsProvider
Definition: dialog_drc.h:125
std::shared_ptr< RC_ITEMS_PROVIDER > m_markersProvider
Definition: dialog_drc.h:123
PCB_EDIT_FRAME * m_frame
Definition: dialog_drc.h:113
bool m_drcRun
Definition: dialog_drc.h:115
RC_TREE_MODEL * m_markersTreeModel
Definition: dialog_drc.h:127
The main frame for Pcbnew.
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.