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 
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 OnButtonBrowseRptFileClick( wxCommandEvent& event ) override;
102 
104  void OnStartdrcClick( wxCommandEvent& event ) override;
105 
107  void OnListUnconnectedClick( wxCommandEvent& event ) override;
108 
110  void OnDeleteAllClick( wxCommandEvent& event ) override;
111 
113  void OnDeleteOneClick( wxCommandEvent& event ) override;
114 
116  void OnLeftDClickClearance( wxMouseEvent& event ) override;
117 
119  void OnRightUpClearance( wxMouseEvent& event ) override;
120 
122  void OnLeftDClickUnconnected( wxMouseEvent& event ) override;
123 
125  void OnRightUpUnconnected( wxMouseEvent& event ) override;
126 
128  void OnCancelClick( wxCommandEvent& event ) override;
129 
131  void OnOkClick( 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 
144  void OnPopupMenu( wxCommandEvent& event );
145 
146  BOARD* m_currentBoard; // the board currently on test
149  wxConfigBase* m_config;
150 };
151 
152 #endif // _DIALOG_DRC_H_
153 
DIALOG_DRC_CONTROL(DRC *aTester, PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
Definition: dialog_drc.cpp:52
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:753
void OnMarkerSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:571
void OnUnconnectedSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:602
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:497
Class BOARD to handle a board.
void OnStartdrcClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC
Definition: dialog_drc.cpp:195
void GetRptSettings(bool *aEnable, wxString &aFileName)
Definition: dialog_drc.cpp:188
void OnActivateDlg(wxActivateEvent &event) override
handler for activate event, updating data which can be modified outside the dialog (DRC parameters) ...
Definition: dialog_drc.cpp:91
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:658
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:381
void OnDeleteAllClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL
Definition: dialog_drc.cpp:261
void OnListUnconnectedClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED
Definition: dialog_drc.cpp:269
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:56
Class DIALOG_DRC_CONTROL_BASE.
Markers used to show a drc problem on boards.
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:523
wxConfigBase * m_config
Definition: dialog_drc.h:149
void OnReportCheckBoxClicked(wxCommandEvent &event) override
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX
Definition: dialog_drc.cpp:374
void OnCancelClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
Definition: dialog_drc.cpp:364
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:336
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:680
Class DRCLISTBOX is used to display a DRC_ITEM_LIST.
void OnPopupMenu(wxCommandEvent &event)
Definition: dialog_drc.cpp:422
void OnDeleteOneClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE
Definition: dialog_drc.cpp:718
void OnOkClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
Definition: dialog_drc.cpp:353
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:162
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:471
void OnChangingMarkerList(wxNotebookEvent &event) override
Definition: dialog_drc.cpp:560
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:148
BOARD * m_currentBoard
Definition: dialog_drc.h:146
void SetRptSettings(bool aEnable, const wxString &aFileName)
Enable/disable the report file creation.
Definition: dialog_drc.cpp:179
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.