2010-11-24 19:54:59 +00:00
|
|
|
/*
|
2011-09-30 18:15:37 +00:00
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
2010-11-24 19:54:59 +00:00
|
|
|
*
|
2019-02-09 13:56:02 +00:00
|
|
|
* Copyright (C) 1992-2019 Jean_Pierre Charras <jp.charras@ujf-grenoble.fr>
|
2021-06-04 16:21:48 +00:00
|
|
|
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
2010-11-24 19:54:59 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2010-11-24 15:10:33 +00:00
|
|
|
|
2012-04-05 18:27:56 +00:00
|
|
|
#ifndef DIALOG_GENDRILL_H_
|
|
|
|
#define DIALOG_GENDRILL_H_
|
2010-11-24 15:10:33 +00:00
|
|
|
|
2019-02-13 10:41:52 +00:00
|
|
|
#include <gendrill_file_writer_base.h> // for DRILL_PRECISION definition
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_gendrill_base.h>
|
2010-11-24 15:10:33 +00:00
|
|
|
|
|
|
|
class DIALOG_GENDRILL : public DIALOG_GENDRILL_BASE
|
|
|
|
{
|
|
|
|
public:
|
2019-02-13 10:41:52 +00:00
|
|
|
/**
|
2021-06-04 16:21:48 +00:00
|
|
|
* @param aPcbEditFrame is the board edit frame.
|
|
|
|
* @param aParent is the parent window caller ( the board edit frame or a dialog ).
|
2019-02-13 10:41:52 +00:00
|
|
|
*/
|
|
|
|
DIALOG_GENDRILL( PCB_EDIT_FRAME* aPcbEditFrame, wxWindow* aParent );
|
2012-04-05 18:27:56 +00:00
|
|
|
~DIALOG_GENDRILL();
|
|
|
|
|
2019-02-13 10:41:52 +00:00
|
|
|
/**
|
|
|
|
* Update board drill/plot parameters
|
|
|
|
*/
|
2019-08-25 23:45:10 +00:00
|
|
|
void UpdateDrillParams();
|
2019-02-13 10:41:52 +00:00
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
private:
|
2019-08-25 23:45:10 +00:00
|
|
|
void initDialog();
|
|
|
|
void InitDisplayParams();
|
2010-11-24 19:54:59 +00:00
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
// event functions
|
2019-08-25 23:45:10 +00:00
|
|
|
void OnSelDrillUnitsSelected( wxCommandEvent& event ) override;
|
|
|
|
void OnSelZerosFmtSelected( wxCommandEvent& event ) override;
|
|
|
|
void OnGenDrillFile( wxCommandEvent& event ) override;
|
|
|
|
void OnGenMapFile( wxCommandEvent& event ) override;
|
|
|
|
void onFileFormatSelection( wxCommandEvent& event ) override;
|
2014-03-03 14:28:05 +00:00
|
|
|
|
2019-02-13 10:41:52 +00:00
|
|
|
// Called when closing the dialog: Update config.
|
2019-08-25 23:45:10 +00:00
|
|
|
// This is not done in Dtor, because the dtor call is often delayed and the update
|
|
|
|
// could happen too late for the caller.
|
2019-02-13 10:41:52 +00:00
|
|
|
void onCloseDlg( wxCloseEvent& event ) override
|
|
|
|
{
|
|
|
|
UpdateConfig();
|
|
|
|
event.Skip();
|
|
|
|
}
|
2019-08-25 23:45:10 +00:00
|
|
|
|
2019-02-13 10:41:52 +00:00
|
|
|
void onQuitDlg( wxCommandEvent& event ) override
|
|
|
|
{
|
|
|
|
UpdateConfig();
|
|
|
|
event.Skip();
|
|
|
|
}
|
|
|
|
|
2014-03-03 14:28:05 +00:00
|
|
|
/*
|
|
|
|
* Create a plain text report file giving a list of drill values and drill count
|
|
|
|
* for through holes, oblong holes, and for buried vias,
|
|
|
|
* drill values and drill count per layer pair
|
|
|
|
*/
|
2019-08-25 23:45:10 +00:00
|
|
|
void OnGenReportFile( wxCommandEvent& event ) override;
|
2014-03-03 14:28:05 +00:00
|
|
|
|
2019-08-25 23:45:10 +00:00
|
|
|
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
|
2010-11-24 19:54:59 +00:00
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
// Specific functions:
|
2014-03-03 14:28:05 +00:00
|
|
|
/**
|
2021-06-04 16:21:48 +00:00
|
|
|
* Call the functions to create EXCELLON drill files and/or drill map files.
|
|
|
|
*
|
|
|
|
* When all holes are through holes, only one excellon file is created. When there are
|
|
|
|
* some partial holes (some blind or buried vias), one excellon file is created, for all
|
|
|
|
* plated through holes, and one file per layer pair, which have one or more holes, excluding
|
|
|
|
* through holes, already in the first file. One file for all Not Plated through holes.
|
2014-03-03 14:28:05 +00:00
|
|
|
*/
|
2019-08-25 23:45:10 +00:00
|
|
|
void GenDrillAndMapFiles( bool aGenDrill, bool aGenMap );
|
2010-11-24 19:54:59 +00:00
|
|
|
|
2019-08-25 23:45:10 +00:00
|
|
|
void UpdatePrecisionOptions();
|
|
|
|
void UpdateConfig();
|
2021-06-04 16:21:48 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
static int m_UnitDrillIsInch;
|
|
|
|
static int m_ZerosFormat;
|
|
|
|
static bool m_MinimalHeader;
|
|
|
|
static bool m_Mirror;
|
|
|
|
static bool m_Merge_PTH_NPTH;
|
|
|
|
DRILL_PRECISION m_Precision; // Precision for drill files, in non decimal format
|
|
|
|
wxPoint m_FileDrillOffset; // Drill offset: 0,0 for absolute coordinates,
|
|
|
|
// or origin of the auxiliary axis
|
|
|
|
static bool m_UseRouteModeForOvalHoles; // True to use a G00 route command for oval holes
|
|
|
|
// False to use a G85 canned mode for oval holes
|
|
|
|
|
|
|
|
private:
|
|
|
|
PCB_EDIT_FRAME* m_pcbEditFrame;
|
|
|
|
BOARD* m_board;
|
|
|
|
PCB_PLOT_PARAMS m_plotOpts;
|
|
|
|
bool m_drillOriginIsAuxAxis; // Axis selection (main / auxiliary)
|
|
|
|
// for drill origin coordinates
|
|
|
|
int m_platedPadsHoleCount;
|
|
|
|
int m_notplatedPadsHoleCount;
|
|
|
|
int m_throughViasCount;
|
|
|
|
int m_microViasCount;
|
|
|
|
int m_blindOrBuriedViasCount;
|
|
|
|
|
|
|
|
static int m_mapFileType; // format of map file: HPGL, PS ...
|
|
|
|
static int m_drillFileType; // for Excellon, Gerber
|
2010-11-24 15:10:33 +00:00
|
|
|
};
|
|
|
|
|
2012-04-05 18:27:56 +00:00
|
|
|
#endif // DIALOG_GENDRILL_H_
|