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 #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 
51 {
52 public:
54 
56  DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
58 
64  void SetRptSettings( bool aEnable, const wxString& aFileName );
65 
66  void GetRptSettings( bool* aEnable, wxString& aFileName );
67 
68  void UpdateDisplayedCounts();
69 
70 
71 private:
79  bool writeReport( const wxString& aFullFileName );
80 
86  const wxString makeValidFileNameReport();
87 
88  void InitValues( );
89 
90  void DisplayDRCValues( );
91 
92  void SetDrcParmeters( );
93 
95  void OnReportCheckBoxClicked( wxCommandEvent& event ) override;
96 
98  void OnReportFilenameEdited( wxCommandEvent &event ) override;
99 
101  void OnButtonBrowseRptFileClick( wxCommandEvent& event ) override;
102 
104  void OnStartdrcClick( wxCommandEvent& event ) override;
105 
107  void OnDeleteAllClick( wxCommandEvent& event ) override;
108 
110  void OnDeleteOneClick( wxCommandEvent& event ) override;
111 
113  void OnLeftDClickClearance( wxMouseEvent& event ) override;
114 
116  void OnLeftUpClearance( wxMouseEvent& event ) override;
117 
119  void OnRightUpClearance( wxMouseEvent& event ) override;
120 
122  void OnLeftDClickUnconnected( wxMouseEvent& event ) override;
123 
125  void OnLeftUpUnconnected( wxMouseEvent& event ) override;
126 
128  void OnRightUpUnconnected( wxMouseEvent& event ) override;
129 
131  void OnLeftDClickFootprints( wxMouseEvent& event ) override;
132 
134  void OnRightUpFootprints( wxMouseEvent& event ) override;
135 
137  void OnCancelClick( wxCommandEvent& event ) override;
138 
141  void OnActivateDlg( wxActivateEvent& event ) override;
142 
143  void OnMarkerSelectionEvent( wxCommandEvent& event ) override;
144  void OnUnconnectedSelectionEvent( wxCommandEvent& event ) override;
145  void OnFootprintsSelectionEvent( wxCommandEvent& event ) override;
146  void OnChangingMarkerList( wxNotebookEvent& event ) override;
147 
148  void DelDRCMarkers();
149  void RedrawDrawPanel();
150 
153  void doSelectionMenu( const DRC_ITEM* aItem );
154 
155  bool focusOnItem( const DRC_ITEM* aItem );
156 
157  BOARD* m_currentBoard; // the board currently on test
160  wxConfigBase* m_config;
161 
165 
169 };
170 
171 #endif // _DIALOG_DRC_H_
172 
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:352
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:690
void OnLeftUpUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_UP event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:486
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:507
void OnUnconnectedSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:524
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:401
void OnStartdrcClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC
Definition: dialog_drc.cpp:207
void GetRptSettings(bool *aEnable, wxString &aFileName)
Definition: dialog_drc.cpp:200
void OnRightUpFootprints(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_FOOTPRINTS_LIST
Definition: dialog_drc.cpp:336
void OnActivateDlg(wxActivateEvent &event) override
handler for activate event, updating data which can be modified outside the dialog (DRC parameters)
Definition: dialog_drc.cpp:129
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:577
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:317
UNIT_BINDER m_viaMinSize
Definition: dialog_drc.h:167
void OnDeleteAllClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL
Definition: dialog_drc.cpp:268
void OnLeftDClickFootprints(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_FOOTPRINTS_LIST
Definition: dialog_drc.cpp:448
void OnFootprintsSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:541
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:53
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:163
Class DIALOG_DRC_CONTROL_BASE.
Markers used to show a drc problem on boards.
wxString m_footprintsTitleTemplate
Definition: dialog_drc.h:164
wxString m_markersTitleTemplate
Definition: dialog_drc.h:162
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:467
bool focusOnItem(const DRC_ITEM *aItem)
Definition: dialog_drc.cpp:361
wxConfigBase * m_config
Definition: dialog_drc.h:160
void OnReportCheckBoxClicked(wxCommandEvent &event) override
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_RPT_FILE
Definition: dialog_drc.cpp:304
UNIT_BINDER m_uviaMinSize
Definition: dialog_drc.h:168
void OnCancelClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
Definition: dialog_drc.cpp:293
UNIT_BINDER m_trackMinWidth
Definition: dialog_drc.h:166
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:276
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:599
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:638
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:417
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:385
void OnChangingMarkerList(wxNotebookEvent &event) override
Definition: dialog_drc.cpp:495
void OnReportFilenameEdited(wxCommandEvent &event) override
wxEVT_COMMAND_TEXT_UPDATED event handler for m_RptFilenameCtrl
Definition: dialog_drc.cpp:311
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:159
BOARD * m_currentBoard
Definition: dialog_drc.h:157
void SetRptSettings(bool aEnable, const wxString &aFileName)
Enable/disable the report file creation.
Definition: dialog_drc.cpp:193
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.