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
This commit is contained in:
jean-pierre charras 2017-01-10 20:12:50 +01:00
parent 3448698849
commit 853310da6e
5 changed files with 37 additions and 35 deletions

View File

@ -297,7 +297,7 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName )
unsigned totalHoleCount; unsigned totalHoleCount;
wxString brdFilename = m_pcb->GetFileName(); wxString brdFilename = m_pcb->GetFileName();
std::vector<LAYER_PAIR> hole_sets = getUniqueLayerPairs(); std::vector<DRILL_LAYER_PAIR> hole_sets = getUniqueLayerPairs();
out.Print( 0, "Drill report for %s\n", TO_UTF8( brdFilename ) ); out.Print( 0, "Drill report for %s\n", TO_UTF8( brdFilename ) );
out.Print( 0, "Created on %s\n\n", TO_UTF8( DateAndTime() ) ); 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: // in this loop are plated only:
for( unsigned pair_ndx = 0; pair_ndx < hole_sets.size(); ++pair_ndx ) 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 ); 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", out.Print( 0, "Drill file '%s' contains\n",
TO_UTF8( drillFileName( pair, false, m_merge_PTH_NPTH ) ) ); 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 ) if( !m_merge_PTH_NPTH )
buildNPTHlist = true; 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. // nothing wrong with an empty NPTH file in report.
if( m_merge_PTH_NPTH ) if( m_merge_PTH_NPTH )
out.Print( 0, "Not plated through holes are merged with plated holes\n" ); out.Print( 0, "Not plated through holes are merged with plated holes\n" );
else else
out.Print( 0, "Drill file '%s' contains\n", 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, " unplated through holes:\n" );
out.Print( 0, separator ); out.Print( 0, separator );

View File

@ -86,16 +86,16 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory,
wxFileName fn; wxFileName fn;
wxString msg; wxString msg;
std::vector<LAYER_PAIR> hole_sets = getUniqueLayerPairs(); std::vector<DRILL_LAYER_PAIR> hole_sets = getUniqueLayerPairs();
// append a pair representing the NPTH set of holes, for separate drill files. // append a pair representing the NPTH set of holes, for separate drill files.
if( !m_merge_PTH_NPTH ) 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<LAYER_PAIR>::const_iterator it = hole_sets.begin(); for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin();
it != hole_sets.end(); ++it ) 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. // 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 ); 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 ) bool aGenerateNPTH_list )
{ {
HOLE_INFO new_hole; 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 // add holes for thru hole pads
for( MODULE* module = m_pcb->m_Modules; module; module = module->Next() ) for( MODULE* module = m_pcb->m_Modules; module; module = module->Next() )
@ -672,7 +672,7 @@ void EXCELLON_WRITER::BuildHolesList( LAYER_PAIR aLayerPair,
} }
std::vector<LAYER_PAIR> EXCELLON_WRITER::getUniqueLayerPairs() const std::vector<DRILL_LAYER_PAIR> EXCELLON_WRITER::getUniqueLayerPairs() const
{ {
wxASSERT( m_pcb ); wxASSERT( m_pcb );
@ -685,9 +685,9 @@ std::vector<LAYER_PAIR> EXCELLON_WRITER::getUniqueLayerPairs() const
vias.Collect( m_pcb, interesting_stuff_to_collect ); 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 ) for( int i = 0; i < vias.GetCount(); ++i )
{ {
@ -697,17 +697,17 @@ std::vector<LAYER_PAIR> EXCELLON_WRITER::getUniqueLayerPairs() const
// only make note of blind buried. // only make note of blind buried.
// thru hole is placed unconditionally as first in fetched list. // 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 ); unique.insert( layer_pair );
} }
} }
std::vector<LAYER_PAIR> ret; std::vector<DRILL_LAYER_PAIR> 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 ); ret.push_back( *it );
return ret; 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 ); std::string ret = layerName( aPair.first );
ret += '-'; 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 bool aMerge_PTH_NPTH ) const
{ {
wxASSERT( m_pcb ); wxASSERT( m_pcb );
@ -748,7 +748,7 @@ const wxString EXCELLON_WRITER::drillFileName( LAYER_PAIR aPair, bool aNPTH,
if( aNPTH ) if( aNPTH )
extend = "-NPTH"; 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 ) if( !aMerge_PTH_NPTH )
extend = "-PTH"; extend = "-PTH";

View File

@ -115,7 +115,7 @@ public: DRILL_PRECISION( int l = 2, int r = 4 )
}; };
typedef std::pair<LAYER_ID, LAYER_ID> LAYER_PAIR; typedef std::pair<LAYER_ID, LAYER_ID> DRILL_LAYER_PAIR;
class OUTPUTFORMATTER; class OUTPUTFORMATTER;
/** /**
@ -228,7 +228,7 @@ public:
* true to create NPTH only list (with no plated holes) * true to create NPTH only list (with no plated holes)
* false to created plated holes list (with no NPTH ) * false to created plated holes list (with no NPTH )
*/ */
void BuildHolesList( LAYER_PAIR aLayerPair, void BuildHolesList( DRILL_LAYER_PAIR aLayerPair,
bool aGenerateNPTH_list ); bool aGenerateNPTH_list );
int GetHolesCount() const { return m_holeListBuffer.size(); } int GetHolesCount() const { return m_holeListBuffer.size(); }
@ -348,7 +348,7 @@ private:
bool PlotDrillMarks( PLOTTER* aPlotter ); bool PlotDrillMarks( PLOTTER* aPlotter );
/// Get unique layer pairs by examining the micro and blind_buried vias. /// Get unique layer pairs by examining the micro and blind_buried vias.
std::vector<LAYER_PAIR> getUniqueLayerPairs() const; std::vector<DRILL_LAYER_PAIR> getUniqueLayerPairs() const;
/** /**
* Function printToolSummary * Function printToolSummary
@ -358,7 +358,7 @@ private:
*/ */
unsigned printToolSummary( OUTPUTFORMATTER& aOut, bool aSummaryNPTH ) const; 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; 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 * @param aMerge_PTH_NPTH = true to generate the filename of a file which containd both
* NPH and NPTH holes * 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_ #endif // #ifndef _GENDRILL_EXCELLON_WRITER_

View File

@ -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(); NeedSYMBOL();
growth->layer_id0 = CurText(); growth->layer_id0 = CurText();
@ -600,9 +600,9 @@ void SPECCTRA_DB::doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth )
if( NextTok() != T_layer_pair ) if( NextTok() != T_layer_pair )
Expecting( 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 ); growth->layer_pairs.push_back( layer_pair );
doLAYER_PAIR( layer_pair ); doSPECCTRA_LAYER_PAIR( layer_pair );
} }
} }

View File

@ -1260,7 +1260,7 @@ public:
typedef boost::ptr_vector<LAYER> LAYERS; typedef boost::ptr_vector<LAYER> LAYERS;
class LAYER_PAIR : public ELEM class SPECCTRA_LAYER_PAIR : public ELEM
{ {
friend class SPECCTRA_DB; friend class SPECCTRA_DB;
@ -1270,7 +1270,7 @@ class LAYER_PAIR : public ELEM
double layer_weight; double layer_weight;
public: public:
LAYER_PAIR( ELEM* aParent ) : SPECCTRA_LAYER_PAIR( ELEM* aParent ) :
ELEM( T_layer_pair, aParent ) ELEM( T_layer_pair, aParent )
{ {
layer_weight = 0.0; layer_weight = 0.0;
@ -1287,14 +1287,14 @@ public:
layer_weight ); layer_weight );
} }
}; };
typedef boost::ptr_vector<LAYER_PAIR> LAYER_PAIRS; typedef boost::ptr_vector<SPECCTRA_LAYER_PAIR> SPECCTRA_LAYER_PAIRS;
class LAYER_NOISE_WEIGHT : public ELEM class LAYER_NOISE_WEIGHT : public ELEM
{ {
friend class SPECCTRA_DB; friend class SPECCTRA_DB;
LAYER_PAIRS layer_pairs; SPECCTRA_LAYER_PAIRS layer_pairs;
public: public:
@ -1307,7 +1307,7 @@ public:
{ {
out->Print( nestLevel, "(%s\n", Name() ); 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 ); i->Format( out, nestLevel+1 );
out->Print( nestLevel, ")\n" ); 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( STRUCTURE* growth ) throw( IO_ERROR, boost::bad_pointer );
void doSTRUCTURE_OUT( STRUCTURE_OUT* 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_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 doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR, boost::bad_pointer );
void doRECTANGLE( RECTANGLE* growth ) throw( IO_ERROR ); void doRECTANGLE( RECTANGLE* growth ) throw( IO_ERROR );
void doPATH( PATH* growth ) throw( IO_ERROR ); void doPATH( PATH* growth ) throw( IO_ERROR );