Make LIB_PART::GetPins() return data for derived symbols

https://gitlab.com/kicad/code/kicad/-/issues/8212
This commit is contained in:
david-beinder 2021-05-06 00:31:47 +02:00 committed by Jeff Young
parent 49d02560e4
commit 063f26531c
2 changed files with 8 additions and 6 deletions

View File

@ -700,11 +700,15 @@ void LIB_PART::GetPins( LIB_PINS& aList, int aUnit, int aConvert ) const
* when m_unit == 0, the body item is common to units * when m_unit == 0, the body item is common to units
* when m_convert == 0, the body item is common to shapes * when m_convert == 0, the body item is common to shapes
*/ */
for( const LIB_ITEM& item : m_drawings[ LIB_PIN_T ] )
PART_SPTR parent = m_parent.lock();
const LIB_ITEMS_CONTAINER& drawItems = parent ? parent->m_drawings : m_drawings;
for( const LIB_ITEM& item : drawItems[LIB_PIN_T] )
{ {
// Unit filtering: // Unit filtering:
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) ) if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
continue; continue;
// Shape filtering: // Shape filtering:
if( aConvert && item.m_convert && ( item.m_convert != aConvert ) ) if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )

View File

@ -205,10 +205,8 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
if( !part ) if( !part )
return 0; return 0;
LIB_PINS pinList; LIB_PINS pinList;
std::unique_ptr<LIB_PART> flattenedPart = part->Flatten(); part->GetPins( pinList );
flattenedPart->GetPins( pinList );
// Sort pins by pin num, so 2 duplicate pins // Sort pins by pin num, so 2 duplicate pins
// (pins with the same number) will be consecutive in list // (pins with the same number) will be consecutive in list