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, see <https://www.gnu.org/licenses/>.
20 */
21
22
23#pragma once
24
25#include <chrono>
26#include <core/throttle.h>
27#include <wx/htmllbox.h>
28#include <rc_item.h>
29#include <pcb_marker.h>
30#include <board.h>
31#include <dialog_drc_base.h>
33
34class wxStatusBar;
35
36
38
39
40#define DIALOG_DRC_WINDOW_NAME wxT( "DialogDrcWindowName" )
41
42class
44{
45public:
47 DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
49
54 void SetDrcRun() { m_drcRun = true; }
55
61
65 void UpdateData();
66
67 void PrevMarker();
68 void NextMarker();
69 void SelectMarker( const PCB_MARKER* aMarker );
70
71 void ExcludeMarker();
72
73private:
74 int getSeverities();
75 void updateDisplayedCounts();
76
77 bool TransferDataToWindow() override;
78
79 void OnMenu( wxCommandEvent& aEvent ) override;
80 void OnCharHook( wxKeyEvent& aEvt ) override;
81 void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
82 void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
83 void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
84 void OnIgnoredItemRClick( wxListEvent& event ) override;
85 void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
86
87 void OnSeverity( wxCommandEvent& aEvent ) override;
88 void OnSaveReport( wxCommandEvent& aEvent ) override;
89
90 void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
91 void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
92 void OnRunDRCClick( wxCommandEvent& aEvent ) override;
93
94 void OnErrorLinkClicked( wxHtmlLinkEvent& event ) override;
95
96 // These require special handling while the DRC tests are running.
97 void OnCancelClick( wxCommandEvent& aEvent ) override;
98 void OnClose( wxCloseEvent& event ) override;
99
100 // Updates data which can be modified outside the dialog.
101 void OnActivateDlg( wxActivateEvent& aEvent ) override;
102
103 void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
104
105 void deleteAllMarkers( bool aIncludeExclusions );
106 void refreshEditor();
107
108 void installLinkHandlers( wxDataViewCtrl* aCtrl );
109 void onDataViewMotion( wxMouseEvent& aEvent );
110 void onDataViewLeftUp( wxMouseEvent& aEvent );
111
112 static bool hitTestLink( wxDataViewCtrl* aCtrl, const wxPoint& aPoint, wxString* aHref );
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
120private:
121 BOARD* m_currentBoard; // the board currently on test
126
130
135
136 std::shared_ptr<RC_ITEMS_PROVIDER> m_markersProvider;
137 std::shared_ptr<RC_ITEMS_PROVIDER> m_ratsnestProvider;
138 std::shared_ptr<RC_ITEMS_PROVIDER> m_fpWarningsProvider;
139
140 RC_TREE_MODEL* m_markersTreeModel; // wx reference-counted ptr
141 RC_TREE_MODEL* m_unconnectedTreeModel; // wx reference-counted ptr
142 RC_TREE_MODEL* m_fpWarningsTreeModel; // wx reference-counted ptr
143
146
147 wxStatusBar* m_drcStatusBar;
148 std::chrono::steady_clock::time_point m_drcStartTime;
150};
151
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
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:133
void SetFootprintTestsRun()
Called after running Footprint Tests.
Definition dialog_drc.h:60
std::shared_ptr< RC_ITEMS_PROVIDER > m_ratsnestProvider
Definition dialog_drc.h:137
wxString m_markersTitleTemplate
Definition dialog_drc.h:131
bool m_footprintTestsRun
Definition dialog_drc.h:125
DIALOG_DRC(PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
wxStatusBar * m_drcStatusBar
Definition dialog_drc.h:147
RC_TREE_MODEL * m_fpWarningsTreeModel
Definition dialog_drc.h:142
bool m_running
Definition dialog_drc.h:123
bool m_crossprobe
Definition dialog_drc.h:128
int m_lastTickSeconds
Definition dialog_drc.h:149
void SetDrcRun()
Called after running DRC.
Definition dialog_drc.h:54
BOARD_DESIGN_SETTINGS & bds()
Definition dialog_drc.h:118
bool m_report_all_track_errors
Definition dialog_drc.h:127
std::chrono::steady_clock::time_point m_drcStartTime
Definition dialog_drc.h:148
BOARD * m_currentBoard
Definition dialog_drc.h:121
wxString m_ignoredTitleTemplate
Definition dialog_drc.h:134
THROTTLE m_yieldThrottle
Definition dialog_drc.h:145
THROTTLE m_updateThrottle
Definition dialog_drc.h:144
RC_TREE_MODEL * m_unconnectedTreeModel
Definition dialog_drc.h:141
bool m_scroll_on_crossprobe
Definition dialog_drc.h:129
wxString m_unconnectedTitleTemplate
Definition dialog_drc.h:132
std::shared_ptr< RC_ITEMS_PROVIDER > m_fpWarningsProvider
Definition dialog_drc.h:138
std::shared_ptr< RC_ITEMS_PROVIDER > m_markersProvider
Definition dialog_drc.h:136
PCB_EDIT_FRAME * m_frame
Definition dialog_drc.h:122
bool m_drcRun
Definition dialog_drc.h:124
RC_TREE_MODEL * m_markersTreeModel
Definition dialog_drc.h:140
The main frame for Pcbnew.
Rate-limiter that fires at most once per interval.
Definition throttle.h:31