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:
+14
-5
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user