Cvpcb: Fix incorrect unique pad count for footprints using mixed letters/digits in pad name (like AA12, AB12 or Anod for instance.) and skip pads with no pad name.

This commit is contained in:
jean-pierre charras
2015-11-13 12:32:42 +01:00
parent 8f79b4fb11
commit a356293fee
3 changed files with 36 additions and 5 deletions
+14 -5
View File
@@ -719,25 +719,34 @@ unsigned MODULE::GetPadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
{
std::set<int> usedNumbers;
std::set<wxUint32> usedNames;
// Create a set of used pad numbers
for( D_PAD* pad = Pads(); pad; pad = pad->Next() )
{
// Skip pads not on copper layers (used to build complex
// solder paste shapes for instance)
if( ( pad->GetLayerSet() & LSET::AllCuMask() ).none() )
continue;
// Skip pads with no name, because they are usually "mechanical"
// pads, not "electrical" pads
if( pad->GetPadName().IsEmpty() )
continue;
if( !aIncludeNPTH )
{
//remove NPTH
// skip NPTH
if( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED )
{
continue;
}
}
int padNumber = getTrailingInt( pad->GetPadName() );
usedNumbers.insert( padNumber );
usedNames.insert( pad->GetPackedPadName() );
}
return usedNumbers.size();
return usedNames.size();
}