Don't count pins of both De Morgan variants when matching to footprint pads.

(And remove un unused variable from grid settings dialog.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15550
This commit is contained in:
Jeff Young 2023-08-31 11:36:07 +01:00
parent 09288ecbe2
commit cb003d8ab4
3 changed files with 8 additions and 5 deletions

View File

@ -486,7 +486,11 @@ void DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector( LIB_ID const& aLibId )
LIB_FIELD* fp_field = symbol->GetFieldById( FOOTPRINT_FIELD );
wxString fp_name = fp_field ? fp_field->GetFullText() : wxString( "" );
symbol->GetPins( temp_pins );
// All units, but only a single De Morgan variant.
if( symbol->HasConversion() )
symbol->GetPins( temp_pins, 0, 1 );
else
symbol->GetPins( temp_pins );
m_fp_sel_ctrl->FilterByPinCount( temp_pins.size() );
m_fp_sel_ctrl->FilterByFootprintFilters( symbol->GetFPFilters(), true );

View File

@ -1006,7 +1006,7 @@ void LIB_SYMBOL::GetPins( LIB_PINS& aList, int aUnit, int aConvert ) const
* when m_convert == 0, the body item is common to shapes
*/
LIB_SYMBOL_SPTR parent = m_parent.lock();
LIB_SYMBOL_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] )
@ -1015,7 +1015,7 @@ void LIB_SYMBOL::GetPins( LIB_PINS& aList, int aUnit, int aConvert ) const
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
continue;
// Shape filtering:
// De Morgan variant filtering:
if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
continue;
@ -1470,6 +1470,7 @@ bool LIB_SYMBOL::HasConversion() const
return false;
}
int LIB_SYMBOL::GetMaxPinNumber() const
{
int maxPinNumber = 0;

View File

@ -32,8 +32,6 @@ struct GRID;
class DIALOG_GRID_SETTINGS : public DIALOG_GRID_SETTINGS_BASE
{
EDA_DRAW_FRAME* m_parent;
public:
DIALOG_GRID_SETTINGS( wxWindow* aParent, wxWindow* aEventSource, UNITS_PROVIDER* aProvider,
GRID& aGrid );