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 <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
62
66 void UpdateData();
67
68 void PrevMarker();
69 void NextMarker();
70 void SelectMarker( const PCB_MARKER* aMarker );
71
72 void ExcludeMarker();
73
74private:
75 int getSeverities();
76 void updateDisplayedCounts();
77
78 bool TransferDataToWindow() override;
79
80 void OnMenu( wxCommandEvent& aEvent ) override;
81 void OnCharHook( wxKeyEvent& aEvt ) override;
82 void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
83 void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
84 void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
85 void OnIgnoredItemRClick( wxListEvent& event ) override;
86 void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
87
88 void OnSeverity( wxCommandEvent& aEvent ) override;
89 void OnSaveReport( wxCommandEvent& aEvent ) override;
90
91 void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
92 void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
93 void OnRunDRCClick( wxCommandEvent& aEvent ) override;
94
95 void OnErrorLinkClicked( wxHtmlLinkEvent& event ) override;
96
97 // These require special handling while the DRC tests are running.
98 void OnCancelClick( wxCommandEvent& aEvent ) override;
99 void OnClose( wxCloseEvent& event ) override;
100
101 // Updates data which can be modified outside the dialog.
102 void OnActivateDlg( wxActivateEvent& aEvent ) override;
103
104 void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
105
106 void deleteAllMarkers( bool aIncludeExclusions );
107 void refreshEditor();
108
109 // PROGRESS_REPORTER calls
110 bool updateUI() override;
111 void AdvancePhase( const wxString& aMessage ) override;
112
113 BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }
114
115private:
116 BOARD* m_currentBoard; // the board currently on test
121
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 std::chrono::steady_clock::time_point m_lastUpdateUi;
141};
142
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:317
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:128
void SetFootprintTestsRun()
Called after running Footprint Tests.
Definition dialog_drc.h:61
std::shared_ptr< RC_ITEMS_PROVIDER > m_ratsnestProvider
Definition dialog_drc.h:132
wxString m_markersTitleTemplate
Definition dialog_drc.h:126
bool m_footprintTestsRun
Definition dialog_drc.h:120
DIALOG_DRC(PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
RC_TREE_MODEL * m_fpWarningsTreeModel
Definition dialog_drc.h:137
bool m_running
Definition dialog_drc.h:118
bool m_crossprobe
Definition dialog_drc.h:123
void SetDrcRun()
Called after running DRC.
Definition dialog_drc.h:55
BOARD_DESIGN_SETTINGS & bds()
Definition dialog_drc.h:113
bool m_report_all_track_errors
Definition dialog_drc.h:122
std::chrono::steady_clock::time_point m_lastUpdateUi
Used to slow down the rate of yields in updateUi()
Definition dialog_drc.h:140
BOARD * m_currentBoard
Definition dialog_drc.h:116
wxString m_ignoredTitleTemplate
Definition dialog_drc.h:129
RC_TREE_MODEL * m_unconnectedTreeModel
Definition dialog_drc.h:136
bool m_scroll_on_crossprobe
Definition dialog_drc.h:124
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:117
bool m_drcRun
Definition dialog_drc.h:119
RC_TREE_MODEL * m_markersTreeModel
Definition dialog_drc.h:135
The main frame for Pcbnew.