From e6602b0c943c8579851111e7f4242bca6e17a7aa Mon Sep 17 00:00:00 2001 From: lifekidyeaa Date: Wed, 5 Mar 2008 04:51:48 +0000 Subject: [PATCH] fixed a logical bug in the creation of drill files. --- pcbnew/dialog_gendrill.cpp | 2 +- pcbnew/gendrill.cpp | 118 ++++++++++++++++++------------------- pcbnew/makefile.include | 3 +- 3 files changed, 62 insertions(+), 61 deletions(-) diff --git a/pcbnew/dialog_gendrill.cpp b/pcbnew/dialog_gendrill.cpp index 5fadb7122a..09601fc02a 100644 --- a/pcbnew/dialog_gendrill.cpp +++ b/pcbnew/dialog_gendrill.cpp @@ -73,7 +73,7 @@ WinEDA_DrillFrame::WinEDA_DrillFrame( WinEDA_PcbFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { m_Parent = parent; - SetFont( *g_DialogFont ); + //SetFont( *g_DialogFont ); SetReturnCode( 1 ); Init(); diff --git a/pcbnew/gendrill.cpp b/pcbnew/gendrill.cpp index 2936c89167..420339242e 100644 --- a/pcbnew/gendrill.cpp +++ b/pcbnew/gendrill.cpp @@ -286,65 +286,65 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event ) { 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; - 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 = EDA_FileSelector( _( "Drill file" ), - wxEmptyString, /* Chemin par defaut */ - FullFileName, /* nom fichier par defaut */ - Ext, /* extension par defaut */ - Mask, /* Masque d'affichage */ - this, - wxFD_SAVE, - TRUE - ); - - if( FullFileName != wxEmptyString ) - { - 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; - - case 1: - GenDrillMap( FullFileName, s_HoleListBuffer, s_ToolListBuffer, PLOT_FORMAT_HPGL ); - break; - - case 2: - GenDrillMap( FullFileName, s_HoleListBuffer, s_ToolListBuffer, PLOT_FORMAT_POST ); - break; - } - - if( !ExistsBuriedVias ) - break; + if( s_ToolListBuffer.size() > 0 ) //holes? + { + 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 = EDA_FileSelector( _( "Drill file" ), + wxEmptyString, /* Chemin par defaut */ + FullFileName, /* nom fichier par defaut */ + Ext, /* extension par defaut */ + Mask, /* Masque d'affichage */ + this, + wxFD_SAVE, + TRUE + ); + + if( FullFileName != wxEmptyString ) + { + 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; + + case 1: + GenDrillMap( FullFileName, s_HoleListBuffer, s_ToolListBuffer, PLOT_FORMAT_HPGL ); + break; + + case 2: + GenDrillMap( FullFileName, s_HoleListBuffer, s_ToolListBuffer, PLOT_FORMAT_POST ); + break; + } + + if( !ExistsBuriedVias ) + break; + } if( gen_through_holes ) layer2 = layer1 + 1; else diff --git a/pcbnew/makefile.include b/pcbnew/makefile.include index 14e9637efb..f3ad50831b 100644 --- a/pcbnew/makefile.include +++ b/pcbnew/makefile.include @@ -116,7 +116,8 @@ OBJECTS= $(TARGET).o classpcb.o\ modedit.o\ export_gencad.o\ hotkeys.o \ - collectors.o + collectors.o \ + set_color.o