=== modified file 'pcbnew/dialogs/dialog_gendrill.cpp' --- pcbnew/dialogs/dialog_gendrill.cpp 2014-01-26 14:20:58 +0000 +++ pcbnew/dialogs/dialog_gendrill.cpp 2014-03-01 00:06:23 +0000 @@ -47,6 +47,7 @@ #define PrecisionKey wxT( "DrilltPrecisionOpt" ) #define MirrorKey wxT( "DrillMirrorYOpt" ) #define MinimalHeaderKey wxT( "DrillMinHeader" ) +#define MergePTHNPTHKey wxT( "DrillMergePTHNPTH" ) #define UnitDrillInchKey wxT( "DrillUnit" ) #define DrillOriginIsAuxAxisKey wxT( "DrillAuxAxis" ) #define DrillMapFileTypeKey wxT( "DrillMapFileType" ) @@ -88,6 +89,7 @@ int DIALOG_GENDRILL::m_ZerosFormat = EXCELLON_WRITER::DECIMAL_FORMAT; bool DIALOG_GENDRILL::m_MinimalHeader = false; bool DIALOG_GENDRILL::m_Mirror = false; +bool DIALOG_GENDRILL::m_Merge_PTH_NPTH = false; bool DIALOG_GENDRILL::m_DrillOriginIsAuxAxis = false; int DIALOG_GENDRILL::m_mapFileType = 1; @@ -102,6 +104,7 @@ { m_config->Read( ZerosFormatKey, &m_ZerosFormat ); m_config->Read( MirrorKey, &m_Mirror ); + m_config->Read( MergePTHNPTHKey, &m_Merge_PTH_NPTH ); m_config->Read( MinimalHeaderKey, &m_MinimalHeader ); m_config->Read( UnitDrillInchKey, &m_UnitDrillIsInch ); m_config->Read( DrillOriginIsAuxAxisKey, &m_DrillOriginIsAuxAxis ); @@ -124,6 +127,7 @@ m_Choice_Drill_Offset->SetSelection( 1 ); m_Check_Mirror->SetValue( m_Mirror ); + m_Check_Merge_PTH_NPTH->SetValue( m_Merge_PTH_NPTH ); m_Choice_Drill_Map->SetSelection( m_mapFileType ); m_ViaDrillValue->SetLabel( _( "Use Netclasses values" ) ); m_MicroViaDrillValue->SetLabel( _( "Use Netclasses values" ) ); @@ -213,6 +217,7 @@ m_config->Write( ZerosFormatKey, m_ZerosFormat ); m_config->Write( MirrorKey, m_Mirror ); m_config->Write( MinimalHeaderKey, m_MinimalHeader ); + m_config->Write( MergePTHNPTHKey, m_Merge_PTH_NPTH ); m_config->Write( UnitDrillInchKey, m_UnitDrillIsInch ); m_config->Write( DrillOriginIsAuxAxisKey, m_DrillOriginIsAuxAxis ); m_config->Write( DrillMapFileTypeKey, m_mapFileType ); @@ -315,6 +320,7 @@ m_UnitDrillIsInch = (m_Choice_Unit->GetSelection() == 0) ? false : true; m_MinimalHeader = m_Check_Minimal->IsChecked(); m_Mirror = m_Check_Mirror->IsChecked(); + m_Merge_PTH_NPTH = m_Check_Merge_PTH_NPTH->IsChecked(); m_ZerosFormat = m_Choice_Zeros_Format->GetSelection(); m_DrillOriginIsAuxAxis = m_Choice_Drill_Offset->GetSelection(); @@ -369,14 +375,14 @@ 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.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH ); wxFileName fn; for( ; ; ) { excellonWriter.BuildHolesList( layer1, layer2, - gen_through_holes ? false : true, gen_NPTH_holes ); + gen_through_holes ? false : true, gen_NPTH_holes, m_Merge_PTH_NPTH ); if( excellonWriter.GetHolesCount() > 0 ) // has holes? { @@ -393,6 +399,7 @@ layer_extend << wxT( "-back" ); else layer_extend << wxT( "-inner" ) << layer1; + if( layer2 == LAYER_N_FRONT ) layer_extend << wxT( "-front" ); else @@ -512,7 +519,7 @@ 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.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH ); bool success = excellonWriter.GenDrillReportFile( dlg.GetPath() ); === modified file 'pcbnew/dialogs/dialog_gendrill.h' --- pcbnew/dialogs/dialog_gendrill.h 2012-10-05 19:04:17 +0000 +++ pcbnew/dialogs/dialog_gendrill.h 2014-03-01 00:13:12 +0000 @@ -41,6 +41,7 @@ static int m_ZerosFormat; static bool m_MinimalHeader; static bool m_Mirror; + static bool m_Merge_PTH_NPTH; static bool m_DrillOriginIsAuxAxis; /* Axis selection (main / auxiliary) * for drill origin coordinates */ DRILL_PRECISION m_Precision; // Selected precision for drill files @@ -69,9 +70,9 @@ // event functions void OnSelDrillUnitsSelected( wxCommandEvent& event ); void OnSelZerosFmtSelected( wxCommandEvent& event ); - void OnGenDrillFile( wxCommandEvent& event ); - void OnGenMapFile( wxCommandEvent& event ); - void OnGenReportFile( wxCommandEvent& event ); + void OnGenDrillFile( wxCommandEvent& event ); + void OnGenMapFile( wxCommandEvent& event ); + void OnGenReportFile( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ); === modified file 'pcbnew/dialogs/dialog_gendrill_base.cpp' --- pcbnew/dialogs/dialog_gendrill_base.cpp 2013-05-26 04:36:44 +0000 +++ pcbnew/dialogs/dialog_gendrill_base.cpp 2014-03-01 00:01:42 +0000 @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Feb 26 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -88,6 +88,9 @@ m_Check_Minimal = new wxCheckBox( this, wxID_ANY, _("Minimal header"), wxDefaultPosition, wxDefaultSize, 0 ); sbOptSizer->Add( m_Check_Minimal, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + m_Check_Merge_PTH_NPTH = new wxCheckBox( this, wxID_ANY, _("Merge PTH and NPTH holes into one file"), wxDefaultPosition, wxDefaultSize, 0 ); + sbOptSizer->Add( m_Check_Merge_PTH_NPTH, 0, wxALL, 5 ); + bMiddleBoxSizer->Add( sbOptSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); === modified file 'pcbnew/dialogs/dialog_gendrill_base.fbp' --- pcbnew/dialogs/dialog_gendrill_base.fbp 2013-05-26 04:36:44 +0000 +++ pcbnew/dialogs/dialog_gendrill_base.fbp 2014-03-01 00:02:45 +0000 @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -879,6 +881,94 @@ + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Merge PTH and NPTH holes into one file + + 0 + + + 0 + + 1 + m_Check_Merge_PTH_NPTH + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === modified file 'pcbnew/dialogs/dialog_gendrill_base.h' --- pcbnew/dialogs/dialog_gendrill_base.h 2013-05-26 04:36:44 +0000 +++ pcbnew/dialogs/dialog_gendrill_base.h 2014-03-01 00:01:42 +0000 @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Feb 26 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -48,6 +48,7 @@ wxRadioBox* m_Choice_Drill_Map; wxCheckBox* m_Check_Mirror; wxCheckBox* m_Check_Minimal; + wxCheckBox* m_Check_Merge_PTH_NPTH; wxRadioBox* m_Choice_Drill_Offset; wxStaticBoxSizer* m_DefaultViasDrillSizer; wxStaticText* m_ViaDrillValue; === modified file 'pcbnew/exporters/gendrill_Excellon_writer.cpp' --- pcbnew/exporters/gendrill_Excellon_writer.cpp 2014-01-26 14:20:58 +0000 +++ pcbnew/exporters/gendrill_Excellon_writer.cpp 2014-03-01 00:10:12 +0000 @@ -442,11 +442,13 @@ * param aGenerateNPTH_list : * true to create NPTH only list (with no plated holes) * false to created plated holes list (with no NPTH ) + * param aMergePTHNPTH : if true, merge PTH and NPTH holes into one file by treating all holes as PTH */ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer, int aLastLayer, bool aExcludeThroughHoles, - bool aGenerateNPTH_list ) + bool aGenerateNPTH_list, + bool aMergePTHNPTH ) { HOLE_INFO new_hole; int hole_value; @@ -460,6 +462,11 @@ EXCHG( aFirstLayer, aLastLayer ); } + if ( aGenerateNPTH_list && aMergePTHNPTH ) + { + return; + } + /* build hole list for vias */ if( ! aGenerateNPTH_list ) // vias are always plated ! @@ -507,7 +514,7 @@ // Read and analyse pads for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() ) { - if( ! aGenerateNPTH_list && pad->GetAttribute() == PAD_HOLE_NOT_PLATED ) + if( ! aGenerateNPTH_list && pad->GetAttribute() == PAD_HOLE_NOT_PLATED && ! aMergePTHNPTH ) continue; if( aGenerateNPTH_list && pad->GetAttribute() != PAD_HOLE_NOT_PLATED ) === modified file 'pcbnew/exporters/gendrill_Excellon_writer.h' --- pcbnew/exporters/gendrill_Excellon_writer.h 2014-01-07 20:41:32 +0000 +++ pcbnew/exporters/gendrill_Excellon_writer.h 2014-03-01 00:11:10 +0000 @@ -135,6 +135,7 @@ // (i.e inches or mm) bool m_mirror; wxPoint m_offset; // Drill offset ooordinates + bool m_mergePTHNPTH; std::vector m_holeListBuffer; // Buffer containing holes std::vector m_toolListBuffer; // Buffer containing tools @@ -146,6 +147,7 @@ m_conversionUnits = 0.0001; m_unitsDecimal = false; m_mirror = false; + m_mergePTHNPTH = false; m_minimalHeader = false; } @@ -177,11 +179,12 @@ * @param aMinimalHeader = true to use a minimal header (no comments, no info) * @param aOffset = drill coordinates offset */ - void SetOptions( bool aMirror, bool aMinimalHeader, wxPoint aOffset ) + void SetOptions( bool aMirror, bool aMinimalHeader, wxPoint aOffset, bool aMergePTHNPTH ) { m_mirror = aMirror; m_offset = aOffset; m_minimalHeader = aMinimalHeader; + m_mergePTHNPTH = aMergePTHNPTH; } /** @@ -199,7 +202,8 @@ */ void BuildHolesList( int aFirstLayer, int aLastLayer, bool aExcludeThroughHoles, - bool aGenerateNPTH_list ); + bool aGenerateNPTH_list, + bool aMergePTHNPTH ); int GetHolesCount() const { return m_holeListBuffer.size(); }