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-2012 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 
32 #include <fctsys.h>
33 #include <pcbnew.h>
34 #include <class_drawpanel.h>
35 #include <drc.h>
36 #include <class_marker_pcb.h>
37 #include <class_board.h>
38 
39 #include <dialog_drc_base.h>
40 #include <dialog_drclistbox.h>
41 #include <widgets/unit_binder.h>
42 
43 // forward declarations
44 class DRCLISTBOX;
46 
47 //end forward declarations
48 
54 {
55 public:
57 
59  DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
61 
67  void SetRptSettings( bool aEnable, const wxString& aFileName );
68 
69  void GetRptSettings( bool* aEnable, wxString& aFileName );
70 
71  void UpdateDisplayedCounts();
72 
73 
74 private:
82  bool writeReport( const wxString& aFullFileName );
83 
89  const wxString makeValidFileNameReport();
90 
91  void InitValues( );
92 
93  void DisplayDRCValues( );
94 
95  void SetDrcParmeters( );
96 
98  void OnReportCheckBoxClicked( wxCommandEvent& event ) override;
99 
101  void OnReportFilenameEdited( wxCommandEvent &event ) override;
102 
104  void OnButtonBrowseRptFileClick( wxCommandEvent& event ) override;
105 
107  void OnStartdrcClick( wxCommandEvent& event ) override;
108 
110  void OnListUnconnectedClick( wxCommandEvent& event ) override;
111 
113  void OnDeleteAllClick( wxCommandEvent& event ) override;
114 
116  void OnDeleteOneClick( wxCommandEvent& event ) override;
117 
119  void OnLeftDClickClearance( wxMouseEvent& event ) override;
120 
122  void OnRightUpClearance( wxMouseEvent& event ) override;
123 
125  void OnLeftDClickUnconnected( wxMouseEvent& event ) override;
126 
128  void OnRightUpUnconnected( wxMouseEvent& event ) override;
129 
131  void OnCancelClick( wxCommandEvent& event ) override;
132 
135  void OnActivateDlg( wxActivateEvent& event ) override;
136 
137  void OnMarkerSelectionEvent( wxCommandEvent& event ) override;
138  void OnUnconnectedSelectionEvent( wxCommandEvent& event ) override;
139  void OnChangingMarkerList( wxNotebookEvent& event ) override;
140 
141  void DelDRCMarkers();
142  void RedrawDrawPanel();
143 
146  void doSelectionMenu( const DRC_ITEM* aItem );
147 
148  BOARD* m_currentBoard; // the board currently on test
151  wxConfigBase* m_config;
152 
155 
159 };
160 
161 #endif // _DIALOG_DRC_H_
162 
DIALOG_DRC_CONTROL(DRC *aTester, PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
Definition: dialog_drc.cpp:86
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:692
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:519
void OnUnconnectedSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:549
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:447
Class BOARD to handle a board.
void OnStartdrcClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC
Definition: dialog_drc.cpp:220
void GetRptSettings(bool *aEnable, wxString &aFileName)
Definition: dialog_drc.cpp:213
void OnActivateDlg(wxActivateEvent &event) override
handler for activate event, updating data which can be modified outside the dialog (DRC parameters) ...
Definition: dialog_drc.cpp:146
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:596
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:397
UNIT_BINDER m_viaMinSize
Definition: dialog_drc.h:157
void OnDeleteAllClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL
Definition: dialog_drc.cpp:283
void OnListUnconnectedClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED
Definition: dialog_drc.cpp:291
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:56
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:154
Class DIALOG_DRC_CONTROL_BASE.
Markers used to show a drc problem on boards.
wxString m_markersTitleTemplate
Definition: dialog_drc.h:153
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:474
wxConfigBase * m_config
Definition: dialog_drc.h:151
void OnReportCheckBoxClicked(wxCommandEvent &event) override
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_RPT_FILE
Definition: dialog_drc.cpp:384
UNIT_BINDER m_uviaMinSize
Definition: dialog_drc.h:158
void OnCancelClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
Definition: dialog_drc.cpp:373
UNIT_BINDER m_trackMinWidth
Definition: dialog_drc.h:156
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:356
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:618
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:657
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
Design Rule Checker object that performs all the DRC tests.
Definition: drc.h:164
void doSelectionMenu(const DRC_ITEM *aItem)
Run the SELECTION_TOOL&#39;s disambiguation menu to highlight the two BOARD_ITEMs in the DRC_ITEM...
Definition: dialog_drc.cpp:458
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:436
void OnChangingMarkerList(wxNotebookEvent &event) override
Definition: dialog_drc.cpp:508
void OnReportFilenameEdited(wxCommandEvent &event) override
wxEVT_COMMAND_TEXT_UPDATED event handler for m_RptFilenameCtrl
Definition: dialog_drc.cpp:391
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
BOARD * m_currentBoard
Definition: dialog_drc.h:148
void SetRptSettings(bool aEnable, const wxString &aFileName)
Enable/disable the report file creation.
Definition: dialog_drc.cpp:206
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.