KiCad PCB EDA Suite
dialog_gendrill.h
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 1992-2019 Jean_Pierre Charras <jp.charras@ujf-grenoble.fr>
9  * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, you may find one here:
23  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24  * or you may search the http://www.gnu.org website for the version 2 license,
25  * or you may write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27  */
28 
29 #ifndef DIALOG_GENDRILL_H_
30 #define DIALOG_GENDRILL_H_
31 
32 #include <gendrill_file_writer_base.h> // for DRILL_PRECISION definition
33 #include <dialog_gendrill_base.h>
34 
36 {
37 public:
43  DIALOG_GENDRILL( PCB_EDIT_FRAME* aPcbEditFrame, wxWindow* aParent );
45 
49  void UpdateDrillParams( void );
50 
51 
52  static int m_UnitDrillIsInch;
53  static int m_ZerosFormat;
54  static bool m_MinimalHeader;
55  static bool m_Mirror;
56  static bool m_Merge_PTH_NPTH;
59  static bool m_UseRouteModeForOvalHoles;
61 
63 
64 private:
66  wxConfigBase* m_config;
69  bool m_drillOriginIsAuxAxis; // Axis selection (main / auxiliary)
70  // for drill origin coordinates
76 
77  static int m_mapFileType; // format of map file: HPGL, PS ...
78  static int m_drillFileType; // for Excellon, Gerber
79 
80 
81  void initDialog();
82  void InitDisplayParams( void );
83 
84  // event functions
85  void OnSelDrillUnitsSelected( wxCommandEvent& event ) override;
86  void OnSelZerosFmtSelected( wxCommandEvent& event ) override;
87  void OnGenDrillFile( wxCommandEvent& event ) override;
88  void OnGenMapFile( wxCommandEvent& event ) override;
89  void onFileFormatSelection( wxCommandEvent& event ) override;
90 
91  // Called when closing the dialog: Update config.
92  // This is not done in Dtor, because the dtor call is often delayed
93  // and the update could happen too late for the caller.
94  void onCloseDlg( wxCloseEvent& event ) override
95  {
96  UpdateConfig();
97  event.Skip();
98  }
99  void onQuitDlg( wxCommandEvent& event ) override
100  {
101  UpdateConfig();
102  event.Skip();
103  }
104 
105  /*
106  * Create a plain text report file giving a list of drill values and drill count
107  * for through holes, oblong holes, and for buried vias,
108  * drill values and drill count per layer pair
109  */
110  void OnGenReportFile( wxCommandEvent& event ) override;
111 
112  void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
113 
114  // Specific functions:
125  void GenDrillAndMapFiles( bool aGenDrill, bool aGenMap );
126 
127  void UpdatePrecisionOptions();
128  void UpdateConfig();
129  int Create_Drill_File_EXCELLON( FILE* aFile, wxPoint aOffset );
130  int Gen_Liste_Tools( std::vector<DRILL_TOOL>& buffer,
131  bool print_header );
132 
137 };
138 
139 #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
Drill offset: 0,0 for absolute coordinates, or origin of the auxiliary axis.
wxPoint m_FileDrillOffset
Selected precision for drill files, in non decimal format.
static int m_mapFileType
int Gen_Liste_Tools(std::vector< DRILL_TOOL > &buffer, bool print_header)
static bool m_MinimalHeader
void onCloseDlg(wxCloseEvent &event) override
void UpdateDrillParams(void)
Update board drill/plot parameters.
DRILL_PRECISION GetPrecison()
Return the selected format for coordinates, if not decimal.
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.
int Create_Drill_File_EXCELLON(FILE *aFile, wxPoint aOffset)
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
void InitDisplayParams(void)
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
void OnGenReportFile(wxCommandEvent &event) override
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
True to use a G00 route command for oval holes False to use a G85 canned mode for oval holes.