dialog_gendrill.h 3.59 KB
Newer Older
1 2 3
/**
 *@file dialog_gendrill.h
 */
4

5
/*
6
 * This program source code file is part of KiCad, a free EDA CAD application.
7
 *
8
 * Copyright (C) 1992-2010 Jean_Pierre Charras <jp.charras@ujf-grenoble.fr>
9
 * Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
 *
 * 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
 */
28

29 30
#ifndef DIALOG_GENDRILL_H_
#define DIALOG_GENDRILL_H_
31

32
#include <dialog_gendrill_base.h>
33 34 35 36

class DIALOG_GENDRILL : public DIALOG_GENDRILL_BASE
{
public:
37 38 39
    DIALOG_GENDRILL( PCB_EDIT_FRAME* parent );
    ~DIALOG_GENDRILL();

40 41 42 43 44 45
    static int       m_UnitDrillIsInch;
    static int       m_ZerosFormat;
    static bool      m_MinimalHeader;
    static bool      m_Mirror;
    static bool      m_DrillOriginIsAuxAxis; /* Axis selection (main / auxiliary)
                                              *  for drill origin coordinates */
46 47 48
    DRILL_PRECISION  m_Precision;           // Selected precision for drill files
    wxPoint          m_FileDrillOffset;     // Drill offset: 0,0 for absolute coordinates,
                                            // or origin of the auxiliary axis
49

50

51
private:
52
    PCB_EDIT_FRAME* m_parent;
53
    wxConfig*       m_config;
54
    BOARD*          m_board;
55
    PCB_PLOT_PARAMS m_plotOpts;
56

57 58 59 60 61
    int m_platedPadsHoleCount;
    int m_notplatedPadsHoleCount;
    int m_throughViasCount;
    int m_microViasCount;
    int m_blindOrBuriedViasCount;
62

63
    static int m_mapFileType;            // HPGL, PS ...
64

65 66 67 68

    void            initDialog();
    void            InitDisplayParams( void );

69
    // event functions
70 71
    void            OnSelDrillUnitsSelected( wxCommandEvent& event );
    void            OnSelZerosFmtSelected( wxCommandEvent& event );
72 73 74
	void            OnGenDrillFile( wxCommandEvent& event );
	void            OnGenMapFile( wxCommandEvent& event );
	void            OnGenReportFile( wxCommandEvent& event );
75
    void            OnCancelClick( wxCommandEvent& event );
76
    void            OnOutputDirectoryBrowseClicked( wxCommandEvent& event );
77

78
    // Specific functions:
79
    void            SetParams( void );
80 81 82 83 84
    void            GenDrillAndMapFiles(bool aGenDrill, bool aGenMap);
    void            GenDrillMap( const wxString  aFileName,
                                 EXCELLON_WRITER& aExcellonWriter,
                                 PlotFormat      format );

85 86
    void            UpdatePrecisionOptions();
    void            UpdateConfig();
87 88 89 90
    int             Create_Drill_File_EXCELLON( FILE*  aFile,
                                                wxPoint aOffset );
    int             Gen_Liste_Tools( std::vector<DRILL_TOOL>& buffer,
                                     bool print_header );
91

92 93 94 95 96 97
    /**
     * Return the selected format for coordinates, if not decimal
     */
    DRILL_PRECISION GetPrecison();
};

98
#endif      // DIALOG_GENDRILL_H_