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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#pragma once
26
27#include <wx/htmllbox.h>
28
29#include <dialog_erc_base.h>
31
32
36wxDECLARE_EVENT( EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent );
37
38
39#define DIALOG_ERC_WINDOW_NAME "DialogErcWindowName"
40
41
42class SCH_MARKER;
43
44
46{
47public:
48 DIALOG_ERC( SCH_EDIT_FRAME* parent );
50
51 bool TransferDataToWindow() override;
52
53 // PROGRESS_REPORTER_BASE calls
54 bool updateUI() override;
55 void AdvancePhase( const wxString& aMessage ) override;
56 void Report( const wxString& aMessage ) override;
57
58 void PrevMarker();
59 void NextMarker();
60 void SelectMarker( const SCH_MARKER* aMarker );
61
68 void ExcludeMarker( SCH_MARKER* aMarker = nullptr );
69
70 void UpdateData();
72
73private:
74 int getSeverities();
75
76 // from DIALOG_ERC_BASE:
77 void OnMenu( wxCommandEvent& aEvent ) override;
78 void OnCharHook( wxKeyEvent& aEvt ) override;
79 void OnCloseErcDialog( wxCloseEvent& event ) override;
80 void OnRunERCClick( wxCommandEvent& event ) override;
81 void OnDeleteOneClick( wxCommandEvent& event ) override;
82 void OnDeleteAllClick( wxCommandEvent& event ) override;
83 void OnERCItemSelected( wxDataViewEvent& aEvent ) override;
84 void OnERCItemDClick( wxDataViewEvent& aEvent ) override;
85 void OnERCItemRClick( wxDataViewEvent& aEvent ) override;
86 void OnIgnoredItemRClick( wxListEvent& aEvent ) override;
87 void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
88
89 void OnLinkClicked( wxHtmlLinkEvent& event ) override;
90
91 void OnSeverity( wxCommandEvent& aEvent ) override;
92 void OnSaveReport( wxCommandEvent& aEvent ) override;
93 void OnCancelClick( wxCommandEvent& event ) override;
94
95 void centerMarkerIdleHandler( wxIdleEvent& aEvent );
96
97 void redrawDrawPanel();
98
99 void testErc();
100
101 void deleteAllMarkers( bool aIncludeExclusions );
102
105
106private:
109
112
113 std::shared_ptr<RC_ITEMS_PROVIDER> m_markerProvider;
114 RC_TREE_MODEL* m_markerTreeModel; // wx reference-counted ptr
115
118
120
123};
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:119
void OnERCItemDClick(wxDataViewEvent &aEvent) override
std::shared_ptr< RC_ITEMS_PROVIDER > m_markerProvider
Definition dialog_erc.h:113
bool TransferDataToWindow() override
void syncCheckboxes()
bool m_ercRun
Definition dialog_erc.h:117
bool m_crossprobe
Definition dialog_erc.h:121
DIALOG_ERC(SCH_EDIT_FRAME *parent)
bool m_scroll_on_crossprobe
Definition dialog_erc.h:122
void testErc()
void SelectMarker(const SCH_MARKER *aMarker)
bool updateUI() override
SCH_EDIT_FRAME * m_parent
Definition dialog_erc.h:107
wxString m_violationsTitleTemplate
Definition dialog_erc.h:110
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:111
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:108
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:114
void updateDisplayedCounts()
void OnSeverity(wxCommandEvent &aEvent) override
bool m_running
Definition dialog_erc.h:116
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:88
Schematic editor (Eeschema) main window.
wxDECLARE_EVENT(EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent)
Event sent to parent when dialog is mode-less.