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:
62  bool m_drillOriginIsAuxAxis; // Axis selection (main / auxiliary)
63  // for drill origin coordinates
69 
70  static int m_mapFileType; // format of map file: HPGL, PS ...
71  static int m_drillFileType; // for Excellon, Gerber
72 
73  void initDialog();
74  void InitDisplayParams();
75 
76  // event functions
77  void OnSelDrillUnitsSelected( wxCommandEvent& event ) override;
78  void OnSelZerosFmtSelected( wxCommandEvent& event ) override;
79  void OnGenDrillFile( wxCommandEvent& event ) override;
80  void OnGenMapFile( wxCommandEvent& event ) override;
81  void onFileFormatSelection( wxCommandEvent& event ) override;
82 
83  // Called when closing the dialog: Update config.
84  // This is not done in Dtor, because the dtor call is often delayed and the update
85  // could happen too late for the caller.
86  void onCloseDlg( wxCloseEvent& event ) override
87  {
88  UpdateConfig();
89  event.Skip();
90  }
91 
92  void onQuitDlg( wxCommandEvent& event ) override
93  {
94  UpdateConfig();
95  event.Skip();
96  }
97 
98  /*
99  * Create a plain text report file giving a list of drill values and drill count
100  * for through holes, oblong holes, and for buried vias,
101  * drill values and drill count per layer pair
102  */
103  void OnGenReportFile( wxCommandEvent& event ) override;
104 
105  void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
106 
107  // Specific functions:
118  void GenDrillAndMapFiles( bool aGenDrill, bool aGenMap );
119 
120  void UpdatePrecisionOptions();
121  void UpdateConfig();
122 };
123 
124 #endif // DIALOG_GENDRILL_H_
static int m_UnitDrillIsInch
void OnGenDrillFile(wxCommandEvent &event) override
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
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
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:186
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