2012-08-03 15:43:15 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
|
|
|
* Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com
|
2022-08-30 11:03:40 +00:00
|
|
|
* Copyright (C) 2004-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2012-08-03 15:43:15 +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-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#ifndef _DIALOG_DRC_H_
|
|
|
|
#define _DIALOG_DRC_H_
|
|
|
|
|
2024-03-30 03:31:51 +00:00
|
|
|
#include <chrono>
|
2009-06-18 13:30:52 +00:00
|
|
|
#include <wx/htmllbox.h>
|
2020-03-16 11:05:01 +00:00
|
|
|
#include <rc_item.h>
|
2020-11-14 18:11:28 +00:00
|
|
|
#include <pcb_marker.h>
|
2020-11-12 20:19:22 +00:00
|
|
|
#include <board.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_drc_base.h>
|
2021-08-14 20:05:21 +00:00
|
|
|
#include <widgets/progress_reporter_base.h>
|
2007-11-27 01:34:35 +00:00
|
|
|
|
2020-02-27 22:00:14 +00:00
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
class BOARD_DESIGN_SETTINGS;
|
|
|
|
|
|
|
|
|
2022-02-04 22:44:59 +00:00
|
|
|
#define DIALOG_DRC_WINDOW_NAME wxT( "DialogDrcWindowName" )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2020-02-27 22:00:14 +00:00
|
|
|
class
|
2021-08-14 20:05:21 +00:00
|
|
|
DIALOG_DRC: public DIALOG_DRC_BASE, PROGRESS_REPORTER_BASE
|
2007-11-27 01:34:35 +00:00
|
|
|
{
|
2009-06-18 13:30:52 +00:00
|
|
|
public:
|
|
|
|
/// Constructors
|
2020-09-14 17:54:14 +00:00
|
|
|
DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
|
2020-03-16 11:05:01 +00:00
|
|
|
~DIALOG_DRC();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2022-08-30 11:03:40 +00:00
|
|
|
/**
|
|
|
|
* Called after running DRC. It's main function is prevent showing potentially-false-0
|
|
|
|
* counts before DRC has been run.
|
|
|
|
*/
|
2020-09-16 20:38:23 +00:00
|
|
|
void SetDrcRun() { m_drcRun = true; }
|
2022-08-30 11:03:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called after running Footprint Tests. It's main function is to update the Footprint
|
|
|
|
* Warnings tab title.
|
|
|
|
*/
|
2020-09-16 20:38:23 +00:00
|
|
|
void SetFootprintTestsRun() { m_footprintTestsRun = true; }
|
|
|
|
|
2022-08-30 11:03:40 +00:00
|
|
|
/**
|
|
|
|
* Rebuild the contents of the violation tabs based on the current markers and severties.
|
|
|
|
*/
|
|
|
|
void UpdateData();
|
2016-09-08 18:17:37 +00:00
|
|
|
|
2020-12-01 22:35:11 +00:00
|
|
|
void PrevMarker();
|
|
|
|
void NextMarker();
|
2021-10-05 22:33:30 +00:00
|
|
|
void SelectMarker( const PCB_MARKER* aMarker );
|
2021-07-11 17:04:57 +00:00
|
|
|
|
2020-12-01 22:35:11 +00:00
|
|
|
void ExcludeMarker();
|
|
|
|
|
2009-06-18 13:30:52 +00:00
|
|
|
private:
|
2020-02-27 22:00:14 +00:00
|
|
|
void syncCheckboxes();
|
2020-02-28 00:05:40 +00:00
|
|
|
void updateDisplayedCounts();
|
2007-12-03 05:14:51 +00:00
|
|
|
|
2020-02-28 00:05:40 +00:00
|
|
|
void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
|
|
|
|
void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
|
|
|
|
void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
|
2024-05-13 16:09:30 +00:00
|
|
|
void OnIgnoredItemRClick( wxListEvent& event ) override;
|
2022-08-30 11:03:40 +00:00
|
|
|
void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
|
2019-03-28 19:30:51 +00:00
|
|
|
|
2020-02-28 00:05:40 +00:00
|
|
|
void OnSeverity( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnSaveReport( wxCommandEvent& aEvent ) override;
|
2020-02-27 22:00:14 +00:00
|
|
|
|
2020-02-28 00:05:40 +00:00
|
|
|
void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnRunDRCClick( wxCommandEvent& aEvent ) override;
|
2020-09-18 19:57:54 +00:00
|
|
|
|
2020-10-17 19:15:26 +00:00
|
|
|
void OnErrorLinkClicked( wxHtmlLinkEvent& event ) override;
|
|
|
|
|
2020-09-18 19:57:54 +00:00
|
|
|
// These require special handling while the DRC tests are running.
|
2020-02-28 00:05:40 +00:00
|
|
|
void OnCancelClick( wxCommandEvent& aEvent ) override;
|
2020-09-18 19:57:54 +00:00
|
|
|
void OnClose( wxCloseEvent& event ) override;
|
2007-11-13 09:35:39 +00:00
|
|
|
|
2022-08-30 11:03:40 +00:00
|
|
|
// Updates data which can be modified outside the dialog.
|
2020-02-28 00:05:40 +00:00
|
|
|
void OnActivateDlg( wxActivateEvent& aEvent ) override;
|
2016-04-15 18:15:22 +00:00
|
|
|
|
2020-02-28 00:05:40 +00:00
|
|
|
void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
|
2007-11-27 01:34:35 +00:00
|
|
|
|
2020-08-02 21:45:06 +00:00
|
|
|
void deleteAllMarkers( bool aIncludeExclusions );
|
2021-04-08 17:13:48 +00:00
|
|
|
void refreshEditor();
|
2007-12-04 20:44:41 +00:00
|
|
|
|
2020-09-16 15:03:55 +00:00
|
|
|
// PROGRESS_REPORTER calls
|
|
|
|
bool updateUI() override;
|
|
|
|
void AdvancePhase( const wxString& aMessage ) override;
|
|
|
|
|
2020-05-15 23:25:33 +00:00
|
|
|
BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }
|
|
|
|
|
2020-03-16 11:05:01 +00:00
|
|
|
BOARD* m_currentBoard; // the board currently on test
|
2021-04-08 17:13:48 +00:00
|
|
|
PCB_EDIT_FRAME* m_frame;
|
2020-09-18 19:57:54 +00:00
|
|
|
bool m_running;
|
2020-09-14 17:54:14 +00:00
|
|
|
bool m_drcRun;
|
|
|
|
bool m_footprintTestsRun;
|
2018-02-03 09:09:53 +00:00
|
|
|
|
2020-03-16 11:05:01 +00:00
|
|
|
wxString m_markersTitleTemplate;
|
|
|
|
wxString m_unconnectedTitleTemplate;
|
|
|
|
wxString m_footprintsTitleTemplate;
|
2021-07-11 21:47:19 +00:00
|
|
|
wxString m_ignoredTitleTemplate;
|
2018-02-03 09:09:53 +00:00
|
|
|
|
2022-08-30 11:03:40 +00:00
|
|
|
std::shared_ptr<RC_ITEMS_PROVIDER> m_markersProvider;
|
|
|
|
std::shared_ptr<RC_ITEMS_PROVIDER> m_ratsnestProvider;
|
|
|
|
std::shared_ptr<RC_ITEMS_PROVIDER> m_fpWarningsProvider;
|
2020-02-28 00:05:40 +00:00
|
|
|
|
2022-08-30 11:03:40 +00:00
|
|
|
RC_TREE_MODEL* m_markersTreeModel; // wx reference-counted ptr
|
|
|
|
RC_TREE_MODEL* m_unconnectedTreeModel; // wx reference-counted ptr
|
|
|
|
RC_TREE_MODEL* m_fpWarningsTreeModel; // wx reference-counted ptr
|
2020-02-27 22:00:14 +00:00
|
|
|
|
2022-08-30 11:03:40 +00:00
|
|
|
int m_severities; // A mask of SEVERITY flags
|
2024-03-30 03:31:51 +00:00
|
|
|
|
|
|
|
/// Used to slow down the rate of yields in updateUi()
|
|
|
|
std::chrono::steady_clock::time_point m_lastUpdateUi;
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2007-11-27 01:34:35 +00:00
|
|
|
#endif // _DIALOG_DRC_H_
|
|
|
|
|