Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
5944f4c4
Commit
5944f4c4
authored
Nov 24, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: gen drill functions: morecode cleanup
parent
259d9a02
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
327 additions
and
192 deletions
+327
-192
dialog_gendrill.cpp
pcbnew/dialogs/dialog_gendrill.cpp
+6
-7
dialog_gendrill.h
pcbnew/dialogs/dialog_gendrill.h
+59
-36
gen_holes_and_tools_lists_for_drill.cpp
pcbnew/gen_holes_and_tools_lists_for_drill.cpp
+0
-3
gendrill.cpp
pcbnew/gendrill.cpp
+143
-110
gendrill.h
pcbnew/gendrill.h
+119
-36
No files found.
pcbnew/dialogs/dialog_gendrill.cpp
View file @
5944f4c4
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_gendrill.cpp
// Name: dialog_gendrill.cpp
// Author: jean-pierre Charras
// Author: jean-pierre Charras
// Licence: GPL
// Licence: GPL
...
@@ -50,7 +48,7 @@ DIALOG_GENDRILL::DIALOG_GENDRILL( WinEDA_PcbFrame* parent ) :
...
@@ -50,7 +48,7 @@ DIALOG_GENDRILL::DIALOG_GENDRILL( WinEDA_PcbFrame* parent ) :
// Static members of DIALOG_GENDRILL
// Static members of DIALOG_GENDRILL
int
DIALOG_GENDRILL
::
m_UnitDrillIsInch
=
true
;
int
DIALOG_GENDRILL
::
m_UnitDrillIsInch
=
true
;
int
DIALOG_GENDRILL
::
m_ZerosFormat
=
DECIMAL_FORMAT
;
int
DIALOG_GENDRILL
::
m_ZerosFormat
=
EXCELLON_WRITER
::
DECIMAL_FORMAT
;
bool
DIALOG_GENDRILL
::
m_MinimalHeader
=
false
;
bool
DIALOG_GENDRILL
::
m_MinimalHeader
=
false
;
bool
DIALOG_GENDRILL
::
m_Mirror
=
true
;
bool
DIALOG_GENDRILL
::
m_Mirror
=
true
;
bool
DIALOG_GENDRILL
::
m_DrillOriginIsAuxAxis
=
false
;
bool
DIALOG_GENDRILL
::
m_DrillOriginIsAuxAxis
=
false
;
...
@@ -96,7 +94,7 @@ void DIALOG_GENDRILL::InitDisplayParams( void )
...
@@ -96,7 +94,7 @@ void DIALOG_GENDRILL::InitDisplayParams( void )
m_Choice_Unit
->
SetSelection
(
m_UnitDrillIsInch
?
1
:
0
);
m_Choice_Unit
->
SetSelection
(
m_UnitDrillIsInch
?
1
:
0
);
m_Choice_Precision
->
SetSelection
(
m_PrecisionFormat
);
m_Choice_Precision
->
SetSelection
(
m_PrecisionFormat
);
m_Choice_Zeros_Format
->
SetSelection
(
m_ZerosFormat
);
m_Choice_Zeros_Format
->
SetSelection
(
m_ZerosFormat
);
if
(
m_ZerosFormat
==
DECIMAL_FORMAT
)
if
(
m_ZerosFormat
==
EXCELLON_WRITER
::
DECIMAL_FORMAT
)
m_Choice_Precision
->
Enable
(
false
);
m_Choice_Precision
->
Enable
(
false
);
UpdatePrecisionOptions
(
);
UpdatePrecisionOptions
(
);
...
@@ -209,7 +207,8 @@ void DIALOG_GENDRILL::OnSelDrillUnitsSelected( wxCommandEvent& event )
...
@@ -209,7 +207,8 @@ void DIALOG_GENDRILL::OnSelDrillUnitsSelected( wxCommandEvent& event )
void
DIALOG_GENDRILL
::
OnOkClick
(
wxCommandEvent
&
event
)
void
DIALOG_GENDRILL
::
OnOkClick
(
wxCommandEvent
&
event
)
{
{
GenDrillOrReportFiles
(
);
GenDrillAndReportFiles
(
);
EndModal
(
wxID_OK
);
}
}
...
@@ -220,7 +219,7 @@ void DIALOG_GENDRILL::OnOkClick( wxCommandEvent& event )
...
@@ -220,7 +219,7 @@ void DIALOG_GENDRILL::OnOkClick( wxCommandEvent& event )
void
DIALOG_GENDRILL
::
OnCancelClick
(
wxCommandEvent
&
event
)
void
DIALOG_GENDRILL
::
OnCancelClick
(
wxCommandEvent
&
event
)
{
{
UpdateConfig
();
/* Save drill options: */
UpdateConfig
();
/* Save drill options: */
event
.
Skip
(
);
// Process the default cancel event (close dialog)
EndModal
(
wxID_CANCEL
);
// Process the default cancel event (close dialog)
}
}
...
@@ -248,7 +247,7 @@ void DIALOG_GENDRILL::UpdatePrecisionOptions( )
...
@@ -248,7 +247,7 @@ void DIALOG_GENDRILL::UpdatePrecisionOptions( )
m_Choice_Precision
->
SetString
(
0
,
precisionListForMetric
[
0
].
GetPrecisionString
()
);
m_Choice_Precision
->
SetString
(
0
,
precisionListForMetric
[
0
].
GetPrecisionString
()
);
m_Choice_Precision
->
SetString
(
1
,
precisionListForMetric
[
1
].
GetPrecisionString
()
);
m_Choice_Precision
->
SetString
(
1
,
precisionListForMetric
[
1
].
GetPrecisionString
()
);
}
}
if
(
m_Choice_Zeros_Format
->
GetSelection
()
==
DECIMAL_FORMAT
)
if
(
m_Choice_Zeros_Format
->
GetSelection
()
==
EXCELLON_WRITER
::
DECIMAL_FORMAT
)
m_Choice_Precision
->
Enable
(
false
);
m_Choice_Precision
->
Enable
(
false
);
else
else
m_Choice_Precision
->
Enable
(
true
);
m_Choice_Precision
->
Enable
(
true
);
...
...
pcbnew/dialogs/dialog_gendrill.h
View file @
5944f4c4
/////////////////////////////////////////////////////////////////////////////
/**
*@file dialog_gendrill.h
*/
// Name: dialog_gendrill.h
/*
// Author: jean-pierre Charras
* This program source code file is part of KICAD, a free EDA CAD application.
// Created: 2010 apr 30
*
// Licence: GPL
* Copyright (C) 1992-2010 Jean_Pierre Charras <jp.charras@iut.ujf-grenoble.fr>
/////////////////////////////////////////////////////////////////////////////
* Copyright (C) 1992-2010 Kicad Developers, see change_log.txt for contributors.
*
* 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
*/
#ifndef _DIALOG_GENDRILL_H_
#ifndef _DIALOG_GENDRILL_H_
#define _DIALOG_GENDRILL_H_
#define _DIALOG_GENDRILL_H_
...
@@ -35,30 +55,33 @@ public: DIALOG_GENDRILL( WinEDA_PcbFrame* parent );
...
@@ -35,30 +55,33 @@ public: DIALOG_GENDRILL( WinEDA_PcbFrame* parent );
~
DIALOG_GENDRILL
();
~
DIALOG_GENDRILL
();
private
:
private
:
// Initialises member variables
// Initialises member variables
void
initDialog
();
void
initDialog
();
void
InitDisplayParams
(
void
);
void
InitDisplayParams
(
void
);
// event functions
// event functions
void
OnSelDrillUnitsSelected
(
wxCommandEvent
&
event
);
void
OnSelDrillUnitsSelected
(
wxCommandEvent
&
event
);
void
OnSelZerosFmtSelected
(
wxCommandEvent
&
event
);
void
OnSelZerosFmtSelected
(
wxCommandEvent
&
event
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
// Specific functions:
// Specific functions:
void
SetParams
(
void
);
void
SetParams
(
void
);
void
GenDrillOr
ReportFiles
();
void
GenDrillAnd
ReportFiles
();
void
GenDrillMap
(
const
wxString
aFileName
,
void
GenDrillMap
(
const
wxString
aFileName
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
,
int
format
);
int
format
);
void
UpdatePrecisionOptions
(
);
void
UpdatePrecisionOptions
(
);
void
UpdateConfig
();
void
UpdateConfig
();
void
Write_Excellon_Header
(
FILE
*
aFile
,
bool
aMinimalHeader
,
zeros_fmt
aFormat
);
void
GenDrillReport
(
const
wxString
aFileName
);
void
GenDrillReport
(
const
wxString
aFileName
);
int
Create_Drill_File_EXCELLON
(
FILE
*
aFile
,
int
Create_Drill_File_EXCELLON
(
FILE
*
aFile
,
wxPoint
aOffset
,
wxPoint
aOffset
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
);
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
);
int
Gen_Liste_Tools
(
std
::
vector
<
DRILL_TOOL
>&
buffer
,
bool
print_header
);
int
Gen_Liste_Tools
(
std
::
vector
<
DRILL_TOOL
>&
buffer
,
bool
print_header
);
/**
/**
* Return the selected format for coordinates, if not decimal
* Return the selected format for coordinates, if not decimal
*/
*/
...
...
pcbnew/gen_holes_and_tools_lists_for_drill.cpp
View file @
5944f4c4
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
#include "fctsys.h"
#include "fctsys.h"
using
namespace
std
;
#include <algorithm> // sort
#include <algorithm> // sort
#include <vector>
#include <vector>
...
@@ -42,7 +40,6 @@ static bool CmpHoleDiameterValue( const HOLE_INFO& a, const HOLE_INFO& b )
...
@@ -42,7 +40,6 @@ static bool CmpHoleDiameterValue( const HOLE_INFO& a, const HOLE_INFO& b )
* @param aToolListBuffer : the std::vector<DRILL_TOOL> to fill with tools to use
* @param aToolListBuffer : the std::vector<DRILL_TOOL> to fill with tools to use
* @param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored (used to creates report file)
* @param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored (used to creates report file)
* @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
* @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
* @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
* @param aExcludeThroughHoles : if true, exclude through holes ( pads and vias through )
* @param aExcludeThroughHoles : if true, exclude through holes ( pads and vias through )
*/
*/
void
Build_Holes_List
(
BOARD
*
aPcb
,
void
Build_Holes_List
(
BOARD
*
aPcb
,
...
...
pcbnew/gendrill.cpp
View file @
5944f4c4
/**
*@file gendrill.cpp
*/
/*************************************************************/
/*************************************************************/
/* Functions to create EXCELLON drill files and report files */
/* Functions to create EXCELLON drill files and report files */
/*************************************************************/
/*************************************************************/
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2010 Jean_Pierre Charras <jp.charras@iut.ujf-grenoble.fr>
* Copyright (C) 1992-2010 Kicad Developers, see change_log.txt for contributors.
*
* 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
*/
/**
/**
* @info for EXCELLON format, see:
* @info for EXCELLON format, see:
* http://www.excellon.com/applicationengineering/manuals/program.htm
* http://www.excellon.com/applicationengineering/manuals/program.htm
...
@@ -50,12 +77,6 @@ const wxString DrillFileWildcard( _( "Drill files (*.drl)|*.drl" ) );
...
@@ -50,12 +77,6 @@ const wxString DrillFileWildcard( _( "Drill files (*.drl)|*.drl" ) );
* the Dialog box for drill file generation
* the Dialog box for drill file generation
*/
*/
// Helper functions:
static
void
Gen_Line_EXCELLON
(
char
*
aLine
,
double
aCoordX
,
double
aCoordY
,
DRILL_PRECISION
&
aPrecision
);
static
void
WriteEndOfFile_EXCELLON
(
FILE
*
aFile
);
static
double
s_ConversionUnits
;
/* Conversion unite for
* drill / pcb */
static
std
::
vector
<
DRILL_TOOL
>
s_ToolListBuffer
;
static
std
::
vector
<
DRILL_TOOL
>
s_ToolListBuffer
;
static
std
::
vector
<
HOLE_INFO
>
s_HoleListBuffer
;
static
std
::
vector
<
HOLE_INFO
>
s_HoleListBuffer
;
...
@@ -72,7 +93,7 @@ void WinEDA_PcbFrame::InstallDrillFrame( wxCommandEvent& event )
...
@@ -72,7 +93,7 @@ void WinEDA_PcbFrame::InstallDrillFrame( wxCommandEvent& event )
/**
/**
* Function GenDrill
Or
ReportFiles
* Function GenDrill
And
ReportFiles
* Calls the functions to create EXCELLON drill files and/or drill map files
* Calls the functions to create EXCELLON drill files and/or drill map files
* >When all holes are through, only one excellon file is created.
* >When all holes are through, only one excellon file is created.
* >When there are some partial holes (some blind or buried vias),
* >When there are some partial holes (some blind or buried vias),
...
@@ -80,14 +101,14 @@ void WinEDA_PcbFrame::InstallDrillFrame( wxCommandEvent& event )
...
@@ -80,14 +101,14 @@ void WinEDA_PcbFrame::InstallDrillFrame( wxCommandEvent& event )
* and one file per layer pair, which have one or more holes, excluding
* and one file per layer pair, which have one or more holes, excluding
* through holes, already in the first file.
* through holes, already in the first file.
*/
*/
void
DIALOG_GENDRILL
::
GenDrill
Or
ReportFiles
(
)
void
DIALOG_GENDRILL
::
GenDrill
And
ReportFiles
(
)
{
{
wxFileName
fn
;
wxFileName
fn
;
wxString
layer_extend
;
/* added to the Board FileName to
wxString
layer_extend
;
/* added to the Board FileName to
* create FullFileName (= Board
* create FullFileName (= Board
* FileName + layer pair names) */
* FileName + layer pair names) */
wxString
msg
;
wxString
msg
;
bool
Exist
sBuriedVias
=
false
;
/* If true, drill files are created
bool
ha
sBuriedVias
=
false
;
/* If true, drill files are created
* layer pair by layer pair for
* layer pair by layer pair for
* buried vias */
* buried vias */
int
layer1
=
LAYER_N_BACK
;
int
layer1
=
LAYER_N_BACK
;
...
@@ -98,13 +119,8 @@ void DIALOG_GENDRILL::GenDrillOrReportFiles( )
...
@@ -98,13 +119,8 @@ void DIALOG_GENDRILL::GenDrillOrReportFiles( )
m_Parent
->
MsgPanel
->
EraseMsgBox
();
m_Parent
->
MsgPanel
->
EraseMsgBox
();
/* Set conversion scale depending on drill file units */
s_ConversionUnits
=
0.0001
;
// EXCELLON units = INCHES
if
(
!
m_UnitDrillIsInch
)
s_ConversionUnits
=
0.00254
;
// EXCELLON units = mm
if
(
m_MicroViasCount
||
m_BlindOrBuriedViasCount
)
if
(
m_MicroViasCount
||
m_BlindOrBuriedViasCount
)
Exist
sBuriedVias
=
true
;
ha
sBuriedVias
=
true
;
for
(
;
;
)
for
(
;
;
)
{
{
...
@@ -148,9 +164,14 @@ void DIALOG_GENDRILL::GenDrillOrReportFiles( )
...
@@ -148,9 +164,14 @@ void DIALOG_GENDRILL::GenDrillOrReportFiles( )
EndModal
(
0
);
EndModal
(
0
);
return
;
return
;
}
}
EXCELLON_WRITER
excellonWriter
(
m_Parent
->
GetBoard
(),
Create_Drill_File_EXCELLON
(
aFile
,
m_FileDrillOffset
,
aFile
,
m_FileDrillOffset
,
s_HoleListBuffer
,
s_ToolListBuffer
);
&
s_HoleListBuffer
,
&
s_ToolListBuffer
);
excellonWriter
.
SetFormat
(
!
m_UnitDrillIsInch
,
(
EXCELLON_WRITER
::
zeros_fmt
)
m_ZerosFormat
,
m_Precision
.
m_lhs
,
m_Precision
.
m_rhs
);
excellonWriter
.
SetOptions
(
m_Mirror
,
m_MinimalHeader
,
m_FileDrillOffset
);
excellonWriter
.
CreateDrillFile
(
);
switch
(
m_Choice_Drill_Map
->
GetSelection
()
)
switch
(
m_Choice_Drill_Map
->
GetSelection
()
)
{
{
...
@@ -178,7 +199,7 @@ void DIALOG_GENDRILL::GenDrillOrReportFiles( )
...
@@ -178,7 +199,7 @@ void DIALOG_GENDRILL::GenDrillOrReportFiles( )
break
;
break
;
}
}
if
(
!
Exist
sBuriedVias
)
if
(
!
ha
sBuriedVias
)
break
;
break
;
}
}
if
(
gen_through_holes
)
if
(
gen_through_holes
)
...
@@ -202,21 +223,14 @@ void DIALOG_GENDRILL::GenDrillOrReportFiles( )
...
@@ -202,21 +223,14 @@ void DIALOG_GENDRILL::GenDrillOrReportFiles( )
{
{
GenDrillReport
(
m_Parent
->
GetScreen
()
->
m_FileName
);
GenDrillReport
(
m_Parent
->
GetScreen
()
->
m_FileName
);
}
}
EndModal
(
0
);
}
}
/**
/**
* Create the drill file in EXCELLON format
* Create the drill file in EXCELLON format
* @return hole count
* @return hole count
* @param aHoleListBuffer = hole descriptor list
* @param aToolListBuffer = Drill tools list
*/
*/
int
DIALOG_GENDRILL
::
Create_Drill_File_EXCELLON
(
FILE
*
aFile
,
int
EXCELLON_WRITER
::
CreateDrillFile
(
)
wxPoint
aOffset
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
)
{
{
int
diam
,
holes_count
;
int
diam
,
holes_count
;
int
x0
,
y0
,
xf
,
yf
,
xc
,
yc
;
int
x0
,
y0
,
xf
,
yf
,
xc
,
yc
;
...
@@ -225,54 +239,57 @@ int DIALOG_GENDRILL::Create_Drill_File_EXCELLON( FILE* aFile,
...
@@ -225,54 +239,57 @@ int DIALOG_GENDRILL::Create_Drill_File_EXCELLON( FILE* aFile,
SetLocaleTo_C_standard
();
// Use the standard notation for double numbers
SetLocaleTo_C_standard
();
// Use the standard notation for double numbers
Write
_Excellon_Header
(
aFile
,
m_MinimalHeader
,
(
zeros_fmt
)
m_ZerosFormat
);
Write
Header
(
);
holes_count
=
0
;
holes_count
=
0
;
/* Write the tool list */
/* Write the tool list */
for
(
unsigned
ii
=
0
;
ii
<
aToolListBuffer
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
m_toolListBuffer
->
size
();
ii
++
)
{
{
fprintf
(
aFile
,
"T%dC%.3f
\n
"
,
ii
+
1
,
DRILL_TOOL
&
tool_descr
=
(
*
m_toolListBuffer
)[
ii
];
double
(
aToolListBuffer
[
ii
].
m_Diameter
)
*
s_ConversionUnits
);
fprintf
(
m_file
,
"T%dC%.3f
\n
"
,
ii
+
1
,
tool_descr
.
m_Diameter
*
m_conversionUnits
);
}
}
fputs
(
"%
\n
"
,
aF
ile
);
// End of header info
fputs
(
"%
\n
"
,
m_f
ile
);
// End of header info
fputs
(
"G90
\n
"
,
aF
ile
);
// Absolute mode
fputs
(
"G90
\n
"
,
m_f
ile
);
// Absolute mode
fputs
(
"G05
\n
"
,
aF
ile
);
// Drill mode
fputs
(
"G05
\n
"
,
m_f
ile
);
// Drill mode
/* Units : */
/* Units : */
if
(
!
m_
M
inimalHeader
)
if
(
!
m_
m
inimalHeader
)
{
{
if
(
m_
UnitDrillIsInch
)
if
(
m_
unitsDecimal
)
fputs
(
"M7
2
\n
"
,
aFile
);
/* M72 = inch
mode */
fputs
(
"M7
1
\n
"
,
m_file
);
/* M71 = metric
mode */
else
else
fputs
(
"M7
1
\n
"
,
aFile
);
/* M71 = metric
mode */
fputs
(
"M7
2
\n
"
,
m_file
);
/* M72 = inch
mode */
}
}
/* Read the hole file and generate lines for normal holes (oblong
/* Read the hole file and generate lines for normal holes (oblong
* holes will be created later) */
* holes will be created later) */
int
tool_reference
=
-
2
;
int
tool_reference
=
-
2
;
for
(
unsigned
ii
=
0
;
ii
<
aHoleListBuffer
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
m_holeListBuffer
->
size
();
ii
++
)
{
{
if
(
aHoleListBuffer
[
ii
].
m_Hole_Shape
)
HOLE_INFO
&
hole_descr
=
(
*
m_holeListBuffer
)[
ii
];
if
(
hole_descr
.
m_Hole_Shape
)
continue
;
// oblong holes will be created later
continue
;
// oblong holes will be created later
if
(
tool_reference
!=
aHoleListBuffer
[
ii
]
.
m_Tool_Reference
)
if
(
tool_reference
!=
hole_descr
.
m_Tool_Reference
)
{
{
tool_reference
=
aHoleListBuffer
[
ii
]
.
m_Tool_Reference
;
tool_reference
=
hole_descr
.
m_Tool_Reference
;
fprintf
(
aF
ile
,
"T%d
\n
"
,
tool_reference
);
fprintf
(
m_f
ile
,
"T%d
\n
"
,
tool_reference
);
}
}
x0
=
aHoleListBuffer
[
ii
].
m_Hole_Pos_X
-
aO
ffset
.
x
;
x0
=
hole_descr
.
m_Hole_Pos_X
-
m_o
ffset
.
x
;
y0
=
aHoleListBuffer
[
ii
].
m_Hole_Pos_Y
-
aO
ffset
.
y
;
y0
=
hole_descr
.
m_Hole_Pos_Y
-
m_o
ffset
.
y
;
if
(
!
m_
M
irror
)
if
(
!
m_
m
irror
)
y0
*=
-
1
;
y0
*=
-
1
;
xt
=
x0
*
s_C
onversionUnits
;
xt
=
x0
*
m_c
onversionUnits
;
yt
=
y0
*
s_C
onversionUnits
;
yt
=
y0
*
m_c
onversionUnits
;
Gen_Line_EXCELLON
(
line
,
xt
,
yt
,
m_Precision
);
WriteCoordinates
(
line
,
xt
,
yt
);
fputs
(
line
,
aF
ile
);
fputs
(
line
,
m_f
ile
);
holes_count
++
;
holes_count
++
;
}
}
...
@@ -280,50 +297,49 @@ int DIALOG_GENDRILL::Create_Drill_File_EXCELLON( FILE* aFile,
...
@@ -280,50 +297,49 @@ int DIALOG_GENDRILL::Create_Drill_File_EXCELLON( FILE* aFile,
* will be created later) */
* will be created later) */
tool_reference
=
-
2
;
// set to a value not used for
tool_reference
=
-
2
;
// set to a value not used for
// aHoleListBuffer[ii].m_Tool_Reference
// aHoleListBuffer[ii].m_Tool_Reference
for
(
unsigned
ii
=
0
;
ii
<
aHoleListBuffer
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
m_holeListBuffer
->
size
();
ii
++
)
{
{
if
(
aHoleListBuffer
[
ii
].
m_Hole_Shape
==
0
)
HOLE_INFO
&
hole_descr
=
(
*
m_holeListBuffer
)[
ii
];
if
(
hole_descr
.
m_Hole_Shape
==
0
)
continue
;
// wait for oblong holes
continue
;
// wait for oblong holes
if
(
tool_reference
!=
aHoleListBuffer
[
ii
]
.
m_Tool_Reference
)
if
(
tool_reference
!=
hole_descr
.
m_Tool_Reference
)
{
{
tool_reference
=
aHoleListBuffer
[
ii
]
.
m_Tool_Reference
;
tool_reference
=
hole_descr
.
m_Tool_Reference
;
fprintf
(
aF
ile
,
"T%d
\n
"
,
tool_reference
);
fprintf
(
m_f
ile
,
"T%d
\n
"
,
tool_reference
);
}
}
diam
=
MIN
(
aHoleListBuffer
[
ii
]
.
m_Hole_SizeX
,
diam
=
MIN
(
hole_descr
.
m_Hole_SizeX
,
aHoleListBuffer
[
ii
]
.
m_Hole_SizeY
);
hole_descr
.
m_Hole_SizeY
);
if
(
diam
==
0
)
if
(
diam
==
0
)
continue
;
continue
;
/* Compute the hole coordinates: */
/* Compute the hole coordinates: */
xc
=
x0
=
xf
=
aHoleListBuffer
[
ii
].
m_Hole_Pos_X
-
aO
ffset
.
x
;
xc
=
x0
=
xf
=
hole_descr
.
m_Hole_Pos_X
-
m_o
ffset
.
x
;
yc
=
y0
=
yf
=
aHoleListBuffer
[
ii
].
m_Hole_Pos_Y
-
aO
ffset
.
y
;
yc
=
y0
=
yf
=
hole_descr
.
m_Hole_Pos_Y
-
m_o
ffset
.
y
;
/* Compute the start and end coordinates for the shape */
/* Compute the start and end coordinates for the shape */
if
(
aHoleListBuffer
[
ii
].
m_Hole_SizeX
<
aHoleListBuffer
[
ii
]
.
m_Hole_SizeY
)
if
(
hole_descr
.
m_Hole_SizeX
<
hole_descr
.
m_Hole_SizeY
)
{
{
int
delta
=
(
aHoleListBuffer
[
ii
].
m_Hole_SizeY
int
delta
=
(
hole_descr
.
m_Hole_SizeY
-
hole_descr
.
m_Hole_SizeX
)
/
2
;
-
aHoleListBuffer
[
ii
].
m_Hole_SizeX
)
/
2
;
y0
-=
delta
;
yf
+=
delta
;
y0
-=
delta
;
yf
+=
delta
;
}
}
else
else
{
{
int
delta
=
(
aHoleListBuffer
[
ii
].
m_Hole_SizeX
int
delta
=
(
hole_descr
.
m_Hole_SizeX
-
hole_descr
.
m_Hole_SizeY
)
/
2
;
-
aHoleListBuffer
[
ii
].
m_Hole_SizeY
)
/
2
;
x0
-=
delta
;
xf
+=
delta
;
x0
-=
delta
;
xf
+=
delta
;
}
}
RotatePoint
(
&
x0
,
&
y0
,
xc
,
yc
,
aHoleListBuffer
[
ii
]
.
m_Hole_Orient
);
RotatePoint
(
&
x0
,
&
y0
,
xc
,
yc
,
hole_descr
.
m_Hole_Orient
);
RotatePoint
(
&
xf
,
&
yf
,
xc
,
yc
,
aHoleListBuffer
[
ii
]
.
m_Hole_Orient
);
RotatePoint
(
&
xf
,
&
yf
,
xc
,
yc
,
hole_descr
.
m_Hole_Orient
);
if
(
!
m_
M
irror
)
if
(
!
m_
m
irror
)
{
{
y0
*=
-
1
;
yf
*=
-
1
;
y0
*=
-
1
;
yf
*=
-
1
;
}
}
xt
=
x0
*
s_C
onversionUnits
;
xt
=
x0
*
m_c
onversionUnits
;
yt
=
y0
*
s_C
onversionUnits
;
yt
=
y0
*
m_c
onversionUnits
;
Gen_Line_EXCELLON
(
line
,
xt
,
yt
,
m_Precision
);
WriteCoordinates
(
line
,
xt
,
yt
);
/* remove the '\n' from end of line, because we must add the "G85"
/* remove the '\n' from end of line, because we must add the "G85"
* command to the line: */
* command to the line: */
...
@@ -331,35 +347,57 @@ int DIALOG_GENDRILL::Create_Drill_File_EXCELLON( FILE* aFile,
...
@@ -331,35 +347,57 @@ int DIALOG_GENDRILL::Create_Drill_File_EXCELLON( FILE* aFile,
if
(
line
[
kk
]
==
'\n'
||
line
[
kk
]
==
'\r'
)
if
(
line
[
kk
]
==
'\n'
||
line
[
kk
]
==
'\r'
)
line
[
kk
]
=
0
;
line
[
kk
]
=
0
;
fputs
(
line
,
aF
ile
);
fputs
(
line
,
m_f
ile
);
fputs
(
"G85"
,
aF
ile
);
// add the "G85" command
fputs
(
"G85"
,
m_f
ile
);
// add the "G85" command
xt
=
xf
*
s_C
onversionUnits
;
xt
=
xf
*
m_c
onversionUnits
;
yt
=
yf
*
s_C
onversionUnits
;
yt
=
yf
*
m_c
onversionUnits
;
Gen_Line_EXCELLON
(
line
,
xt
,
yt
,
m_Precision
);
WriteCoordinates
(
line
,
xt
,
yt
);
fputs
(
line
,
aF
ile
);
fputs
(
line
,
m_f
ile
);
fputs
(
"G05
\n
"
,
aF
ile
);
fputs
(
"G05
\n
"
,
m_f
ile
);
holes_count
++
;
holes_count
++
;
}
}
WriteEndOfFile
_EXCELLON
(
aFile
);
WriteEndOfFile
(
);
SetLocaleTo_Default
();
// Revert to locale double notation
SetLocaleTo_Default
();
// Revert to locale double notation
return
holes_count
;
return
holes_count
;
}
}
/**
* SetFormat
* Initialize internal parameters to match the given format
* @param aMetric = true for metric coordinates, false for imperial units
* @param aZerosFmt = DECIMAL_FORMAT, SUPPRESS_LEADING, SUPPRESS_TRAILING, KEEP_ZEROS
* @param aLeftDigits = number of digits for integer part of coordinates
* @param aRightDigits = number of digits for mantissa part of coordinates
*/
void
EXCELLON_WRITER
::
SetFormat
(
bool
aMetric
,
zeros_fmt
aZerosFmt
,
int
aLeftDigits
,
int
aRightDigits
)
{
m_unitsDecimal
=
aMetric
;
m_zeroFormat
=
aZerosFmt
;
/* Set conversion scale depending on drill file units */
if
(
m_unitsDecimal
)
m_conversionUnits
=
0.00254
;
// EXCELLON units = mm
else
m_conversionUnits
=
0.0001
;
// EXCELLON units = INCHES
m_precision
.
m_lhs
=
aLeftDigits
;
m_precision
.
m_rhs
=
aRightDigits
;
}
/* Created a line like:
/* Created a line like:
* X48000Y19500
* X48000Y19500
* According to the selected format
* According to the selected format
*/
*/
void
Gen_Line_EXCELLON
(
char
*
aLine
,
double
aCoordX
,
double
aCoordY
,
DRILL_PRECISION
&
aPrecision
)
void
EXCELLON_WRITER
::
WriteCoordinates
(
char
*
aLine
,
double
aCoordX
,
double
aCoordY
)
{
{
wxString
xs
,
ys
;
wxString
xs
,
ys
;
int
xpad
=
aPrecision
.
m_lhs
+
aP
recision
.
m_rhs
;
int
xpad
=
m_precision
.
m_lhs
+
m_p
recision
.
m_rhs
;
int
ypad
=
xpad
;
int
ypad
=
xpad
;
/* I need to come up with an algorithm that handles any lhs:rhs format.*/
/* I need to come up with an algorithm that handles any lhs:rhs format.*/
...
@@ -373,7 +411,7 @@ void Gen_Line_EXCELLON( char * aLine, double aCoordX, double aCoordY, DRILL_PREC
...
@@ -373,7 +411,7 @@ void Gen_Line_EXCELLON( char * aLine, double aCoordX, double aCoordY, DRILL_PREC
break
;
break
;
case
SUPPRESS_LEADING
:
/* that should work now */
case
SUPPRESS_LEADING
:
/* that should work now */
for
(
int
i
=
0
;
i
<
aP
recision
.
m_rhs
;
i
++
)
for
(
int
i
=
0
;
i
<
m_p
recision
.
m_rhs
;
i
++
)
{
{
aCoordX
*=
10
;
aCoordY
*=
10
;
aCoordX
*=
10
;
aCoordY
*=
10
;
}
}
...
@@ -383,7 +421,7 @@ void Gen_Line_EXCELLON( char * aLine, double aCoordX, double aCoordY, DRILL_PREC
...
@@ -383,7 +421,7 @@ void Gen_Line_EXCELLON( char * aLine, double aCoordX, double aCoordY, DRILL_PREC
case
SUPPRESS_TRAILING
:
case
SUPPRESS_TRAILING
:
{
{
for
(
int
i
=
0
;
i
<
aP
recision
.
m_rhs
;
i
++
)
for
(
int
i
=
0
;
i
<
m_p
recision
.
m_rhs
;
i
++
)
{
{
aCoordX
*=
10
;
aCoordX
*=
10
;
aCoordY
*=
10
;
aCoordY
*=
10
;
...
@@ -410,7 +448,7 @@ void Gen_Line_EXCELLON( char * aLine, double aCoordX, double aCoordY, DRILL_PREC
...
@@ -410,7 +448,7 @@ void Gen_Line_EXCELLON( char * aLine, double aCoordX, double aCoordY, DRILL_PREC
}
}
case
KEEP_ZEROS
:
case
KEEP_ZEROS
:
for
(
int
i
=
0
;
i
<
aP
recision
.
m_rhs
;
i
++
)
for
(
int
i
=
0
;
i
<
m_p
recision
.
m_rhs
;
i
++
)
{
{
aCoordX
*=
10
;
aCoordY
*=
10
;
aCoordX
*=
10
;
aCoordY
*=
10
;
}
}
...
@@ -431,37 +469,32 @@ void Gen_Line_EXCELLON( char * aLine, double aCoordX, double aCoordY, DRILL_PREC
...
@@ -431,37 +469,32 @@ void Gen_Line_EXCELLON( char * aLine, double aCoordX, double aCoordY, DRILL_PREC
* M48
* M48
* ;DRILL file {PCBNEW (2007-11-29-b)} date 17/1/2008-21:02:35
* ;DRILL file {PCBNEW (2007-11-29-b)} date 17/1/2008-21:02:35
* ;FORMAT={ <precision> / absolute / <units> / <numbers format>}
* ;FORMAT={ <precision> / absolute / <units> / <numbers format>}
* R,T
* VER,1
* FMAT,2
* FMAT,2
* INCH,TZ
* INCH,TZ
* TCST,OFF
* ICI,OFF
* ATC,ON
*/
*/
void
DIALOG_GENDRILL
::
Write_Excellon_Header
(
FILE
*
aFile
,
bool
aMinimalHeader
,
zeros_fmt
aFormat
)
void
EXCELLON_WRITER
::
WriteHeader
(
)
{
{
char
Line
[
256
];
char
Line
[
256
];
fputs
(
"M48
\n
"
,
aF
ile
);
// The beginning of a header
fputs
(
"M48
\n
"
,
m_f
ile
);
// The beginning of a header
if
(
!
aM
inimalHeader
)
if
(
!
m_m
inimalHeader
)
{
{
DateAndTime
(
Line
);
DateAndTime
(
Line
);
// The next 2 lines in EXCELLON files are comments:
// The next 2 lines in EXCELLON files are comments:
wxString
msg
=
wxGetApp
().
GetTitle
()
+
wxT
(
" "
)
+
GetBuildVersion
();
wxString
msg
=
wxGetApp
().
GetTitle
()
+
wxT
(
" "
)
+
GetBuildVersion
();
fprintf
(
aF
ile
,
";DRILL file {%s} date %s
\n
"
,
CONV_TO_UTF8
(
msg
),
fprintf
(
m_f
ile
,
";DRILL file {%s} date %s
\n
"
,
CONV_TO_UTF8
(
msg
),
Line
);
Line
);
msg
=
wxT
(
";FORMAT={"
);
msg
=
wxT
(
";FORMAT={"
);
// Print precision:
// Print precision:
if
(
a
Format
!=
DECIMAL_FORMAT
)
if
(
m_zero
Format
!=
DECIMAL_FORMAT
)
msg
<<
m_
Choice_Precision
->
GetStringSelection
();
msg
<<
m_
precision
.
GetPrecisionString
();
else
else
msg
<<
wxT
(
"-
.
-"
);
// in decimal format the precision is irrelevant
msg
<<
wxT
(
"-
:
-"
);
// in decimal format the precision is irrelevant
msg
<<
wxT
(
"/ absolute / "
);
msg
<<
wxT
(
"/ absolute / "
);
msg
<<
(
m_
UnitDrillIsInch
?
wxT
(
"inch"
)
:
wxT
(
"metric
"
)
);
msg
<<
(
m_
unitsDecimal
?
wxT
(
"metric"
)
:
wxT
(
"inch
"
)
);
/* Adding numbers notation format.
/* Adding numbers notation format.
* this is same as m_Choice_Zeros_Format strings, but NOT translated
* this is same as m_Choice_Zeros_Format strings, but NOT translated
...
@@ -479,37 +512,37 @@ void DIALOG_GENDRILL::Write_Excellon_Header( FILE* aFile, bool aMinimalHeader, z
...
@@ -479,37 +512,37 @@ void DIALOG_GENDRILL::Write_Excellon_Header( FILE* aFile, bool aMinimalHeader, z
wxT
(
"keep zeros"
)
wxT
(
"keep zeros"
)
};
};
msg
<<
zero_fmt
[
a
Format
];
msg
<<
zero_fmt
[
m_zero
Format
];
msg
<<
wxT
(
"}
\n
"
);
msg
<<
wxT
(
"}
\n
"
);
fputs
(
CONV_TO_UTF8
(
msg
),
aF
ile
);
fputs
(
CONV_TO_UTF8
(
msg
),
m_f
ile
);
fputs
(
"FMAT,2
\n
"
,
aF
ile
);
// Use Format 2 commands (version used since 1979)
fputs
(
"FMAT,2
\n
"
,
m_f
ile
);
// Use Format 2 commands (version used since 1979)
}
}
fputs
(
m_
UnitDrillIsInch
?
"INCH"
:
"METRIC"
,
aF
ile
);
fputs
(
m_
unitsDecimal
?
"METRIC"
:
"INCH"
,
m_f
ile
);
switch
(
a
Format
)
switch
(
m_zero
Format
)
{
{
case
SUPPRESS_LEADING
:
case
SUPPRESS_LEADING
:
case
DECIMAL_FORMAT
:
case
DECIMAL_FORMAT
:
fputs
(
",TZ
\n
"
,
aF
ile
);
fputs
(
",TZ
\n
"
,
m_f
ile
);
break
;
break
;
case
SUPPRESS_TRAILING
:
case
SUPPRESS_TRAILING
:
fputs
(
",LZ
\n
"
,
aF
ile
);
fputs
(
",LZ
\n
"
,
m_f
ile
);
break
;
break
;
case
KEEP_ZEROS
:
case
KEEP_ZEROS
:
fputs
(
",TZ
\n
"
,
aF
ile
);
// TZ is acceptable when all zeros are kept
fputs
(
",TZ
\n
"
,
m_f
ile
);
// TZ is acceptable when all zeros are kept
break
;
break
;
}
}
}
}
void
WriteEndOfFile_EXCELLON
(
FILE
*
aFile
)
void
EXCELLON_WRITER
::
WriteEndOfFile
(
)
{
{
//add if minimal here
//add if minimal here
fputs
(
"T0
\n
M30
\n
"
,
aF
ile
);
fputs
(
"T0
\n
M30
\n
"
,
m_f
ile
);
fclose
(
aF
ile
);
fclose
(
m_f
ile
);
}
}
...
...
pcbnew/gendrill.h
View file @
5944f4c4
...
@@ -12,8 +12,7 @@ public:
...
@@ -12,8 +12,7 @@ public:
int
m_Diameter
;
// the diameter of the used tool (for oblong, the smaller size)
int
m_Diameter
;
// the diameter of the used tool (for oblong, the smaller size)
int
m_TotalCount
;
// how many times it is used (round and oblong)
int
m_TotalCount
;
// how many times it is used (round and oblong)
int
m_OvalCount
;
// oblong count
int
m_OvalCount
;
// oblong count
public
:
public
:
DRILL_TOOL
(
int
diametre
)
DRILL_TOOL
(
int
diametre
)
{
{
m_TotalCount
=
0
;
m_TotalCount
=
0
;
m_OvalCount
=
0
;
m_OvalCount
=
0
;
...
@@ -40,39 +39,123 @@ public:
...
@@ -40,39 +39,123 @@ public:
/* the DRILL_PRECISION helper class to handle drill precision format in excellon files
/* the DRILL_PRECISION helper class to handle drill precision format in excellon files
*/
*/
class
DRILL_PRECISION
class
DRILL_PRECISION
{
{
public
:
public
:
int
m_lhs
;
// Left digit number (integer value of coordinates)
int
m_lhs
;
// Left digit number (integer value of coordinates)
int
m_rhs
;
// Right digit number (deciam value of coordinates)
int
m_rhs
;
// Right digit number (deciam value of coordinates)
public
:
public
:
DRILL_PRECISION
(
int
l
=
2
,
int
r
=
4
)
DRILL_PRECISION
(
int
l
=
2
,
int
r
=
4
)
{
{
m_lhs
=
l
;
m_rhs
=
r
;
m_lhs
=
l
;
m_rhs
=
r
;
}
}
wxString
GetPrecisionString
()
wxString
GetPrecisionString
()
{
{
wxString
text
;
wxString
text
;
text
<<
m_lhs
<<
wxT
(
":"
)
<<
m_rhs
;
text
<<
m_lhs
<<
wxT
(
":"
)
<<
m_rhs
;
return
text
;
return
text
;
}
}
};
};
/* zeros format */
enum
zeros_fmt
{
// A helper class to create Excellon drill files
class
EXCELLON_WRITER
{
public
:
enum
zeros_fmt
{
// Zero format in coordinates
DECIMAL_FORMAT
,
DECIMAL_FORMAT
,
SUPPRESS_LEADING
,
SUPPRESS_LEADING
,
SUPPRESS_TRAILING
,
SUPPRESS_TRAILING
,
KEEP_ZEROS
KEEP_ZEROS
};
};
wxPoint
m_Offset
;
// offset coordinates
bool
m_ShortHeader
;
// true to generate the smallest header (strip comments)
private
:
FILE
*
m_file
;
// The output file
BOARD
*
m_pcb
;
bool
m_minimalHeader
;
// True to use minimal haeder
// in excellon file (strip comments)
bool
m_unitsDecimal
;
// true = decimal, false = inches
zeros_fmt
m_zeroFormat
;
// the zero format option for output file
DRILL_PRECISION
m_precision
;
// The current coordinate precision (not used in decimat format)
double
m_conversionUnits
;
// scaling factor to convert the board unites to Excellon units
// (i.e inches or mm)
bool
m_mirror
;
wxPoint
m_offset
;
// Drill offset ooordinates
std
::
vector
<
HOLE_INFO
>*
m_holeListBuffer
;
// Buffer containing holes
std
::
vector
<
DRILL_TOOL
>*
m_toolListBuffer
;
// Buffer containing tools
public
:
EXCELLON_WRITER
(
BOARD
*
aPcb
,
FILE
*
aFile
,
wxPoint
aOffset
,
std
::
vector
<
HOLE_INFO
>*
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>*
aToolListBuffer
)
{
m_file
=
aFile
;
m_pcb
=
aPcb
;
m_zeroFormat
=
DECIMAL_FORMAT
;
m_holeListBuffer
=
aHoleListBuffer
;
m_toolListBuffer
=
aToolListBuffer
;
m_conversionUnits
=
0
.
0001
;
m_unitsDecimal
=
false
;
m_mirror
=
false
;
m_minimalHeader
=
false
;
}
~
EXCELLON_WRITER
()
{
}
/**
* SetFormat
* Initialize internal parameters to match the given format
* @param aMetric = true for metric coordinates, false for imperial units
* @param aZerosFmt = DECIMAL_FORMAT, SUPPRESS_LEADING, SUPPRESS_TRAILING, KEEP_ZEROS
* @param aLeftDigits = number of digits for integer part of coordinates
* @param aRightDigits = number of digits for mantissa part of coordinates
*/
void
SetFormat
(
bool
aMetric
,
zeros_fmt
aZerosFmt
,
int
aLeftDigits
,
int
aRightDigits
);
/**
* SetOptions
* Initialize internal parameters to match drill options
* @param aMetric = true for metric coordinates, false for imperial units
* @param aZerosFmt = DECIMAL_FORMAT, SUPPRESS_LEADING, SUPPRESS_TRAILING, KEEP_ZEROS
* @param aLeftDigits = number of digits for integer part of coordinates
* @param aRightDigits = number of digits for mantissa part of coordinates
*/
void
SetOptions
(
bool
aMirror
,
bool
aMinimalHeader
,
wxPoint
aOffset
)
{
m_mirror
=
aMirror
;
m_offset
=
aOffset
;
m_minimalHeader
=
aMinimalHeader
;
}
/**
* CreateDrillFile
* Creates an Excellon drill file
* @return hole count
*/
int
CreateDrillFile
();
private
:
void
WriteHeader
();
void
WriteEndOfFile
();
void
WriteCoordinates
(
char
*
aLine
,
double
aCoordX
,
double
aCoordY
);
};
/**
/**
* Function BuildHolesList
* Function BuildHolesList
* Create the list of holes and tools for a given board
* Create the list of holes and tools for a given board
* The list is sorted by incr
aesin
drill values
* The list is sorted by incr
easing
drill values
* Only holes from aFirstLayer to aLastLayer copper layers are listed (for vias, because pad holes are always through holes)
* Only holes from aFirstLayer to aLastLayer copper layers are listed (for vias, because pad holes are always through holes)
* @param Pcb : the given board
* @param Pcb : the given board
* @param aHoleListBuffer : the std::vector<HOLE_INFO> to fill with pcb holes info
* @param aHoleListBuffer : the std::vector<HOLE_INFO> to fill with pcb holes info
...
@@ -89,7 +172,7 @@ void Build_Holes_List( BOARD* Pcb, std::vector<HOLE_INFO>& aHoleListBuffer,
...
@@ -89,7 +172,7 @@ void Build_Holes_List( BOARD* Pcb, std::vector<HOLE_INFO>& aHoleListBuffer,
void
GenDrillMapFile
(
BOARD
*
aPcb
,
void
GenDrillMapFile
(
BOARD
*
aPcb
,
FILE
*
aFile
,
FILE
*
aFile
,
const
wxString
&
aFullFileName
,
const
wxString
&
aFullFileName
,
Ki_PageDescr
*
aSheet
,
Ki_PageDescr
*
aSheet
,
std
::
vector
<
HOLE_INFO
>
aHoleListBuffer
,
std
::
vector
<
HOLE_INFO
>
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>
aToolListBuffer
,
std
::
vector
<
DRILL_TOOL
>
aToolListBuffer
,
bool
aUnit_Drill_is_Inch
,
bool
aUnit_Drill_is_Inch
,
...
@@ -97,15 +180,15 @@ void GenDrillMapFile( BOARD* aPcb,
...
@@ -97,15 +180,15 @@ void GenDrillMapFile( BOARD* aPcb,
void
Gen_Drill_PcbMap
(
BOARD
*
aPcb
,
PLOTTER
*
plotter
,
void
Gen_Drill_PcbMap
(
BOARD
*
aPcb
,
PLOTTER
*
plotter
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
);
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
);
/*
/*
* Create a list of drill values and drill count
* Create a list of drill values and drill count
* there is only one report for all drill files even when buried or blinds vias exist
* there is only one report for all drill files even when buried or blinds vias exist
*/
*/
void
GenDrillReportFile
(
FILE
*
aFile
,
BOARD
*
aPcb
,
const
wxString
&
aBoardFilename
,
void
GenDrillReportFile
(
FILE
*
aFile
,
BOARD
*
aPcb
,
const
wxString
&
aBoardFilename
,
bool
aUnit_Drill_is_Inch
,
bool
aUnit_Drill_is_Inch
,
std
::
vector
<
HOLE_INFO
>
&
aHoleListBuffer
,
std
::
vector
<
HOLE_INFO
>
&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment