2014-10-21 15:48:00 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2022-01-22 21:34:01 +00:00
|
|
|
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-10-21 15:48:00 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#ifndef _DIALOG_ERC_H_
|
|
|
|
#define _DIALOG_ERC_H_
|
|
|
|
|
2009-07-08 15:42:45 +00:00
|
|
|
#include <wx/htmllbox.h>
|
|
|
|
#include <vector>
|
2016-02-28 17:33:29 +00:00
|
|
|
#include <lib_pin.h> // For PINTYPE_COUNT definition
|
2009-07-08 15:42:45 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_erc_base.h>
|
2021-08-14 20:05:21 +00:00
|
|
|
#include <widgets/progress_reporter_base.h>
|
2019-03-11 21:32:05 +00:00
|
|
|
#include <erc_settings.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2021-11-29 13:41:02 +00:00
|
|
|
#define DIALOG_ERC_WINDOW_NAME "DialogErcWindowName"
|
|
|
|
|
|
|
|
|
2021-12-30 16:51:04 +00:00
|
|
|
class SCH_MARKER;
|
|
|
|
|
|
|
|
|
2021-08-14 20:05:21 +00:00
|
|
|
class DIALOG_ERC : public DIALOG_ERC_BASE, PROGRESS_REPORTER_BASE
|
2009-07-05 12:09:41 +00:00
|
|
|
{
|
2007-06-05 12:10:51 +00:00
|
|
|
public:
|
2010-12-08 20:12:46 +00:00
|
|
|
DIALOG_ERC( SCH_EDIT_FRAME* parent );
|
2020-03-16 11:05:01 +00:00
|
|
|
~DIALOG_ERC();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2021-08-14 20:05:21 +00:00
|
|
|
// PROGRESS_REPORTER_BASE calls
|
2020-10-19 14:17:49 +00:00
|
|
|
bool updateUI() override;
|
|
|
|
void AdvancePhase( const wxString& aMessage ) override;
|
|
|
|
void Report( const wxString& aMessage ) override;
|
|
|
|
|
2020-12-01 22:35:11 +00:00
|
|
|
void PrevMarker();
|
|
|
|
void NextMarker();
|
2022-04-16 23:22:27 +00:00
|
|
|
void SelectMarker( const SCH_MARKER* aMarker );
|
2021-12-30 16:51:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exclude aMarker from the ERC list. If aMarker is nullptr, exclude the selected marker
|
|
|
|
* in this dialog.
|
|
|
|
*
|
|
|
|
* @param aMarker aMarker to exclude
|
|
|
|
*/
|
|
|
|
void ExcludeMarker( SCH_MARKER* aMarker = nullptr );
|
2020-12-01 22:35:11 +00:00
|
|
|
|
2021-11-29 13:41:02 +00:00
|
|
|
void UpdateAnnotationWarning();
|
|
|
|
|
2012-12-10 19:08:09 +00:00
|
|
|
private:
|
|
|
|
// from DIALOG_ERC_BASE:
|
2018-08-06 20:30:49 +00:00
|
|
|
void OnCloseErcDialog( wxCloseEvent& event ) override;
|
2020-03-16 11:05:01 +00:00
|
|
|
void OnRunERCClick( wxCommandEvent& event ) override;
|
2022-01-22 21:34:01 +00:00
|
|
|
void OnDeleteOneClick( wxCommandEvent& event ) override;
|
|
|
|
void OnDeleteAllClick( wxCommandEvent& event ) override;
|
2020-03-16 11:05:01 +00:00
|
|
|
void OnERCItemSelected( wxDataViewEvent& aEvent ) override;
|
|
|
|
void OnERCItemDClick( wxDataViewEvent& aEvent ) override;
|
|
|
|
void OnERCItemRClick( wxDataViewEvent& aEvent ) override;
|
2022-01-22 21:34:01 +00:00
|
|
|
void OnIgnoreItemRClick( wxListEvent& event ) override;
|
|
|
|
|
2020-10-19 14:17:49 +00:00
|
|
|
void OnLinkClicked( wxHtmlLinkEvent& event ) override;
|
2020-03-16 11:05:01 +00:00
|
|
|
|
|
|
|
void OnSeverity( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnSaveReport( wxCommandEvent& aEvent ) override;
|
2020-10-19 14:17:49 +00:00
|
|
|
void OnCancelClick( wxCommandEvent& event ) override;
|
2015-09-10 12:03:16 +00:00
|
|
|
|
2022-04-16 23:22:27 +00:00
|
|
|
void centerMarkerIdleHandler( wxIdleEvent& aEvent );
|
|
|
|
|
2020-09-21 10:37:20 +00:00
|
|
|
void redrawDrawPanel();
|
2018-11-14 23:34:32 +00:00
|
|
|
|
2020-10-19 14:17:49 +00:00
|
|
|
void testErc();
|
2012-11-30 12:28:23 +00:00
|
|
|
|
2020-03-16 11:05:01 +00:00
|
|
|
bool writeReport( const wxString& aFullFileName );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2020-08-02 21:45:06 +00:00
|
|
|
void deleteAllMarkers( bool aIncludeExclusions );
|
2020-03-16 11:05:01 +00:00
|
|
|
|
|
|
|
void syncCheckboxes();
|
|
|
|
void updateDisplayedCounts();
|
2021-03-21 17:31:23 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SCH_EDIT_FRAME* m_parent;
|
2022-06-28 03:06:46 +00:00
|
|
|
SCHEMATIC* m_currentSchematic;
|
2021-03-21 17:31:23 +00:00
|
|
|
|
2022-01-22 21:34:01 +00:00
|
|
|
wxString m_violationsTitleTemplate;
|
|
|
|
wxString m_ignoredTitleTemplate;
|
|
|
|
|
2022-08-30 11:03:40 +00:00
|
|
|
std::shared_ptr<RC_ITEMS_PROVIDER> m_markerProvider;
|
|
|
|
RC_TREE_MODEL* m_markerTreeModel; // wx reference-counted ptr
|
2021-03-21 17:31:23 +00:00
|
|
|
|
|
|
|
bool m_running;
|
|
|
|
bool m_ercRun;
|
|
|
|
|
2022-04-16 23:22:27 +00:00
|
|
|
const SCH_MARKER* m_centerMarkerOnIdle;
|
|
|
|
|
2021-03-21 17:31:23 +00:00
|
|
|
int m_severities;
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
2009-07-08 15:42:45 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#endif
|
2009-07-08 15:42:45 +00:00
|
|
|
|
|
|
|
// _DIALOG_ERC_H_
|