KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_erc.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) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <memory>
24
25#include <wx/htmllbox.h>
26
27#include <dialog_erc_base.h>
29
30
34wxDECLARE_EVENT( EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent );
35
36
37#define DIALOG_ERC_WINDOW_NAME "DialogErcWindowName"
38
39
40class SCH_EDIT_FRAME;
41class SCH_MARKER;
42class SCHEMATIC;
44class RC_TREE_MODEL;
45
46
48{
49public:
50 DIALOG_ERC( SCH_EDIT_FRAME* parent );
52
53 bool TransferDataToWindow() override;
54
55 // PROGRESS_REPORTER_BASE calls
56 bool updateUI() override;
57 void AdvancePhase( const wxString& aMessage ) override;
58 void Report( const wxString& aMessage ) override;
59
60 void PrevMarker();
61 void NextMarker();
62 void SelectMarker( const SCH_MARKER* aMarker );
63
70 void ExcludeMarker( SCH_MARKER* aMarker = nullptr );
71
72 void DeleteAllMarkers( bool aIncludeExclusions );
73 void UpdateData();
75
76private:
77 int getSeverities();
78
79 // from DIALOG_ERC_BASE:
80 void OnMenu( wxCommandEvent& aEvent ) override;
81 void OnCharHook( wxKeyEvent& aEvt ) override;
82 void OnCloseErcDialog( wxCloseEvent& event ) override;
83 void OnRunERCClick( wxCommandEvent& event ) override;
84 void OnDeleteOneClick( wxCommandEvent& event ) override;
85 void OnDeleteAllClick( wxCommandEvent& event ) override;
86 void OnERCItemSelected( wxDataViewEvent& aEvent ) override;
87 void OnERCItemDClick( wxDataViewEvent& aEvent ) override;
88 void OnERCItemRClick( wxDataViewEvent& aEvent ) override;
89 void OnIgnoredItemRClick( wxListEvent& aEvent ) override;
90 void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
91
92 void OnLinkClicked( wxHtmlLinkEvent& event ) override;
93
94 void OnSeverity( wxCommandEvent& aEvent ) override;
95 void OnSaveReport( wxCommandEvent& aEvent ) override;
96 void OnCancelClick( wxCommandEvent& event ) override;
97
98 void centerMarkerIdleHandler( wxIdleEvent& aEvent );
99
100 void redrawDrawPanel();
101
102 void testErc();
103
106
107private:
110
113
114 std::shared_ptr<RC_ITEMS_PROVIDER> m_markerProvider;
115 RC_TREE_MODEL* m_markerTreeModel; // wx reference-counted ptr
116
119
121
125};
DIALOG_ERC_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Electrical Rules Checker"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void OnMenu(wxCommandEvent &aEvent) override
void ExcludeMarker(SCH_MARKER *aMarker=nullptr)
Exclude aMarker from the ERC list.
void OnIgnoredItemRClick(wxListEvent &aEvent) override
const SCH_MARKER * m_centerMarkerOnIdle
Definition dialog_erc.h:120
void OnERCItemDClick(wxDataViewEvent &aEvent) override
std::shared_ptr< RC_ITEMS_PROVIDER > m_markerProvider
Definition dialog_erc.h:114
bool TransferDataToWindow() override
void syncCheckboxes()
bool m_ercRun
Definition dialog_erc.h:118
bool m_crossprobe
Definition dialog_erc.h:122
DIALOG_ERC(SCH_EDIT_FRAME *parent)
bool m_scroll_on_crossprobe
Definition dialog_erc.h:123
void testErc()
void SelectMarker(const SCH_MARKER *aMarker)
bool updateUI() override
SCH_EDIT_FRAME * m_parent
Definition dialog_erc.h:108
wxString m_violationsTitleTemplate
Definition dialog_erc.h:111
void OnERCItemRClick(wxDataViewEvent &aEvent) override
void centerMarkerIdleHandler(wxIdleEvent &aEvent)
void DeleteAllMarkers(bool aIncludeExclusions)
void OnDeleteAllClick(wxCommandEvent &event) override
void OnLinkClicked(wxHtmlLinkEvent &event) override
void OnCharHook(wxKeyEvent &aEvt) override
void OnRunERCClick(wxCommandEvent &event) override
wxString m_ignoredTitleTemplate
Definition dialog_erc.h:112
void OnDeleteOneClick(wxCommandEvent &event) override
void UpdateData()
void OnSaveReport(wxCommandEvent &aEvent) override
int getSeverities()
void PrevMarker()
void NextMarker()
SCHEMATIC * m_currentSchematic
Definition dialog_erc.h:109
void OnEditViolationSeverities(wxHyperlinkEvent &aEvent) override
void UpdateAnnotationWarning()
void redrawDrawPanel()
void Report(const wxString &aMessage) override
Display aMessage in the progress bar dialog.
void OnERCItemSelected(wxDataViewEvent &aEvent) override
RC_TREE_MODEL * m_markerTreeModel
Definition dialog_erc.h:115
void updateDisplayedCounts()
void OnSeverity(wxCommandEvent &aEvent) override
bool m_running
Definition dialog_erc.h:117
bool m_showAllErrors
Definition dialog_erc.h:124
void OnCloseErcDialog(wxCloseEvent &event) override
void OnCancelClick(wxCommandEvent &event) override
virtual void AdvancePhase() override
Use the next available virtual zone of the dialog progress bar.
Provide an abstract interface of a RC_ITEM* list manager.
Definition rc_item.h:51
Holds all the data relating to one schematic.
Definition schematic.h:149
Schematic editor (Eeschema) main window.
wxDECLARE_EVENT(EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent)
Event sent to parent when dialog is mode-less.