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 change_log.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 <wxstruct.h>
36 #include <drc_stuff.h>
37 #include <class_marker_pcb.h>
38 #include <class_board.h>
39 
40 #include <dialog_drc_base.h>
41 #include <dialog_drclistbox.h>
42 
43 
44 // forward declarations
45 class DRCLISTBOX;
47 
48 //end forward declarations
49 
55 {
56 public:
58 
60  DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
62 
68  void SetRptSettings( bool aEnable, const wxString& aFileName );
69 
70  void GetRptSettings( bool* aEnable, wxString& aFileName );
71 
72  void UpdateDisplayedCounts();
73 
74 
75 private:
83  bool writeReport( const wxString& aFullFileName );
84 
90  const wxString makeValidFileNameReport();
91 
92  void InitValues( );
93 
94  void DisplayDRCValues( );
95 
96  void SetDrcParmeters( );
97 
99  void OnReportCheckBoxClicked( wxCommandEvent& event ) override;
100 
102  void OnButtonBrowseRptFileClick( wxCommandEvent& event ) override;
103 
105  void OnStartdrcClick( wxCommandEvent& event ) override;
106 
108  void OnListUnconnectedClick( wxCommandEvent& event ) override;
109 
111  void OnDeleteAllClick( wxCommandEvent& event ) override;
112 
114  void OnDeleteOneClick( wxCommandEvent& event ) override;
115 
117  void OnLeftDClickClearance( wxMouseEvent& event ) override;
118 
120  void OnRightUpClearance( wxMouseEvent& event ) override;
121 
123  void OnLeftDClickUnconnected( wxMouseEvent& event ) override;
124 
126  void OnRightUpUnconnected( wxMouseEvent& event ) override;
127 
129  void OnCancelClick( wxCommandEvent& event ) override;
130 
132  void OnOkClick( wxCommandEvent& event ) override;
133 
136  void OnActivateDlg( wxActivateEvent& event ) override;
137 
138  void OnMarkerSelectionEvent( wxCommandEvent& event ) override;
139  void OnUnconnectedSelectionEvent( wxCommandEvent& event ) override;
140  void OnChangingMarkerList( wxNotebookEvent& event ) override;
141 
142  void DelDRCMarkers();
143  void RedrawDrawPanel();
144 
145  void OnPopupMenu( wxCommandEvent& event );
146 
147  BOARD* m_currentBoard; // the board currently on test
150  wxConfigBase* m_config;
151 };
152 
153 #endif // _DIALOG_DRC_H_
154 
DIALOG_DRC_CONTROL(DRC *aTester, PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
Constructors.
Definition: dialog_drc.cpp:51
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:690
void OnMarkerSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:534
void OnUnconnectedSelectionEvent(wxCommandEvent &event) override
Definition: dialog_drc.cpp:557
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:465
Class BOARD to handle a board.
void OnStartdrcClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC
Definition: dialog_drc.cpp:170
void GetRptSettings(bool *aEnable, wxString &aFileName)
Definition: dialog_drc.cpp:164
void OnActivateDlg(wxActivateEvent &event) override
handler for activate event, updating data which can be modified outside the dialog (DRC parameters) ...
Definition: dialog_drc.cpp:73
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:595
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:356
void OnDeleteAllClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL
Definition: dialog_drc.cpp:234
void OnListUnconnectedClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED
Definition: dialog_drc.cpp:242
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:57
Class DIALOG_DRC_CONTROL_BASE.
Markers used to show a drc problem on boards.
Base window classes and related definitions.
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:493
wxConfigBase * m_config
Definition: dialog_drc.h:150
void OnReportCheckBoxClicked(wxCommandEvent &event) override
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX
Definition: dialog_drc.cpp:349
void OnCancelClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
Definition: dialog_drc.cpp:335
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:307
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:617
Class DRCLISTBOX is used to display a DRC_ITEM_LIST.
void OnPopupMenu(wxCommandEvent &event)
Definition: dialog_drc.cpp:390
void OnDeleteOneClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE
Definition: dialog_drc.cpp:655
void OnOkClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
Definition: dialog_drc.cpp:324
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
Class DRC is the Design Rule Checker, and performs all the DRC tests.
Definition: drc_stuff.h:158
void OnRightUpUnconnected(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:437
void OnChangingMarkerList(wxNotebookEvent &event) override
Definition: dialog_drc.cpp:527
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:149
BOARD * m_currentBoard
Definition: dialog_drc.h:147
void SetRptSettings(bool aEnable, const wxString &aFileName)
Enable/disable the report file creation.
Definition: dialog_drc.cpp:156
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.