fixed a logical bug in the creation of drill files.

This commit is contained in:
lifekidyeaa 2008-03-05 04:51:48 +00:00
parent bbb131b2ea
commit e6602b0c94
3 changed files with 62 additions and 61 deletions

View File

@ -73,7 +73,7 @@ WinEDA_DrillFrame::WinEDA_DrillFrame( WinEDA_PcbFrame* parent, wxWindowID id,
const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{ {
m_Parent = parent; m_Parent = parent;
SetFont( *g_DialogFont ); //SetFont( *g_DialogFont );
SetReturnCode( 1 ); SetReturnCode( 1 );
Init(); Init();

View File

@ -286,65 +286,65 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
{ {
Build_Holes_List( m_Parent->m_Pcb, s_HoleListBuffer, s_ToolListBuffer, Build_Holes_List( m_Parent->m_Pcb, s_HoleListBuffer, s_ToolListBuffer,
layer1, layer2, gen_through_holes ? false : true ); layer1, layer2, gen_through_holes ? false : true );
if( s_ToolListBuffer.size() == 0 ) // No holes ! if( s_ToolListBuffer.size() > 0 ) //holes?
continue; {
FullFileName = m_Parent->m_CurrentScreen->m_FileName;
layer_extend.Empty();
if( !gen_through_holes )
{
if( layer1 == COPPER_LAYER_N )
layer_extend << wxT( "-copper" );
else
layer_extend << wxT( "-inner" ) << layer1;
if( layer2 == LAYER_CMP_N )
layer_extend << wxT( "-cmp" );
else
layer_extend << wxT( "-inner" ) << layer2;
}
layer_extend << Ext;
ChangeFileNameExt( FullFileName, layer_extend );
FullFileName = m_Parent->m_CurrentScreen->m_FileName; FullFileName = EDA_FileSelector( _( "Drill file" ),
layer_extend.Empty(); wxEmptyString, /* Chemin par defaut */
if( !gen_through_holes ) FullFileName, /* nom fichier par defaut */
{ Ext, /* extension par defaut */
if( layer1 == COPPER_LAYER_N ) Mask, /* Masque d'affichage */
layer_extend << wxT( "-copper" ); this,
else wxFD_SAVE,
layer_extend << wxT( "-inner" ) << layer1; TRUE
if( layer2 == LAYER_CMP_N ) );
layer_extend << wxT( "-cmp" );
else
layer_extend << wxT( "-inner" ) << layer2;
}
layer_extend << Ext;
ChangeFileNameExt( FullFileName, layer_extend );
FullFileName = EDA_FileSelector( _( "Drill file" ), if( FullFileName != wxEmptyString )
wxEmptyString, /* Chemin par defaut */ {
FullFileName, /* nom fichier par defaut */ dest = wxFopen( FullFileName, wxT( "w" ) );
Ext, /* extension par defaut */ if( dest == 0 )
Mask, /* Masque d'affichage */ {
this, msg = _( "Unable to create file " ) + FullFileName;
wxFD_SAVE, DisplayError( this, msg );
TRUE EndModal( 0 );
); return;
}
if( FullFileName != wxEmptyString ) Create_Drill_File_EXCELLON( s_HoleListBuffer, s_ToolListBuffer );
{ }
dest = wxFopen( FullFileName, wxT( "w" ) );
if( dest == 0 )
{
msg = _( "Unable to create file " ) + FullFileName;
DisplayError( this, msg );
EndModal( 0 );
return;
}
Create_Drill_File_EXCELLON( s_HoleListBuffer, s_ToolListBuffer ); switch( m_Choice_Drill_Map->GetSelection() )
} {
case 0:
break;
switch( m_Choice_Drill_Map->GetSelection() ) case 1:
{ GenDrillMap( FullFileName, s_HoleListBuffer, s_ToolListBuffer, PLOT_FORMAT_HPGL );
case 0: break;
break;
case 1: case 2:
GenDrillMap( FullFileName, s_HoleListBuffer, s_ToolListBuffer, PLOT_FORMAT_HPGL ); GenDrillMap( FullFileName, s_HoleListBuffer, s_ToolListBuffer, PLOT_FORMAT_POST );
break; break;
}
case 2: if( !ExistsBuriedVias )
GenDrillMap( FullFileName, s_HoleListBuffer, s_ToolListBuffer, PLOT_FORMAT_POST ); break;
break; }
}
if( !ExistsBuriedVias )
break;
if( gen_through_holes ) if( gen_through_holes )
layer2 = layer1 + 1; layer2 = layer1 + 1;
else else

View File

@ -116,7 +116,8 @@ OBJECTS= $(TARGET).o classpcb.o\
modedit.o\ modedit.o\
export_gencad.o\ export_gencad.o\
hotkeys.o \ hotkeys.o \
collectors.o collectors.o \
set_color.o