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 <wx/htmllbox.h>
24
25#include <dialog_erc_base.h>
27
28
32wxDECLARE_EVENT( EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent );
33
34
35#define DIALOG_ERC_WINDOW_NAME "DialogErcWindowName"
36
37
38class SCH_MARKER;
39
40
42{
43public:
44 DIALOG_ERC( SCH_EDIT_FRAME* parent );
46
47 bool TransferDataToWindow() override;
48
49 // PROGRESS_REPORTER_BASE calls
50 bool updateUI() override;
51 void AdvancePhase( const wxString& aMessage ) override;
52 void Report( const wxString& aMessage ) override;
53
54 void PrevMarker();
55 void NextMarker();
56 void SelectMarker( const SCH_MARKER* aMarker );
57
64 void ExcludeMarker( SCH_MARKER* aMarker = nullptr );
65
66 void UpdateData();
68
69private:
70 int getSeverities();
71
72 // from DIALOG_ERC_BASE:
73 void OnMenu( wxCommandEvent& aEvent ) override;
74 void OnCharHook( wxKeyEvent& aEvt ) override;
75 void OnCloseErcDialog( wxCloseEvent& event ) override;
76 void OnRunERCClick( wxCommandEvent& event ) override;
77 void OnDeleteOneClick( wxCommandEvent& event ) override;
78 void OnDeleteAllClick( wxCommandEvent& event ) override;
79 void OnERCItemSelected( wxDataViewEvent& aEvent ) override;
80 void OnERCItemDClick( wxDataViewEvent& aEvent ) override;
81 void OnERCItemRClick( wxDataViewEvent& aEvent ) override;
82 void OnIgnoredItemRClick( wxListEvent& aEvent ) override;
83 void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
84
85 void OnLinkClicked( wxHtmlLinkEvent& event ) override;
86
87 void OnSeverity( wxCommandEvent& aEvent ) override;
88 void OnSaveReport( wxCommandEvent& aEvent ) override;
89 void OnCancelClick( wxCommandEvent& event ) override;
90
91 void centerMarkerIdleHandler( wxIdleEvent& aEvent );
92
93 void redrawDrawPanel();
94
95 void testErc();
96
97 void deleteAllMarkers( bool aIncludeExclusions );
98
101
102private:
105
108
109 std::shared_ptr<RC_ITEMS_PROVIDER> m_markerProvider;
110 RC_TREE_MODEL* m_markerTreeModel; // wx reference-counted ptr
111
114
116
120};
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:115
void OnERCItemDClick(wxDataViewEvent &aEvent) override
std::shared_ptr< RC_ITEMS_PROVIDER > m_markerProvider
Definition dialog_erc.h:109
bool TransferDataToWindow() override
void syncCheckboxes()
bool m_ercRun
Definition dialog_erc.h:113
bool m_crossprobe
Definition dialog_erc.h:117
DIALOG_ERC(SCH_EDIT_FRAME *parent)
bool m_scroll_on_crossprobe
Definition dialog_erc.h:118
void testErc()
void SelectMarker(const SCH_MARKER *aMarker)
bool updateUI() override
SCH_EDIT_FRAME * m_parent
Definition dialog_erc.h:103
wxString m_violationsTitleTemplate
Definition dialog_erc.h:106
void OnERCItemRClick(wxDataViewEvent &aEvent) override
void centerMarkerIdleHandler(wxIdleEvent &aEvent)
void OnDeleteAllClick(wxCommandEvent &event) override
void OnLinkClicked(wxHtmlLinkEvent &event) override
void OnCharHook(wxKeyEvent &aEvt) override
void OnRunERCClick(wxCommandEvent &event) override
void deleteAllMarkers(bool aIncludeExclusions)
wxString m_ignoredTitleTemplate
Definition dialog_erc.h:107
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:104
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:110
void updateDisplayedCounts()
void OnSeverity(wxCommandEvent &aEvent) override
bool m_running
Definition dialog_erc.h:112
bool m_showAllErrors
Definition dialog_erc.h:119
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.
Holds all the data relating to one schematic.
Definition schematic.h:90
Schematic editor (Eeschema) main window.
wxDECLARE_EVENT(EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent)
Event sent to parent when dialog is mode-less.