KiCad PCB EDA Suite
dialog_gendrill.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) 1992-2019 Jean_Pierre Charras <jp.charras@ujf-grenoble.fr>
5  * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef DIALOG_GENDRILL_H_
26 #define DIALOG_GENDRILL_H_
27 
28 #include <gendrill_file_writer_base.h> // for DRILL_PRECISION definition
29 #include <dialog_gendrill_base.h>
30 
32 {
33 public:
39  DIALOG_GENDRILL( PCB_EDIT_FRAME* aPcbEditFrame, wxWindow* aParent );
41 
45  void UpdateDrillParams();
46 
47  static int m_UnitDrillIsInch;
48  static int m_ZerosFormat;
49  static bool m_MinimalHeader;
50  static bool m_Mirror;
51  static bool m_Merge_PTH_NPTH;
52  DRILL_PRECISION m_Precision; // Precision for drill files, in non decimal format
53  wxPoint m_FileDrillOffset; // Drill offset: 0,0 for absolute coordinates,
54  // or origin of the auxiliary axis
55  static bool m_UseRouteModeForOvalHoles; // True to use a G00 route command for oval holes
56  // False to use a G85 canned mode for oval holes
57 
58 private:
60  wxConfigBase* m_config;
63  bool m_drillOriginIsAuxAxis; // Axis selection (main / auxiliary)
64  // for drill origin coordinates
70 
71  static int m_mapFileType; // format of map file: HPGL, PS ...
72  static int m_drillFileType; // for Excellon, Gerber
73 
74  void initDialog();
75  void InitDisplayParams();
76 
77  // event functions
78  void OnSelDrillUnitsSelected( wxCommandEvent& event ) override;
79  void OnSelZerosFmtSelected( wxCommandEvent& event ) override;
80  void OnGenDrillFile( wxCommandEvent& event ) override;
81  void OnGenMapFile( wxCommandEvent& event ) override;
82  void onFileFormatSelection( wxCommandEvent& event ) override;
83 
84  // Called when closing the dialog: Update config.
85  // This is not done in Dtor, because the dtor call is often delayed and the update
86  // could happen too late for the caller.
87  void onCloseDlg( wxCloseEvent& event ) override
88  {
89  UpdateConfig();
90  event.Skip();
91  }
92 
93  void onQuitDlg( wxCommandEvent& event ) override
94  {
95  UpdateConfig();
96  event.Skip();
97  }
98 
99  /*
100  * Create a plain text report file giving a list of drill values and drill count
101  * for through holes, oblong holes, and for buried vias,
102  * drill values and drill count per layer pair
103  */
104  void OnGenReportFile( wxCommandEvent& event ) override;
105 
106  void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
107 
108  // Specific functions:
119  void GenDrillAndMapFiles( bool aGenDrill, bool aGenMap );
120 
121  void UpdatePrecisionOptions();
122  void UpdateConfig();
123 };
124 
125 #endif // DIALOG_GENDRILL_H_
static int m_UnitDrillIsInch
void OnGenDrillFile(wxCommandEvent &event) override
wxConfigBase * m_config
void onQuitDlg(wxCommandEvent &event) override
void OnSelZerosFmtSelected(wxCommandEvent &event) override
void OnSelDrillUnitsSelected(wxCommandEvent &event) override
Class DIALOG_GENDRILL_BASE.
static bool m_Merge_PTH_NPTH
static int m_ZerosFormat
static bool m_UseRouteModeForOvalHoles
wxPoint m_FileDrillOffset
static int m_mapFileType
static bool m_MinimalHeader
void onCloseDlg(wxCloseEvent &event) override
helper classes to handle hole info for drill files generators.
PCB_PLOT_PARAMS m_plotOpts
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
DIALOG_GENDRILL(PCB_EDIT_FRAME *aPcbEditFrame, wxWindow *aParent)
Ctor.
static bool m_Mirror
DRILL_PRECISION m_Precision
void onFileFormatSelection(wxCommandEvent &event) override
static int m_drillFileType
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
void OnGenReportFile(wxCommandEvent &event) override
void UpdateDrillParams()
Update board drill/plot parameters.
void OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
void OnGenMapFile(wxCommandEvent &event) override
void GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
Function GenDrillAndMapFiles Calls the functions to create EXCELLON drill files and/or drill map file...
PCB_EDIT_FRAME * m_pcbEditFrame