From 84cfef1de9fa43b9e56248e566dc29fd6a1f84a0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 1 Aug 2016 16:29:15 +0200 Subject: [PATCH] Minor change for drill files names: when separate PTH and NPTH drill files are generated, PTH drill file has its name finishing by "-PTH" (similar to the NPTH drill file name) --- pcbnew/exporters/gen_drill_report_files.cpp | 6 +++--- pcbnew/exporters/gendrill_Excellon_writer.cpp | 8 +++++--- pcbnew/exporters/gendrill_Excellon_writer.h | 11 ++++++++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index 85562a22da..79882a4d86 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -338,7 +338,7 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName ) if( pair == LAYER_PAIR( F_Cu, B_Cu ) ) { out.Print( 0, "Drill file '%s' contains\n", - TO_UTF8( drillFileName( pair, false ) ) ); + TO_UTF8( drillFileName( pair, false, m_merge_PTH_NPTH ) ) ); out.Print( 0, " plated through holes:\n" ); out.Print( 0, separator ); @@ -348,7 +348,7 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName ) else // blind/buried { out.Print( 0, "Drill file '%s' contains\n", - TO_UTF8( drillFileName( pair, false ) ) ); + TO_UTF8( drillFileName( pair, false, m_merge_PTH_NPTH ) ) ); out.Print( 0, " holes connecting layer pair: '%s and %s' (%s vias):\n", TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.first ) ) ), @@ -376,7 +376,7 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName ) out.Print( 0, "Not plated through holes are merged with plated holes\n" ); else out.Print( 0, "Drill file '%s' contains\n", - TO_UTF8( drillFileName( LAYER_PAIR( F_Cu, B_Cu ), true ) ) ); + TO_UTF8( drillFileName( LAYER_PAIR( F_Cu, B_Cu ), true, m_merge_PTH_NPTH ) ) ); out.Print( 0, " unplated through holes:\n" ); out.Print( 0, separator ); diff --git a/pcbnew/exporters/gendrill_Excellon_writer.cpp b/pcbnew/exporters/gendrill_Excellon_writer.cpp index af2747ffe8..8638d1a21b 100644 --- a/pcbnew/exporters/gendrill_Excellon_writer.cpp +++ b/pcbnew/exporters/gendrill_Excellon_writer.cpp @@ -105,7 +105,7 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, // to be sure the NPTH file is up to date in separate files mode. if( GetHolesCount() > 0 || doing_npth ) { - fn = drillFileName( pair, doing_npth ); + fn = drillFileName( pair, doing_npth, m_merge_PTH_NPTH ); fn.SetPath( aPlotDirectory ); if( aGenDrill ) @@ -754,7 +754,7 @@ const std::string EXCELLON_WRITER::layerPairName( LAYER_PAIR aPair ) const } -const wxString EXCELLON_WRITER::drillFileName( LAYER_PAIR aPair, bool aNPTH ) const +const wxString EXCELLON_WRITER::drillFileName( LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH ) const { wxASSERT( m_pcb ); @@ -764,7 +764,9 @@ const wxString EXCELLON_WRITER::drillFileName( LAYER_PAIR aPair, bool aNPTH ) co extend = "-NPTH"; else if( aPair == LAYER_PAIR( F_Cu, B_Cu ) ) { - // extend with nothing + if( !aMerge_PTH_NPTH ) + extend = "-PTH"; + // if merged, extend with nothing } else { diff --git a/pcbnew/exporters/gendrill_Excellon_writer.h b/pcbnew/exporters/gendrill_Excellon_writer.h index 9a4d9c1f9b..5296b23e45 100644 --- a/pcbnew/exporters/gendrill_Excellon_writer.h +++ b/pcbnew/exporters/gendrill_Excellon_writer.h @@ -362,7 +362,16 @@ private: const std::string layerName( LAYER_ID aLayer ) const; - const wxString drillFileName( LAYER_PAIR aPair, bool aNPTH ) const; + /** + * @return a filename which identify the drill file function. + * it is the board name with the layer pair names added, and for separate + * (PTH and NPTH) files, "-NPH" or "-NPTH" added + * @param aPair = the layer pair + * @param aNPTH = true to generate the filename of NPTH holes + * @param aMerge_PTH_NPTH = true to generate the filename of a file which containd both + * NPH and NPTH holes + */ + const wxString drillFileName( LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH ) const; }; #endif // #ifndef _GENDRILL_EXCELLON_WRITER_