KiCad PCB EDA Suite
dialog_drc.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) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com
6  * Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 
27 #ifndef _DIALOG_DRC_H_
28 #define _DIALOG_DRC_H_
29 
30 #include <wx/htmllbox.h>
31 #include <fctsys.h>
32 #include <pcbnew.h>
33 #include <tools/drc.h>
34 #include <class_marker_pcb.h>
35 #include <class_board.h>
36 #include <dialog_drc_base.h>
37 #include <dialog_drclistbox.h>
38 #include <widgets/unit_binder.h>
39 
40 // forward declarations
41 class DRCLISTBOX;
43 
44 //end forward declarations
45 
49 #define DIALOG_DRC_WINDOW_NAME "DialogDrcWindowName"
50 
52 {
53 public:
55 
57  DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
59 
65  void SetRptSettings( bool aEnable, const wxString& aFileName );
66 
67  void GetRptSettings( bool* aEnable, wxString& aFileName );
68 
69  void UpdateDisplayedCounts();
70 
71 
72 private:
80  bool writeReport( const wxString& aFullFileName );
81 
87  const wxString makeValidFileNameReport();
88 
89  void InitValues( );
90 
91  void DisplayDRCValues( );
92 
93  void SetDRCParameters( );
94 
97  int rightUpClicSelection( DRCLISTBOX* aListBox, wxMouseEvent& event );
98 
100  void OnReportCheckBoxClicked( wxCommandEvent& event ) override;
101 
103  void OnReportFilenameEdited( wxCommandEvent &event ) override;
104 
106  void OnButtonBrowseRptFileClick( wxCommandEvent& event ) override;
107 
109  void OnStartdrcClick( wxCommandEvent& event ) override;
110 
112  void OnDeleteAllClick( wxCommandEvent& event ) override;
113 
115  void OnDeleteOneClick( wxCommandEvent& event ) override;
116 
118  void OnLeftDClickClearance( wxMouseEvent& event ) override;
119 
121  void OnLeftUpClearance( wxMouseEvent& event ) override;
122 
124  void OnRightUpClearance( wxMouseEvent& event ) override;
125 
127  void OnLeftDClickUnconnected( wxMouseEvent& event ) override;
128 
130  void OnLeftUpUnconnected( wxMouseEvent& event ) override;
131 
133  void OnRightUpUnconnected( wxMouseEvent& event ) override;
134 
136  void OnLeftDClickFootprints( wxMouseEvent& event ) override;
137 
139  void OnRightUpFootprints( wxMouseEvent& event ) override;
140 
142  void OnCancelClick( wxCommandEvent& event ) override;
143 
146  void OnActivateDlg( wxActivateEvent& event ) override;
147 
148  void OnMarkerSelectionEvent( wxCommandEvent& event ) override;
149  void OnUnconnectedSelectionEvent( wxCommandEvent& event ) override;
150  void OnFootprintsSelectionEvent( wxCommandEvent& event ) override;
151  void OnChangingMarkerList( wxNotebookEvent& event ) override;
152 
153  void DelDRCMarkers();
154  void RedrawDrawPanel();
155 
158  void doSelectionMenu( const DRC_ITEM* aItem );
159 
160  bool focusOnItem( const DRC_ITEM* aItem );
161 
162  BOARD* m_currentBoard; // the board currently on test
165  wxConfigBase* m_config;
166 
170 
174 };
175 
176 #endif // _DIALOG_DRC_H_
177 
DIALOG_DRC_CONTROL(DRC *aTester, PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
Definition: dialog_drc.cpp:50
void OnLeftUpClearance(wxMouseEvent &event) override
wxEVT_LEFT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:306
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:655
void OnLeftUpUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_UP event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:451
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.
Definition: drc_item.h:48
void OnMarkerSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:472
void OnUnconnectedSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:489
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:372
void OnStartdrcClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC
Definition: dialog_drc.cpp:168
void GetRptSettings(bool *aEnable, wxString &aFileName)
Definition: dialog_drc.cpp:161
void OnRightUpFootprints(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_FOOTPRINTS_LIST
Definition: dialog_drc.cpp:297
void OnActivateDlg(wxActivateEvent &event) override
handler for activate event, updating data which can be modified outside the dialog (DRC parameters)
Definition: dialog_drc.cpp:90
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:542
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:278
UNIT_BINDER m_viaMinSize
Definition: dialog_drc.h:172
void OnDeleteAllClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL
Definition: dialog_drc.cpp:229
void OnLeftDClickFootprints(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_FOOTPRINTS_LIST
Definition: dialog_drc.cpp:413
void OnFootprintsSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:506
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:54
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:168
Class DIALOG_DRC_CONTROL_BASE.
Markers used to show a drc problem on boards.
wxString m_footprintsTitleTemplate
Definition: dialog_drc.h:169
wxString m_markersTitleTemplate
Definition: dialog_drc.h:167
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:432
bool focusOnItem(const DRC_ITEM *aItem)
Definition: dialog_drc.cpp:315
int rightUpClicSelection(DRCLISTBOX *aListBox, wxMouseEvent &event)
Definition: dialog_drc.cpp:339
wxConfigBase * m_config
Definition: dialog_drc.h:165
void OnReportCheckBoxClicked(wxCommandEvent &event) override
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_RPT_FILE
Definition: dialog_drc.cpp:265
UNIT_BINDER m_uviaMinSize
Definition: dialog_drc.h:173
void OnCancelClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
Definition: dialog_drc.cpp:254
UNIT_BINDER m_trackMinWidth
Definition: dialog_drc.h:171
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:237
bool writeReport(const wxString &aFullFileName)
Function writeReport outputs the MARKER items and unconnecte DRC_ITEMs with commentary to an open tex...
Definition: dialog_drc.cpp:564
Class DRCLISTBOX is used to display a DRC_ITEM_LIST.
void OnDeleteOneClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE
Definition: dialog_drc.cpp:603
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
Design Rule Checker object that performs all the DRC tests.
Definition: drc.h:186
void doSelectionMenu(const DRC_ITEM *aItem)
Run the SELECTION_TOOL's disambiguation menu to highlight the two BOARD_ITEMs in the DRC_ITEM.
Definition: dialog_drc.cpp:382
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
void OnRightUpUnconnected(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:362
void OnChangingMarkerList(wxNotebookEvent &event) override
Definition: dialog_drc.cpp:460
void OnReportFilenameEdited(wxCommandEvent &event) override
wxEVT_COMMAND_TEXT_UPDATED event handler for m_RptFilenameCtrl
Definition: dialog_drc.cpp:272
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:164
BOARD * m_currentBoard
Definition: dialog_drc.h:162
void SetRptSettings(bool aEnable, const wxString &aFileName)
Enable/disable the report file creation.
Definition: dialog_drc.cpp:154
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.