Symbol editor: fix missing footprint filter support for derived symbols.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6038
This commit is contained in:
Wayne Stambaugh 2020-10-30 09:28:54 -04:00
parent 9ed6cdd943
commit a5e628a552
3 changed files with 12 additions and 18 deletions

View File

@ -121,7 +121,7 @@ LIB_PART::LIB_PART( const LIB_PART& aPart, PART_LIB* aLibrary ) :
m_library = aLibrary;
m_name = aPart.m_name;
m_FootprintList = wxArrayString( aPart.m_FootprintList );
m_footprintFilters = wxArrayString( aPart.m_footprintFilters );
m_unitCount = aPart.m_unitCount;
m_unitsLocked = aPart.m_unitsLocked;
m_pinNameOffset = aPart.m_pinNameOffset;
@ -176,7 +176,7 @@ const LIB_PART& LIB_PART::operator=( const LIB_PART& aPart )
m_library = aPart.m_library;
m_name = aPart.m_name;
m_FootprintList = wxArrayString( aPart.m_FootprintList );
m_footprintFilters = wxArrayString( aPart.m_footprintFilters );
m_unitCount = aPart.m_unitCount;
m_unitsLocked = aPart.m_unitsLocked;
m_pinNameOffset = aPart.m_pinNameOffset;
@ -258,12 +258,12 @@ int LIB_PART::Compare( const LIB_PART& aRhs ) const
++rhsItem;
}
if( m_FootprintList.GetCount() != aRhs.m_FootprintList.GetCount() )
return m_FootprintList.GetCount() - aRhs.m_FootprintList.GetCount();
if( m_footprintFilters.GetCount() != aRhs.m_footprintFilters.GetCount() )
return m_footprintFilters.GetCount() - aRhs.m_footprintFilters.GetCount();
for( size_t i = 0; i < m_FootprintList.GetCount(); i++ )
for( size_t i = 0; i < m_footprintFilters.GetCount(); i++ )
{
retv = m_FootprintList[i].Cmp( aRhs.m_FootprintList[i] );
retv = m_footprintFilters[i].Cmp( aRhs.m_footprintFilters[i] );
if( retv )
return retv;
@ -384,6 +384,7 @@ std::unique_ptr< LIB_PART > LIB_PART::Flatten() const
retv->SetKeyWords( m_keyWords );
retv->SetDescription( m_description );
retv->SetFootprintFilters( m_footprintFilters );
}
else
{

View File

@ -116,7 +116,7 @@ class LIB_PART : public EDA_ITEM, public LIB_TREE_ITEM
LIBRENTRYOPTIONS m_options; ///< Special part features such as POWER or NORMAL.)
int m_unitCount; ///< Number of units (parts) per package.
LIB_ITEMS_CONTAINER m_drawings; ///< Drawing items of this part.
wxArrayString m_FootprintList; /**< List of suitable footprint names for the
wxArrayString m_footprintFilters; /**< List of suitable footprint names for the
part (wild card names accepted). */
PART_LIB* m_library; ///< Library the part belongs to if any.
wxString m_name; ///< Symbol name.
@ -196,10 +196,10 @@ public:
timestamp_t GetDateLastEdition() const { return m_dateLastEdition; }
wxArrayString GetFootprints() const { return m_FootprintList; }
wxArrayString GetFootprints() const { return m_footprintFilters; }
void SetFootprintFilters( const wxArrayString& aFootprintFilters )
{
m_FootprintList = aFootprintFilters;
m_footprintFilters = aFootprintFilters;
}
void ViewGetLayers( int aLayers[], int& aCount ) const override;

View File

@ -757,14 +757,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnSizeGrid( wxSizeEvent& event )
void DIALOG_LIB_SYMBOL_PROPERTIES::syncControlStates( bool aIsAlias )
{
// Remove the not wanted notebook page.
// *Do not use* Hide(), it is suitable to hide a widget,
// but it is not suitable to hide a notebook page (that is not a widget)
if( aIsAlias )
m_NoteBook->RemovePage( 1 );
bSizerLowerBasicPanel->Show( !aIsAlias );
// bButtonSize->Show( !aIsAlias );
#ifdef KICAD_SPICE
m_spiceFieldsButton->Show( !aIsAlias );