From 853310da6e44f34a7bc4ab81581a7ad6ab8aba6e Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 10 Jan 2017 20:12:50 +0100 Subject: [PATCH] Remove duplicate definition of LAYER_PAIR, defined both in gendrill_Excellon_writer.h and specctra.h Now, in gendrill_Excellon_writer.h it is DRILL_LAYER_PAIR, and in specctra.h it is SPECCTRA_ LAYER_PAIR --- pcbnew/exporters/gen_drill_report_files.cpp | 11 ++++--- pcbnew/exporters/gendrill_Excellon_writer.cpp | 32 +++++++++---------- pcbnew/exporters/gendrill_Excellon_writer.h | 11 ++++--- pcbnew/specctra.cpp | 6 ++-- pcbnew/specctra.h | 12 +++---- 5 files changed, 37 insertions(+), 35 deletions(-) diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index 15131eb259..02c34e376c 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -297,7 +297,7 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName ) unsigned totalHoleCount; wxString brdFilename = m_pcb->GetFileName(); - std::vector hole_sets = getUniqueLayerPairs(); + std::vector hole_sets = getUniqueLayerPairs(); out.Print( 0, "Drill report for %s\n", TO_UTF8( brdFilename ) ); out.Print( 0, "Created on %s\n\n", TO_UTF8( DateAndTime() ) ); @@ -331,11 +331,11 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName ) // in this loop are plated only: for( unsigned pair_ndx = 0; pair_ndx < hole_sets.size(); ++pair_ndx ) { - LAYER_PAIR pair = hole_sets[pair_ndx]; + DRILL_LAYER_PAIR pair = hole_sets[pair_ndx]; BuildHolesList( pair, buildNPTHlist ); - if( pair == LAYER_PAIR( F_Cu, B_Cu ) ) + if( pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) { out.Print( 0, "Drill file '%s' contains\n", TO_UTF8( drillFileName( pair, false, m_merge_PTH_NPTH ) ) ); @@ -369,14 +369,15 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName ) if( !m_merge_PTH_NPTH ) buildNPTHlist = true; - BuildHolesList( LAYER_PAIR( F_Cu, B_Cu ), buildNPTHlist ); + BuildHolesList( DRILL_LAYER_PAIR( F_Cu, B_Cu ), buildNPTHlist ); // nothing wrong with an empty NPTH file in report. if( m_merge_PTH_NPTH ) 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, m_merge_PTH_NPTH ) ) ); + TO_UTF8( drillFileName( DRILL_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 dbcdb82cba..b1d44189c5 100644 --- a/pcbnew/exporters/gendrill_Excellon_writer.cpp +++ b/pcbnew/exporters/gendrill_Excellon_writer.cpp @@ -86,16 +86,16 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, wxFileName fn; wxString msg; - std::vector hole_sets = getUniqueLayerPairs(); + std::vector hole_sets = getUniqueLayerPairs(); // append a pair representing the NPTH set of holes, for separate drill files. if( !m_merge_PTH_NPTH ) - hole_sets.push_back( LAYER_PAIR( F_Cu, B_Cu ) ); + hole_sets.push_back( DRILL_LAYER_PAIR( F_Cu, B_Cu ) ); - for( std::vector::const_iterator it = hole_sets.begin(); + for( std::vector::const_iterator it = hole_sets.begin(); it != hole_sets.end(); ++it ) { - LAYER_PAIR pair = *it; + DRILL_LAYER_PAIR pair = *it; // For separate drill files, the last layer pair is the NPTH drill file. bool doing_npth = m_merge_PTH_NPTH ? false : ( it == hole_sets.end() - 1 ); @@ -554,7 +554,7 @@ static bool CmpHoleSettings( const HOLE_INFO& a, const HOLE_INFO& b ) } -void EXCELLON_WRITER::BuildHolesList( LAYER_PAIR aLayerPair, +void EXCELLON_WRITER::BuildHolesList( DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list ) { HOLE_INFO new_hole; @@ -596,7 +596,7 @@ void EXCELLON_WRITER::BuildHolesList( LAYER_PAIR aLayerPair, } } - if( aLayerPair == LAYER_PAIR( F_Cu, B_Cu ) ) + if( aLayerPair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) { // add holes for thru hole pads for( MODULE* module = m_pcb->m_Modules; module; module = module->Next() ) @@ -672,7 +672,7 @@ void EXCELLON_WRITER::BuildHolesList( LAYER_PAIR aLayerPair, } -std::vector EXCELLON_WRITER::getUniqueLayerPairs() const +std::vector EXCELLON_WRITER::getUniqueLayerPairs() const { wxASSERT( m_pcb ); @@ -685,9 +685,9 @@ std::vector EXCELLON_WRITER::getUniqueLayerPairs() const vias.Collect( m_pcb, interesting_stuff_to_collect ); - std::set< LAYER_PAIR > unique; + std::set< DRILL_LAYER_PAIR > unique; - LAYER_PAIR layer_pair; + DRILL_LAYER_PAIR layer_pair; for( int i = 0; i < vias.GetCount(); ++i ) { @@ -697,17 +697,17 @@ std::vector EXCELLON_WRITER::getUniqueLayerPairs() const // only make note of blind buried. // thru hole is placed unconditionally as first in fetched list. - if( layer_pair != LAYER_PAIR( F_Cu, B_Cu ) ) + if( layer_pair != DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) { unique.insert( layer_pair ); } } - std::vector ret; + std::vector ret; - ret.push_back( LAYER_PAIR( F_Cu, B_Cu ) ); // always first in returned list + ret.push_back( DRILL_LAYER_PAIR( F_Cu, B_Cu ) ); // always first in returned list - for( std::set< LAYER_PAIR >::const_iterator it = unique.begin(); it != unique.end(); ++it ) + for( std::set< DRILL_LAYER_PAIR >::const_iterator it = unique.begin(); it != unique.end(); ++it ) ret.push_back( *it ); return ret; @@ -729,7 +729,7 @@ const std::string EXCELLON_WRITER::layerName( LAYER_ID aLayer ) const } -const std::string EXCELLON_WRITER::layerPairName( LAYER_PAIR aPair ) const +const std::string EXCELLON_WRITER::layerPairName( DRILL_LAYER_PAIR aPair ) const { std::string ret = layerName( aPair.first ); ret += '-'; @@ -739,7 +739,7 @@ const std::string EXCELLON_WRITER::layerPairName( LAYER_PAIR aPair ) const } -const wxString EXCELLON_WRITER::drillFileName( LAYER_PAIR aPair, bool aNPTH, +const wxString EXCELLON_WRITER::drillFileName( DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH ) const { wxASSERT( m_pcb ); @@ -748,7 +748,7 @@ const wxString EXCELLON_WRITER::drillFileName( LAYER_PAIR aPair, bool aNPTH, if( aNPTH ) extend = "-NPTH"; - else if( aPair == LAYER_PAIR( F_Cu, B_Cu ) ) + else if( aPair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) { if( !aMerge_PTH_NPTH ) extend = "-PTH"; diff --git a/pcbnew/exporters/gendrill_Excellon_writer.h b/pcbnew/exporters/gendrill_Excellon_writer.h index 5296b23e45..872606ce31 100644 --- a/pcbnew/exporters/gendrill_Excellon_writer.h +++ b/pcbnew/exporters/gendrill_Excellon_writer.h @@ -115,7 +115,7 @@ public: DRILL_PRECISION( int l = 2, int r = 4 ) }; -typedef std::pair LAYER_PAIR; +typedef std::pair DRILL_LAYER_PAIR; class OUTPUTFORMATTER; /** @@ -228,7 +228,7 @@ public: * true to create NPTH only list (with no plated holes) * false to created plated holes list (with no NPTH ) */ - void BuildHolesList( LAYER_PAIR aLayerPair, + void BuildHolesList( DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list ); int GetHolesCount() const { return m_holeListBuffer.size(); } @@ -348,7 +348,7 @@ private: bool PlotDrillMarks( PLOTTER* aPlotter ); /// Get unique layer pairs by examining the micro and blind_buried vias. - std::vector getUniqueLayerPairs() const; + std::vector getUniqueLayerPairs() const; /** * Function printToolSummary @@ -358,7 +358,7 @@ private: */ unsigned printToolSummary( OUTPUTFORMATTER& aOut, bool aSummaryNPTH ) const; - const std::string layerPairName( LAYER_PAIR aPair ) const; + const std::string layerPairName( DRILL_LAYER_PAIR aPair ) const; const std::string layerName( LAYER_ID aLayer ) const; @@ -371,7 +371,8 @@ private: * @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; + const wxString drillFileName( DRILL_LAYER_PAIR aPair, bool aNPTH, + bool aMerge_PTH_NPTH ) const; }; #endif // #ifndef _GENDRILL_EXCELLON_WRITER_ diff --git a/pcbnew/specctra.cpp b/pcbnew/specctra.cpp index e9f60e6916..98d4f7d401 100644 --- a/pcbnew/specctra.cpp +++ b/pcbnew/specctra.cpp @@ -571,7 +571,7 @@ void SPECCTRA_DB::doUNIT( UNIT_RES* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doLAYER_PAIR( LAYER_PAIR* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doSPECCTRA_LAYER_PAIR( SPECCTRA_LAYER_PAIR* growth ) throw( IO_ERROR ) { NeedSYMBOL(); growth->layer_id0 = CurText(); @@ -600,9 +600,9 @@ void SPECCTRA_DB::doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) if( NextTok() != T_layer_pair ) Expecting( T_layer_pair ); - LAYER_PAIR* layer_pair = new LAYER_PAIR( growth ); + SPECCTRA_LAYER_PAIR* layer_pair = new SPECCTRA_LAYER_PAIR( growth ); growth->layer_pairs.push_back( layer_pair ); - doLAYER_PAIR( layer_pair ); + doSPECCTRA_LAYER_PAIR( layer_pair ); } } diff --git a/pcbnew/specctra.h b/pcbnew/specctra.h index f24c94b589..7280ae54ea 100644 --- a/pcbnew/specctra.h +++ b/pcbnew/specctra.h @@ -1260,7 +1260,7 @@ public: typedef boost::ptr_vector LAYERS; -class LAYER_PAIR : public ELEM +class SPECCTRA_LAYER_PAIR : public ELEM { friend class SPECCTRA_DB; @@ -1270,7 +1270,7 @@ class LAYER_PAIR : public ELEM double layer_weight; public: - LAYER_PAIR( ELEM* aParent ) : + SPECCTRA_LAYER_PAIR( ELEM* aParent ) : ELEM( T_layer_pair, aParent ) { layer_weight = 0.0; @@ -1287,14 +1287,14 @@ public: layer_weight ); } }; -typedef boost::ptr_vector LAYER_PAIRS; +typedef boost::ptr_vector SPECCTRA_LAYER_PAIRS; class LAYER_NOISE_WEIGHT : public ELEM { friend class SPECCTRA_DB; - LAYER_PAIRS layer_pairs; + SPECCTRA_LAYER_PAIRS layer_pairs; public: @@ -1307,7 +1307,7 @@ public: { out->Print( nestLevel, "(%s\n", Name() ); - for( LAYER_PAIRS::iterator i=layer_pairs.begin(); i!=layer_pairs.end(); ++i ) + for( SPECCTRA_LAYER_PAIRS::iterator i=layer_pairs.begin(); i!=layer_pairs.end(); ++i ) i->Format( out, nestLevel+1 ); out->Print( nestLevel, ")\n" ); @@ -3701,7 +3701,7 @@ class SPECCTRA_DB : public SPECCTRA_LEXER void doSTRUCTURE( STRUCTURE* growth ) throw( IO_ERROR, boost::bad_pointer ); void doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR, boost::bad_pointer ); void doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IO_ERROR, boost::bad_pointer ); - void doLAYER_PAIR( LAYER_PAIR* growth ) throw( IO_ERROR ); + void doSPECCTRA_LAYER_PAIR( SPECCTRA_LAYER_PAIR* growth ) throw( IO_ERROR ); void doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR, boost::bad_pointer ); void doRECTANGLE( RECTANGLE* growth ) throw( IO_ERROR ); void doPATH( PATH* growth ) throw( IO_ERROR );