Better support for micro vias. infos in changelog
This commit is contained in:
parent
48dc3d0695
commit
22affc6750
|
@ -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>
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
|
@ -285,10 +285,10 @@ 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" );
|
||||||
else if( aToolListBuffer[ii].m_OvalCount == 0 )
|
else if( aToolListBuffer[ii].m_OvalCount == 0 )
|
||||||
sprintf( line, "(%d holes)\n",
|
sprintf( line, "(%d holes)\n",
|
||||||
|
@ -296,7 +296,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
|
||||||
else if( aToolListBuffer[ii].m_OvalCount == 1 )
|
else if( aToolListBuffer[ii].m_OvalCount == 1 )
|
||||||
sprintf( line, "(%d holes) (with 1 oblong)\n",
|
sprintf( line, "(%d holes) (with 1 oblong)\n",
|
||||||
aToolListBuffer[ii].m_TotalCount );
|
aToolListBuffer[ii].m_TotalCount );
|
||||||
else // if ( aToolListBuffer[ii]m_OvalCount > 1 )
|
else // if ( aToolListBuffer[ii]m_OvalCount > 1 )
|
||||||
sprintf( line, "(%d holes) (with %d oblongs)\n",
|
sprintf( line, "(%d holes) (with %d oblongs)\n",
|
||||||
aToolListBuffer[ii].m_TotalCount,
|
aToolListBuffer[ii].m_TotalCount,
|
||||||
aToolListBuffer[ii].m_OvalCount );
|
aToolListBuffer[ii].m_OvalCount );
|
||||||
|
@ -319,10 +319,10 @@ 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)" );
|
||||||
else if( aToolListBuffer[ii].m_OvalCount == 0 )
|
else if( aToolListBuffer[ii].m_OvalCount == 0 )
|
||||||
sprintf( line, "(%d holes)",
|
sprintf( line, "(%d holes)",
|
||||||
|
@ -330,7 +330,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
|
||||||
else if( aToolListBuffer[ii].m_OvalCount == 1 )
|
else if( aToolListBuffer[ii].m_OvalCount == 1 )
|
||||||
sprintf( line, "(%d holes) (with 1 oblong)",
|
sprintf( line, "(%d holes) (with 1 oblong)",
|
||||||
aToolListBuffer[ii].m_TotalCount );
|
aToolListBuffer[ii].m_TotalCount );
|
||||||
else // if ( aToolListBuffer[ii]m_OvalCount > 1 )
|
else // if ( aToolListBuffer[ii]m_OvalCount > 1 )
|
||||||
sprintf( line, "(%d holes) (with %d oblongs)",
|
sprintf( line, "(%d holes) (with %d oblongs)",
|
||||||
aToolListBuffer[ii].m_TotalCount,
|
aToolListBuffer[ii].m_TotalCount,
|
||||||
aToolListBuffer[ii].m_OvalCount );
|
aToolListBuffer[ii].m_OvalCount );
|
||||||
|
@ -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,
|
||||||
{
|
{
|
||||||
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,47 +637,97 @@ 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 );
|
||||||
|
|
||||||
TotalHoleCount = 0;
|
/* build hole lists:
|
||||||
|
* 1 - through holes
|
||||||
|
* 2 - for partial holes only: by layer pair
|
||||||
|
*/
|
||||||
|
|
||||||
for( unsigned ii = 0; ii < aToolListBuffer.size(); ii++ )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
// List the tool number assigned to each drill,
|
Build_Holes_List( aPcb,
|
||||||
// then its diameter in the selected Drill Unit,
|
aHoleListBuffer,
|
||||||
// and then its diameter in the other Drill Unit.
|
aToolListBuffer,
|
||||||
if( aUnit_Drill_is_Inch )
|
layer1,
|
||||||
sprintf( line, "T%d %2.3f\" %2.2fmm ",
|
layer2,
|
||||||
ii + 1,
|
gen_through_holes ? false : true );
|
||||||
float (aToolListBuffer[ii].m_Diameter) * 0.0001,
|
|
||||||
float (aToolListBuffer[ii].m_Diameter) * 0.00254 );
|
TotalHoleCount = 0;
|
||||||
|
|
||||||
|
if( gen_through_holes )
|
||||||
|
{
|
||||||
|
sprintf( line, "Drill report for through holes :\n" );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
sprintf( line, "T%d %2.2fmm %2.3f\" ",
|
{
|
||||||
ii + 1,
|
if ( layer1 == COPPER_LAYER_N ) // First partial hole list
|
||||||
float (aToolListBuffer[ii].m_Diameter) * 0.00254,
|
{
|
||||||
float (aToolListBuffer[ii].m_Diameter) * 0.0001 );
|
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 );
|
fputs( line, aFile );
|
||||||
|
|
||||||
// Now list how many holes and ovals are associated with each drill.
|
for( unsigned ii = 0; ii < aToolListBuffer.size(); ii++ )
|
||||||
if( ( aToolListBuffer[ii].m_TotalCount == 1 ) && ( aToolListBuffer[ii].m_OvalCount == 0 ) )
|
{
|
||||||
sprintf( line, "(1 hole)\n" );
|
// List the tool number assigned to each drill,
|
||||||
else if( aToolListBuffer[ii].m_TotalCount == 1 )
|
// then its diameter in the selected Drill Unit,
|
||||||
sprintf( line, "(1 hole) (with 1 oblong)\n" );
|
// and then its diameter in the other Drill Unit.
|
||||||
else if( aToolListBuffer[ii].m_OvalCount == 0 )
|
if( aUnit_Drill_is_Inch )
|
||||||
sprintf( line, "(%d holes)\n",
|
sprintf( line, "T%d %2.3f\" %2.2fmm ",
|
||||||
aToolListBuffer[ii].m_TotalCount );
|
ii + 1,
|
||||||
else if( aToolListBuffer[ii].m_OvalCount == 1 )
|
float (aToolListBuffer[ii].m_Diameter) * 0.0001,
|
||||||
sprintf( line, "(%d holes) (with 1 oblong)\n",
|
float (aToolListBuffer[ii].m_Diameter) * 0.00254 );
|
||||||
aToolListBuffer[ii].m_TotalCount );
|
else
|
||||||
else // if ( buffer[ii]m_OvalCount > 1 )
|
sprintf( line, "T%d %2.2fmm %2.3f\" ",
|
||||||
sprintf( line, "(%d holes) (with %d oblongs)\n",
|
ii + 1,
|
||||||
aToolListBuffer[ii].m_TotalCount,
|
float (aToolListBuffer[ii].m_Diameter) * 0.00254,
|
||||||
aToolListBuffer[ii].m_OvalCount );
|
float (aToolListBuffer[ii].m_Diameter) * 0.0001 );
|
||||||
|
fputs( line, aFile );
|
||||||
|
|
||||||
|
// Now list how many holes and ovals are associated with each drill.
|
||||||
|
if( ( aToolListBuffer[ii].m_TotalCount == 1 )
|
||||||
|
&& ( aToolListBuffer[ii].m_OvalCount == 0 ) )
|
||||||
|
sprintf( line, "(1 hole)\n" );
|
||||||
|
else if( aToolListBuffer[ii].m_TotalCount == 1 )
|
||||||
|
sprintf( line, "(1 hole) (with 1 oblong)\n" );
|
||||||
|
else if( aToolListBuffer[ii].m_OvalCount == 0 )
|
||||||
|
sprintf( line, "(%d holes)\n",
|
||||||
|
aToolListBuffer[ii].m_TotalCount );
|
||||||
|
else if( aToolListBuffer[ii].m_OvalCount == 1 )
|
||||||
|
sprintf( line, "(%d holes) (with 1 oblong)\n",
|
||||||
|
aToolListBuffer[ii].m_TotalCount );
|
||||||
|
else // if ( buffer[ii]m_OvalCount > 1 )
|
||||||
|
sprintf( line, "(%d holes) (with %d oblongs)\n",
|
||||||
|
aToolListBuffer[ii].m_TotalCount,
|
||||||
|
aToolListBuffer[ii].m_OvalCount );
|
||||||
|
fputs( line, aFile );
|
||||||
|
|
||||||
|
TotalHoleCount += aToolListBuffer[ii].m_TotalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf( line, "\ntotal holes count %d\n\n\n", TotalHoleCount );
|
||||||
fputs( line, aFile );
|
fputs( line, aFile );
|
||||||
|
|
||||||
TotalHoleCount += aToolListBuffer[ii].m_TotalCount;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( line, "\ntotal holes count %d\n", TotalHoleCount );
|
|
||||||
fputs( line, aFile );
|
|
||||||
|
|
||||||
fclose( aFile );
|
fclose( aFile );
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,34 +17,37 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
* The list is sorted by increasing 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,11 +55,14 @@ void Build_Holes_List( BOARD* aPcb,
|
||||||
aHoleListBuffer.clear();
|
aHoleListBuffer.clear();
|
||||||
aToolListBuffer.clear();
|
aToolListBuffer.clear();
|
||||||
|
|
||||||
if( aFirstLayer > aLastLayer )
|
if( (aFirstLayer >= 0) && (aLastLayer >= 0) )
|
||||||
EXCHG( aFirstLayer, aLastLayer );
|
{
|
||||||
|
if( 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;
|
||||||
for( ; track != NULL; track = track->Next() )
|
for( ; track != NULL; track = track->Next() )
|
||||||
{
|
{
|
||||||
if( track->Type() != TYPEVIA )
|
if( track->Type() != TYPEVIA )
|
||||||
|
@ -73,38 +79,47 @@ 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
|
|
||||||
if( new_hole.m_Hole_Bottom_Layer > aFirstLayer )
|
// ReturnLayerPair return params with m_Hole_Bottom_Layer < m_Hole_Top_Layer
|
||||||
|
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) */
|
||||||
MODULE* Module = aPcb->m_Modules;
|
if( !aExcludeThroughHoles )
|
||||||
for( ; Module != NULL; Module = Module->Next() )
|
|
||||||
{
|
{
|
||||||
/* Read and analyse pads */
|
MODULE* Module = aPcb->m_Modules;
|
||||||
D_PAD* pad = Module->m_Pads;
|
for( ; Module != NULL; Module = Module->Next() )
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
|
||||||
{
|
{
|
||||||
if( pad->m_Drill.x == 0 )
|
/* Read and analyse pads */
|
||||||
continue;
|
D_PAD* pad = Module->m_Pads;
|
||||||
new_hole.m_Tool_Reference = -1; // Flag is: Not initialized
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
new_hole.m_Hole_Orient = pad->m_Orient;
|
{
|
||||||
new_hole.m_Hole_Shape = 0; // hole shape: round
|
if( pad->m_Drill.x == 0 )
|
||||||
new_hole.m_Hole_Diameter = min( pad->m_Drill.x, pad->m_Drill.x );
|
continue;
|
||||||
new_hole.m_Hole_SizeX = new_hole.m_Hole_SizeY = new_hole.m_Hole_Diameter;
|
new_hole.m_Tool_Reference = -1; // Flag is: Not initialized
|
||||||
if( pad->m_DrillShape != PAD_CIRCLE )
|
new_hole.m_Hole_Orient = pad->m_Orient;
|
||||||
new_hole.m_Hole_Shape = 1; // oval flag set
|
new_hole.m_Hole_Shape = 0; // hole shape: round
|
||||||
new_hole.m_Hole_SizeX = pad->m_Drill.x;
|
new_hole.m_Hole_Diameter = min( pad->m_Drill.x, pad->m_Drill.x );
|
||||||
new_hole.m_Hole_SizeY = pad->m_Drill.y;
|
new_hole.m_Hole_SizeX = new_hole.m_Hole_SizeY = new_hole.m_Hole_Diameter;
|
||||||
new_hole.m_Hole_Pos_X = pad->m_Pos.x;
|
if( pad->m_DrillShape != PAD_CIRCLE )
|
||||||
new_hole.m_Hole_Pos_Y = pad->m_Pos.y; // hole position
|
new_hole.m_Hole_Shape = 1; // oval flag set
|
||||||
new_hole.m_Hole_Bottom_Layer = COPPER_LAYER_N;
|
new_hole.m_Hole_SizeX = pad->m_Drill.x;
|
||||||
new_hole.m_Hole_Top_Layer = LAYER_CMP_N; // pad holes are through holes
|
new_hole.m_Hole_SizeY = pad->m_Drill.y;
|
||||||
aHoleListBuffer.push_back( new_hole );
|
new_hole.m_Hole_Pos_X = pad->m_Pos.x;
|
||||||
|
new_hole.m_Hole_Pos_Y = pad->m_Pos.y; // hole position
|
||||||
|
new_hole.m_Hole_Bottom_Layer = COPPER_LAYER_N;
|
||||||
|
new_hole.m_Hole_Top_Layer = LAYER_CMP_N; // pad holes are through holes
|
||||||
|
aHoleListBuffer.push_back( new_hole );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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, driil files are created layer pair by layer pair
|
bool ExistsBuriedVias = false; // If true, drill 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 )
|
||||||
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( ExistsBuriedVias )
|
if( !gen_through_holes )
|
||||||
{
|
{
|
||||||
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 )
|
||||||
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,33 +335,36 @@ 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 )
|
||||||
if( layer2 >= LAYER_CMP_N ) // no more layer pair to consider
|
layer2 = layer1 + 1;
|
||||||
break;
|
else
|
||||||
layer1++; layer2++; // use next layer pair
|
{
|
||||||
if( layer2 == g_DesignSettings.m_CopperLayerCount - 1 ) // The last layer is reached
|
if( layer2 >= LAYER_CMP_N ) // no more layer pair to consider
|
||||||
layer2 = LAYER_CMP_N; // the last layer is always the component layer
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************************************/
|
/**************************************************************************************************/
|
||||||
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
|
||||||
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 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/*******************************************************************************/
|
/******************************************************************************/
|
||||||
/* classes and functions declaration unsed 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 handles tools used in the excellon drill file */
|
||||||
class DRILL_TOOL
|
class DRILL_TOOL
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -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,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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
|
||||||
|
|
Loading…
Reference in New Issue