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 OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
83
84 void OnSeverity( wxCommandEvent& aEvent ) override;
85 void OnSaveReport( wxCommandEvent& aEvent ) override;
86
87 void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
88 void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
89 void OnRunDRCClick( wxCommandEvent& aEvent ) override;
90
91 void OnErrorLinkClicked( wxHtmlLinkEvent& event ) override;
92
93 // These require special handling while the DRC tests are running.
94 void OnCancelClick( wxCommandEvent& aEvent ) override;
95 void OnClose( wxCloseEvent& event ) override;
96
97 // Updates data which can be modified outside the dialog.
98 void OnActivateDlg( wxActivateEvent& aEvent ) override;
99
100 void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
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
116
121
122 std::shared_ptr<RC_ITEMS_PROVIDER> m_markersProvider;
123 std::shared_ptr<RC_ITEMS_PROVIDER> m_ratsnestProvider;
124 std::shared_ptr<RC_ITEMS_PROVIDER> m_fpWarningsProvider;
125
126 RC_TREE_MODEL* m_markersTreeModel; // wx reference-counted ptr
127 RC_TREE_MODEL* m_unconnectedTreeModel; // wx reference-counted ptr
128 RC_TREE_MODEL* m_fpWarningsTreeModel; // wx reference-counted ptr
129
130 int m_severities; // A mask of SEVERITY flags
131
133 std::chrono::steady_clock::time_point m_lastUpdateUi;
134};
135
136#endif // _DIALOG_DRC_H_
137
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:281
Class DIALOG_DRC_BASE.
wxString m_footprintsTitleTemplate
Definition: dialog_drc.h:119
void SetFootprintTestsRun()
Called after running Footprint Tests.
Definition: dialog_drc.h:62
std::shared_ptr< RC_ITEMS_PROVIDER > m_ratsnestProvider
Definition: dialog_drc.h:123
wxString m_markersTitleTemplate
Definition: dialog_drc.h:117
int m_severities
Definition: dialog_drc.h:130
bool m_footprintTestsRun
Definition: dialog_drc.h:115
RC_TREE_MODEL * m_fpWarningsTreeModel
Definition: dialog_drc.h:128
bool m_running
Definition: dialog_drc.h:113
void SetDrcRun()
Called after running DRC.
Definition: dialog_drc.h:56
BOARD_DESIGN_SETTINGS & bds()
Definition: dialog_drc.h:109
std::chrono::steady_clock::time_point m_lastUpdateUi
Used to slow down the rate of yields in updateUi()
Definition: dialog_drc.h:133
BOARD * m_currentBoard
Definition: dialog_drc.h:111
wxString m_ignoredTitleTemplate
Definition: dialog_drc.h:120
RC_TREE_MODEL * m_unconnectedTreeModel
Definition: dialog_drc.h:127
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:118
std::shared_ptr< RC_ITEMS_PROVIDER > m_fpWarningsProvider
Definition: dialog_drc.h:124
std::shared_ptr< RC_ITEMS_PROVIDER > m_markersProvider
Definition: dialog_drc.h:122
PCB_EDIT_FRAME * m_frame
Definition: dialog_drc.h:112
bool m_drcRun
Definition: dialog_drc.h:114
RC_TREE_MODEL * m_markersTreeModel
Definition: dialog_drc.h:126
The main frame for Pcbnew.
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.