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
22affc67
Commit
22affc67
authored
Jan 25, 2008
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better support for micro vias. infos in changelog
parent
48dc3d06
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
226 additions
and
121 deletions
+226
-121
change_log.txt
change_log.txt
+12
-1
dialog_gendrill.h
pcbnew/dialog_gendrill.h
+1
-1
gen_drill_report_files.cpp
pcbnew/gen_drill_report_files.cpp
+100
-43
gen_holes_and_tools_lists_for_drill.cpp
pcbnew/gen_holes_and_tools_lists_for_drill.cpp
+54
-39
gendrill.cpp
pcbnew/gendrill.cpp
+42
-29
gendrill.h
pcbnew/gendrill.h
+17
-8
No files found.
change_log.txt
View file @
22affc67
...
@@ -9,7 +9,18 @@ email address.
...
@@ -9,7 +9,18 @@ email address.
2008-Jan-25 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Jan-25 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+pcbnew:
+pcbnew:
void Change_Side_Module( MODULE* Module, wxDC* DC ) is now member of class BOARD.
- void Change_Side_Module( MODULE* Module, wxDC* DC ) is now member of class BOARD.
- Better support for micro vias and buried vias (drill files now are useable for board manufacturers)
But not yet tested by a board manufacturer. Be carefull.
Todo: tools to conversion between via through and buried via and buried viad optimisation.
But must works for micro vias (needed for my next board)
(in pcbnew micro vias are blind vias between 2 adjacent layers: micro vias must be enabled
in Dimensions/track and via menu, and placed by ctrl v.
They are intended to connect small pitch BGA pins to the inner layer, and can be drilled by laser
if the hole diameter is small < 0.2mm. A laser can only drill a hole between 2 adjacent layers ).
** Currently use buried via for tests only, not for production **.
2008-Jan-24 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Jan-24 UPDATE Dick Hollenbeck <dick@softplc.com>
...
...
pcbnew/dialog_gendrill.h
View file @
22affc67
...
@@ -153,7 +153,7 @@ private:
...
@@ -153,7 +153,7 @@ private:
void
UpdatePrecisionOptions
(
wxCommandEvent
&
event
);
void
UpdatePrecisionOptions
(
wxCommandEvent
&
event
);
void
UpdateConfig
();
void
UpdateConfig
();
void
Write_Excellon_Header
(
FILE
*
aFile
);
void
Write_Excellon_Header
(
FILE
*
aFile
);
void
GenDrillReport
(
const
wxString
aFileName
,
std
::
vector
<
DRILL_TOOL
>
&
buffer
);
void
GenDrillReport
(
const
wxString
aFileName
);
int
Create_Drill_File_EXCELLON
(
std
::
vector
<
HOLE_INFO
>
&
aHoleListBuffer
,
int
Create_Drill_File_EXCELLON
(
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
);
...
...
pcbnew/gen_drill_report_files.cpp
View file @
22affc67
...
@@ -285,8 +285,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
...
@@ -285,8 +285,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
fputs
(
line
,
aFile
);
fputs
(
line
,
aFile
);
// Now list how many holes and ovals are associated with each drill.
// Now list how many holes and ovals are associated with each drill.
if
(
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
&&
if
(
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
(
aToolListBuffer
[
ii
].
m_OvalCount
==
0
)
)
&&
(
aToolListBuffer
[
ii
].
m_OvalCount
==
0
)
)
sprintf
(
line
,
"(1 hole)
\n
"
);
sprintf
(
line
,
"(1 hole)
\n
"
);
else
if
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
// && ( buffer[ii]m_OvalCount == 1 )
else
if
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
// && ( buffer[ii]m_OvalCount == 1 )
sprintf
(
line
,
"(1 hole) (with 1 oblong)
\n
"
);
sprintf
(
line
,
"(1 hole) (with 1 oblong)
\n
"
);
...
@@ -319,8 +319,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
...
@@ -319,8 +319,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
msg
=
CONV_FROM_UTF8
(
line
);
msg
=
CONV_FROM_UTF8
(
line
);
// Now list how many holes and ovals are associated with each drill.
// Now list how many holes and ovals are associated with each drill.
if
(
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
&&
if
(
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
(
aToolListBuffer
[
ii
].
m_OvalCount
==
0
)
)
&&
(
aToolListBuffer
[
ii
].
m_OvalCount
==
0
)
)
sprintf
(
line
,
"(1 hole)"
);
sprintf
(
line
,
"(1 hole)"
);
else
if
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
// && ( aToolListBuffer[ii]m_OvalCount == 1 )
else
if
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
// && ( aToolListBuffer[ii]m_OvalCount == 1 )
sprintf
(
line
,
"(1 hole) (with 1 oblong)"
);
sprintf
(
line
,
"(1 hole) (with 1 oblong)"
);
...
@@ -610,8 +610,11 @@ void PlotOvalDrillSymbol( const wxPoint& position, const wxSize& size, int orien
...
@@ -610,8 +610,11 @@ void PlotOvalDrillSymbol( const wxPoint& position, const wxSize& size, int orien
/**************************************************************************************************/
/**************************************************************************************************/
void
GenDrillReportFile
(
FILE
*
aFile
,
const
wxString
&
aBoardFilename
,
void
GenDrillReportFile
(
FILE
*
aFile
,
BOARD
*
aPcb
,
const
wxString
&
aBoardFilename
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
,
bool
aUnit_Drill_is_Inch
)
bool
aUnit_Drill_is_Inch
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
)
/*************************************************************************************************/
/*************************************************************************************************/
/*
/*
...
@@ -620,6 +623,10 @@ void GenDrillReportFile( FILE* aFile, const wxString& aBoardFilename,
...
@@ -620,6 +623,10 @@ void GenDrillReportFile( FILE* aFile, const wxString& aBoardFilename,
{
{
unsigned
TotalHoleCount
;
unsigned
TotalHoleCount
;
char
line
[
1024
];
char
line
[
1024
];
int
layer1
=
COPPER_LAYER_N
;
int
layer2
=
LAYER_CMP_N
;
bool
gen_through_holes
=
true
;
fprintf
(
aFile
,
"Drill report for %s
\n
"
,
CONV_TO_UTF8
(
aBoardFilename
)
);
fprintf
(
aFile
,
"Drill report for %s
\n
"
,
CONV_TO_UTF8
(
aBoardFilename
)
);
fprintf
(
aFile
,
"Created on %s
\n
"
,
DateAndTime
(
line
)
);
fprintf
(
aFile
,
"Created on %s
\n
"
,
DateAndTime
(
line
)
);
...
@@ -630,8 +637,41 @@ void GenDrillReportFile( FILE* aFile, const wxString& aBoardFilename,
...
@@ -630,8 +637,41 @@ void GenDrillReportFile( FILE* aFile, const wxString& aBoardFilename,
else
else
fputs
(
"Selected Drill Unit: Metric (mm)
\n\n
"
,
aFile
);
fputs
(
"Selected Drill Unit: Metric (mm)
\n\n
"
,
aFile
);
/* build hole lists:
* 1 - through holes
* 2 - for partial holes only: by layer pair
*/
for
(
;
;
)
{
Build_Holes_List
(
aPcb
,
aHoleListBuffer
,
aToolListBuffer
,
layer1
,
layer2
,
gen_through_holes
?
false
:
true
);
TotalHoleCount
=
0
;
TotalHoleCount
=
0
;
if
(
gen_through_holes
)
{
sprintf
(
line
,
"Drill report for through holes :
\n
"
);
}
else
{
if
(
layer1
==
COPPER_LAYER_N
)
// First partial hole list
{
sprintf
(
line
,
"Drill report for buried and blind vias :
\n\n
"
);
fputs
(
line
,
aFile
);
}
sprintf
(
line
,
"Drill report for holes from layer %s to layer %s
\n
"
,
CONV_TO_UTF8
(
aPcb
->
GetLayerName
(
layer1
)
),
CONV_TO_UTF8
(
aPcb
->
GetLayerName
(
layer2
)
)
);
}
fputs
(
line
,
aFile
);
for
(
unsigned
ii
=
0
;
ii
<
aToolListBuffer
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
aToolListBuffer
.
size
();
ii
++
)
{
{
// List the tool number assigned to each drill,
// List the tool number assigned to each drill,
...
@@ -650,7 +690,8 @@ void GenDrillReportFile( FILE* aFile, const wxString& aBoardFilename,
...
@@ -650,7 +690,8 @@ void GenDrillReportFile( FILE* aFile, const wxString& aBoardFilename,
fputs
(
line
,
aFile
);
fputs
(
line
,
aFile
);
// Now list how many holes and ovals are associated with each drill.
// Now list how many holes and ovals are associated with each drill.
if
(
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
&&
(
aToolListBuffer
[
ii
].
m_OvalCount
==
0
)
)
if
(
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
&&
(
aToolListBuffer
[
ii
].
m_OvalCount
==
0
)
)
sprintf
(
line
,
"(1 hole)
\n
"
);
sprintf
(
line
,
"(1 hole)
\n
"
);
else
if
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
else
if
(
aToolListBuffer
[
ii
].
m_TotalCount
==
1
)
sprintf
(
line
,
"(1 hole) (with 1 oblong)
\n
"
);
sprintf
(
line
,
"(1 hole) (with 1 oblong)
\n
"
);
...
@@ -669,8 +710,24 @@ void GenDrillReportFile( FILE* aFile, const wxString& aBoardFilename,
...
@@ -669,8 +710,24 @@ void GenDrillReportFile( FILE* aFile, const wxString& aBoardFilename,
TotalHoleCount
+=
aToolListBuffer
[
ii
].
m_TotalCount
;
TotalHoleCount
+=
aToolListBuffer
[
ii
].
m_TotalCount
;
}
}
sprintf
(
line
,
"
\n
total holes count %d
\n
"
,
TotalHoleCount
);
sprintf
(
line
,
"
\n
total holes count %d
\n\n
\n
"
,
TotalHoleCount
);
fputs
(
line
,
aFile
);
fputs
(
line
,
aFile
);
if
(
g_DesignSettings
.
m_CopperLayerCount
<=
2
)
break
;
if
(
gen_through_holes
)
layer2
=
layer1
+
1
;
else
{
if
(
layer2
>=
LAYER_CMP_N
)
// no more layer pair to consider
break
;
layer1
++
;
layer2
++
;
// use next layer pair
if
(
layer2
==
g_DesignSettings
.
m_CopperLayerCount
-
1
)
// The last layer is reached
layer2
=
LAYER_CMP_N
;
// the last layer is always the component layer
}
gen_through_holes
=
false
;
}
fclose
(
aFile
);
fclose
(
aFile
);
}
}
pcbnew/gen_holes_and_tools_lists_for_drill.cpp
View file @
22affc67
...
@@ -17,14 +17,15 @@ using namespace std;
...
@@ -17,14 +17,15 @@ using namespace std;
/* Local Functions */
/* Local Functions */
/* Compare function used for sorting holes by increasing diameter value
/* Compare function used for sorting holes by increasing diameter value
* and X value
* and X value
*/
*/
static
bool
CmpHoleDiameterValue
(
const
HOLE_INFO
&
a
,
const
HOLE_INFO
&
b
)
static
bool
CmpHoleDiameterValue
(
const
HOLE_INFO
&
a
,
const
HOLE_INFO
&
b
)
{
{
if
(
a
.
m_Hole_Diameter
!=
b
.
m_Hole_Diameter
)
if
(
a
.
m_Hole_Diameter
!=
b
.
m_Hole_Diameter
)
return
a
.
m_Hole_Diameter
<
b
.
m_Hole_Diameter
;
return
a
.
m_Hole_Diameter
<
b
.
m_Hole_Diameter
;
if
(
a
.
m_Hole_Pos_X
!=
b
.
m_Hole_Pos_X
)
if
(
a
.
m_Hole_Pos_X
!=
b
.
m_Hole_Pos_X
)
return
a
.
m_Hole_Pos_X
<
b
.
m_Hole_Pos_X
;
return
a
.
m_Hole_Pos_X
<
b
.
m_Hole_Pos_X
;
return
a
.
m_Hole_Pos_Y
<
b
.
m_Hole_Pos_Y
;
return
a
.
m_Hole_Pos_Y
<
b
.
m_Hole_Pos_Y
;
}
}
...
@@ -33,18 +34,20 @@ static bool CmpHoleDiameterValue( const HOLE_INFO& a, const HOLE_INFO& b )
...
@@ -33,18 +34,20 @@ static bool CmpHoleDiameterValue( const HOLE_INFO& a, const HOLE_INFO& b )
/**
/**
* 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
* @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
* @param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored (used to creates report file)
* @param aLastLayer = last layer to consider
* @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 )
*/
*/
void
Build_Holes_List
(
BOARD
*
aPcb
,
void
Build_Holes_List
(
BOARD
*
aPcb
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
,
int
aFirstLayer
,
int
aLastLayer
)
int
aFirstLayer
,
int
aLastLayer
,
bool
aExcludeThroughHoles
)
{
{
HOLE_INFO
new_hole
;
HOLE_INFO
new_hole
;
int
hole_value
;
int
hole_value
;
...
@@ -52,8 +55,11 @@ void Build_Holes_List( BOARD* aPcb,
...
@@ -52,8 +55,11 @@ void Build_Holes_List( BOARD* aPcb,
aHoleListBuffer
.
clear
();
aHoleListBuffer
.
clear
();
aToolListBuffer
.
clear
();
aToolListBuffer
.
clear
();
if
(
(
aFirstLayer
>=
0
)
&&
(
aLastLayer
>=
0
)
)
{
if
(
aFirstLayer
>
aLastLayer
)
if
(
aFirstLayer
>
aLastLayer
)
EXCHG
(
aFirstLayer
,
aLastLayer
);
EXCHG
(
aFirstLayer
,
aLastLayer
);
}
/* build hole list for vias */
/* build hole list for vias */
TRACK
*
track
=
aPcb
->
m_Track
;
TRACK
*
track
=
aPcb
->
m_Track
;
...
@@ -73,15 +79,23 @@ void Build_Holes_List( BOARD* aPcb,
...
@@ -73,15 +79,23 @@ void Build_Holes_List( BOARD* aPcb,
new_hole
.
m_Hole_Pos_X
=
via
->
m_Start
.
x
;
new_hole
.
m_Hole_Pos_X
=
via
->
m_Start
.
x
;
new_hole
.
m_Hole_Pos_Y
=
via
->
m_Start
.
y
;
// hole position
new_hole
.
m_Hole_Pos_Y
=
via
->
m_Start
.
y
;
// hole position
via
->
ReturnLayerPair
(
&
new_hole
.
m_Hole_Top_Layer
,
&
new_hole
.
m_Hole_Bottom_Layer
);
via
->
ReturnLayerPair
(
&
new_hole
.
m_Hole_Top_Layer
,
&
new_hole
.
m_Hole_Bottom_Layer
);
// ReturnLayerPair return params with m_Hole_Bottom_Layer < m_Hole_Top_Layer
// ReturnLayerPair return params with m_Hole_Bottom_Layer < m_Hole_Top_Layer
if
(
new_hole
.
m_Hole_Bottom_Layer
>
aFirstLayer
)
if
(
(
new_hole
.
m_Hole_Bottom_Layer
>
aFirstLayer
)
&&
(
aFirstLayer
>=
0
)
)
continue
;
continue
;
if
(
new_hole
.
m_Hole_Top_Layer
<
aLastLayer
)
if
(
(
new_hole
.
m_Hole_Top_Layer
<
aLastLayer
)
&&
(
aLastLayer
>=
0
)
)
continue
;
continue
;
if
(
aExcludeThroughHoles
&&
(
new_hole
.
m_Hole_Bottom_Layer
==
COPPER_LAYER_N
)
&&
(
new_hole
.
m_Hole_Top_Layer
==
LAYER_CMP_N
)
)
continue
;
aHoleListBuffer
.
push_back
(
new_hole
);
aHoleListBuffer
.
push_back
(
new_hole
);
}
}
/* build hole list for pads */
/* build hole list for pads (assumed always through holes) */
if
(
!
aExcludeThroughHoles
)
{
MODULE
*
Module
=
aPcb
->
m_Modules
;
MODULE
*
Module
=
aPcb
->
m_Modules
;
for
(
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
for
(
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
{
{
...
@@ -107,6 +121,7 @@ void Build_Holes_List( BOARD* aPcb,
...
@@ -107,6 +121,7 @@ void Build_Holes_List( BOARD* aPcb,
aHoleListBuffer
.
push_back
(
new_hole
);
aHoleListBuffer
.
push_back
(
new_hole
);
}
}
}
}
}
// Sort holes per increasing diameter value
// Sort holes per increasing diameter value
sort
(
aHoleListBuffer
.
begin
(),
aHoleListBuffer
.
end
(),
CmpHoleDiameterValue
);
sort
(
aHoleListBuffer
.
begin
(),
aHoleListBuffer
.
end
(),
CmpHoleDiameterValue
);
...
...
pcbnew/gendrill.cpp
View file @
22affc67
...
@@ -251,14 +251,23 @@ void WinEDA_DrillFrame::UpdateConfig()
...
@@ -251,14 +251,23 @@ void WinEDA_DrillFrame::UpdateConfig()
void
WinEDA_DrillFrame
::
GenDrillFiles
(
wxCommandEvent
&
event
)
void
WinEDA_DrillFrame
::
GenDrillFiles
(
wxCommandEvent
&
event
)
/*************************************************************/
/*************************************************************/
/* Calls the functions to create EXCELLON drill files and/od drill map files
/**
* Function GenDrillFiles
* Calls the functions to create EXCELLON drill files and/od drill map files
* When all holes are through, one excellon file is created
* when there are some partial holes (some blind or buried vias:
* One excellon file is created, for all through holes.
* And one file per layer pair, which have one or more holes, excluding through holes, already in the first file.
*/
*/
{
{
wxString
FullFileName
,
Mask
(
wxT
(
"*"
)
),
Ext
(
wxT
(
".drl"
)
);
wxString
FullFileName
,
Mask
(
wxT
(
"*"
)
),
Ext
(
wxT
(
".drl"
)
);
wxString
BaseFileName
;
wxString
layer_extend
;
// added to the Board FileName to create FullFileName (= Board FileName + layer pair names)
wxString
msg
;
wxString
msg
;
bool
ExistsBuriedVias
=
false
;
// If true, dri
il files are created layer pair by layer pair
bool
ExistsBuriedVias
=
false
;
// If true, dri
ll files are created layer pair by layer pair for buried vias
int
layer1
=
COPPER_LAYER_N
;
int
layer1
=
COPPER_LAYER_N
;
int
layer2
=
LAYER_CMP_N
;
int
layer2
=
LAYER_CMP_N
;
bool
gen_through_holes
=
true
;
UpdateConfig
();
/* set params and Save drill options */
UpdateConfig
();
/* set params and Save drill options */
...
@@ -272,16 +281,17 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
...
@@ -272,16 +281,17 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
if
(
m_MicroViasCount
||
m_BlindOrBuriedViasCount
)
if
(
m_MicroViasCount
||
m_BlindOrBuriedViasCount
)
ExistsBuriedVias
=
true
;
ExistsBuriedVias
=
true
;
if
(
ExistsBuriedVias
)
layer2
=
layer1
+
1
;;
/* Get the file name */
Mask
+=
Ext
;
Mask
+=
Ext
;
for
(
;
;
)
for
(
;
;
)
{
{
Build_Holes_List
(
m_Parent
->
m_Pcb
,
s_HoleListBuffer
,
s_ToolListBuffer
,
layer1
,
layer2
,
gen_through_holes
?
false
:
true
);
if
(
s_ToolListBuffer
.
size
()
==
0
)
// No holes !
continue
;
FullFileName
=
m_Parent
->
m_CurrentScreen
->
m_FileName
;
FullFileName
=
m_Parent
->
m_CurrentScreen
->
m_FileName
;
wxString
layer_extend
;
layer_extend
.
Empty
();
layer_extend
.
Empty
();
if
(
ExistsBuriedVia
s
)
if
(
!
gen_through_hole
s
)
{
{
if
(
layer1
==
COPPER_LAYER_N
)
if
(
layer1
==
COPPER_LAYER_N
)
layer_extend
<<
wxT
(
"-copper"
);
layer_extend
<<
wxT
(
"-copper"
);
...
@@ -305,9 +315,6 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
...
@@ -305,9 +315,6 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
TRUE
TRUE
);
);
Build_Holes_List
(
m_Parent
->
m_Pcb
,
s_HoleListBuffer
,
s_ToolListBuffer
,
layer1
,
layer2
);
if
(
FullFileName
!=
wxEmptyString
)
if
(
FullFileName
!=
wxEmptyString
)
{
{
dest
=
wxFopen
(
FullFileName
,
wxT
(
"w"
)
);
dest
=
wxFopen
(
FullFileName
,
wxT
(
"w"
)
);
...
@@ -328,32 +335,35 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
...
@@ -328,32 +335,35 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
break
;
break
;
case
1
:
case
1
:
GenDrillMap
(
FullFileName
,
GenDrillMap
(
FullFileName
,
s_HoleListBuffer
,
s_ToolListBuffer
,
PLOT_FORMAT_HPGL
);
s_HoleListBuffer
,
s_ToolListBuffer
,
PLOT_FORMAT_HPGL
);
break
;
break
;
case
2
:
case
2
:
GenDrillMap
(
FullFileName
,
GenDrillMap
(
FullFileName
,
s_HoleListBuffer
,
s_ToolListBuffer
,
PLOT_FORMAT_POST
);
s_HoleListBuffer
,
s_ToolListBuffer
,
PLOT_FORMAT_POST
);
break
;
break
;
}
}
if
(
m_Choice_Drill_Report
->
GetSelection
()
>
0
)
GenDrillReport
(
FullFileName
,
s_ToolListBuffer
);
if
(
!
ExistsBuriedVias
)
if
(
!
ExistsBuriedVias
)
break
;
break
;
if
(
gen_through_holes
)
layer2
=
layer1
+
1
;
else
{
if
(
layer2
>=
LAYER_CMP_N
)
// no more layer pair to consider
if
(
layer2
>=
LAYER_CMP_N
)
// no more layer pair to consider
break
;
break
;
layer1
++
;
layer2
++
;
// use next layer pair
layer1
++
;
layer2
++
;
// use next layer pair
if
(
layer2
==
g_DesignSettings
.
m_CopperLayerCount
-
1
)
// The last layer is reached
if
(
layer2
==
g_DesignSettings
.
m_CopperLayerCount
-
1
)
// The last layer is reached
layer2
=
LAYER_CMP_N
;
// the last layer is always the component layer
layer2
=
LAYER_CMP_N
;
// the last layer is always the component layer
}
}
gen_through_holes
=
false
;
}
if
(
m_Choice_Drill_Report
->
GetSelection
()
>
0
)
{
FullFileName
=
m_Parent
->
m_CurrentScreen
->
m_FileName
;
GenDrillReport
(
FullFileName
);
}
EndModal
(
0
);
EndModal
(
0
);
}
}
...
@@ -747,7 +757,7 @@ void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
...
@@ -747,7 +757,7 @@ void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
/**************************************************************************************************/
/**************************************************************************************************/
void
WinEDA_DrillFrame
::
GenDrillReport
(
const
wxString
aFileName
,
std
::
vector
<
DRILL_TOOL
>&
buffer
)
void
WinEDA_DrillFrame
::
GenDrillReport
(
const
wxString
aFileName
)
/**************************************************************************************************/
/**************************************************************************************************/
/*
/*
...
@@ -780,6 +790,9 @@ void WinEDA_DrillFrame::GenDrillReport( const wxString aFileName, std::vector<DR
...
@@ -780,6 +790,9 @@ void WinEDA_DrillFrame::GenDrillReport( const wxString aFileName, std::vector<DR
DisplayError
(
this
,
msg
);
DisplayError
(
this
,
msg
);
return
;
return
;
}
}
GenDrillReportFile
(
dest
,
m_Parent
->
m_Pcb
,
GenDrillReportFile
(
dest
,
m_Parent
->
m_CurrentScreen
->
m_FileName
,
buffer
,
s_Unit_Drill_is_Inch
);
m_Parent
->
m_CurrentScreen
->
m_FileName
,
s_Unit_Drill_is_Inch
,
s_HoleListBuffer
,
s_ToolListBuffer
);
}
}
pcbnew/gendrill.h
View file @
22affc67
/******************************************************************************
*
/
/******************************************************************************/
/* classes and functions declaration u
n
sed in drill file and report generation */
/* classes and functions declaration used in drill file and report generation */
/******************************************************************************
*
/
/******************************************************************************/
#ifndef GENDRILL_H
#ifndef GENDRILL_H
#define GENDRILL_H
#define GENDRILL_H
/* the DRILL_TOOL class handle tools used in the excellon drill file */
/* the DRILL_TOOL class handle
s
tools used in the excellon drill file */
class
DRILL_TOOL
class
DRILL_TOOL
{
{
public
:
public
:
...
@@ -62,13 +62,18 @@ enum zeros_fmt {
...
@@ -62,13 +62,18 @@ enum zeros_fmt {
/**
/**
* 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 incraesin drill values
* 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 info
* @param aHoleListBuffer : the std::vector<HOLE_INFO> to fill with pcb
holes
info
* @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
* @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
* @param aExcludeThroughHoles : if true, exclude through holes ( pads and vias through )
*/
*/
void
Build_Holes_List
(
BOARD
*
Pcb
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
void
Build_Holes_List
(
BOARD
*
Pcb
,
std
::
vector
<
HOLE_INFO
>&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
,
int
aFirstLayer
,
int
aLastLayer
);
int
aFirstLayer
,
int
aLastLayer
,
bool
aExcludeThroughHoles
);
void
GenDrillMapFile
(
BOARD
*
aPcb
,
void
GenDrillMapFile
(
BOARD
*
aPcb
,
...
@@ -87,8 +92,12 @@ void Gen_Drill_PcbMap( BOARD* aPcb, FILE* aFile,
...
@@ -87,8 +92,12 @@ void Gen_Drill_PcbMap( BOARD* aPcb, FILE* aFile,
/*
/*
* 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
*/
*/
void
GenDrillReportFile
(
FILE
*
aFile
,
const
wxString
&
aBoardFilename
,
void
GenDrillReportFile
(
FILE
*
aFile
,
BOARD
*
aPcb
,
const
wxString
&
aBoardFilename
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
,
bool
aUnit_Drill_is_Inch
);
bool
aUnit_Drill_is_Inch
,
std
::
vector
<
HOLE_INFO
>
&
aHoleListBuffer
,
std
::
vector
<
DRILL_TOOL
>&
aToolListBuffer
);
#endif // #ifndef GENDRILL_H
#endif // #ifndef GENDRILL_H
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