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 The 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#pragma once
28
29#include <chrono>
30#include <core/throttle.h>
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
38class wxStatusBar;
39
40
42
43
44#define DIALOG_DRC_WINDOW_NAME wxT( "DialogDrcWindowName" )
45
46class
48{
49public:
51 DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
53
58 void SetDrcRun() { m_drcRun = true; }
59
65
69 void UpdateData();
70
71 void PrevMarker();
72 void NextMarker();
73 void SelectMarker( const PCB_MARKER* aMarker );
74
75 void ExcludeMarker();
76
77private:
78 int getSeverities();
79 void updateDisplayedCounts();
80
81 bool TransferDataToWindow() override;
82
83 void OnMenu( wxCommandEvent& aEvent ) override;
84 void OnCharHook( wxKeyEvent& aEvt ) override;
85 void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
86 void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
87 void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
88 void OnIgnoredItemRClick( wxListEvent& event ) 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 deleteAllMarkers( bool aIncludeExclusions );
110 void refreshEditor();
111
112 void installLinkHandlers( wxDataViewCtrl* aCtrl );
113 void onDataViewMotion( wxMouseEvent& aEvent );
114 void onDataViewLeftUp( wxMouseEvent& aEvent );
115
116 static bool hitTestLink( wxDataViewCtrl* aCtrl, const wxPoint& aPoint, wxString* aHref );
117
118 // PROGRESS_REPORTER calls
119 bool updateUI() override;
120 void AdvancePhase( const wxString& aMessage ) override;
121
122 BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }
123
124private:
125 BOARD* m_currentBoard; // the board currently on test
130
134
139
140 std::shared_ptr<RC_ITEMS_PROVIDER> m_markersProvider;
141 std::shared_ptr<RC_ITEMS_PROVIDER> m_ratsnestProvider;
142 std::shared_ptr<RC_ITEMS_PROVIDER> m_fpWarningsProvider;
143
144 RC_TREE_MODEL* m_markersTreeModel; // wx reference-counted ptr
145 RC_TREE_MODEL* m_unconnectedTreeModel; // wx reference-counted ptr
146 RC_TREE_MODEL* m_fpWarningsTreeModel; // wx reference-counted ptr
147
150
151 wxStatusBar* m_drcStatusBar;
152 std::chrono::steady_clock::time_point m_drcStartTime;
154};
155
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:323
DIALOG_DRC_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Design Rules Checker"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxString m_footprintsTitleTemplate
Definition dialog_drc.h:137
void SetFootprintTestsRun()
Called after running Footprint Tests.
Definition dialog_drc.h:64
std::shared_ptr< RC_ITEMS_PROVIDER > m_ratsnestProvider
Definition dialog_drc.h:141
wxString m_markersTitleTemplate
Definition dialog_drc.h:135
bool m_footprintTestsRun
Definition dialog_drc.h:129
DIALOG_DRC(PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
wxStatusBar * m_drcStatusBar
Definition dialog_drc.h:151
RC_TREE_MODEL * m_fpWarningsTreeModel
Definition dialog_drc.h:146
bool m_running
Definition dialog_drc.h:127
bool m_crossprobe
Definition dialog_drc.h:132
int m_lastTickSeconds
Definition dialog_drc.h:153
void SetDrcRun()
Called after running DRC.
Definition dialog_drc.h:58
BOARD_DESIGN_SETTINGS & bds()
Definition dialog_drc.h:122
bool m_report_all_track_errors
Definition dialog_drc.h:131
std::chrono::steady_clock::time_point m_drcStartTime
Definition dialog_drc.h:152
BOARD * m_currentBoard
Definition dialog_drc.h:125
wxString m_ignoredTitleTemplate
Definition dialog_drc.h:138
THROTTLE m_yieldThrottle
Definition dialog_drc.h:149
THROTTLE m_updateThrottle
Definition dialog_drc.h:148
RC_TREE_MODEL * m_unconnectedTreeModel
Definition dialog_drc.h:145
bool m_scroll_on_crossprobe
Definition dialog_drc.h:133
wxString m_unconnectedTitleTemplate
Definition dialog_drc.h:136
std::shared_ptr< RC_ITEMS_PROVIDER > m_fpWarningsProvider
Definition dialog_drc.h:142
std::shared_ptr< RC_ITEMS_PROVIDER > m_markersProvider
Definition dialog_drc.h:140
PCB_EDIT_FRAME * m_frame
Definition dialog_drc.h:126
bool m_drcRun
Definition dialog_drc.h:128
RC_TREE_MODEL * m_markersTreeModel
Definition dialog_drc.h:144
The main frame for Pcbnew.
Rate-limiter that fires at most once per interval.
Definition throttle.h:35