From 6d19312f51fdc55cec4fedb2950d1e2341e5fd4a Mon Sep 17 00:00:00 2001 From: Vladimir Ur Date: Thu, 20 Oct 2011 15:28:37 +0400 Subject: [PATCH] Automatic footprint assignment now can be done without equ file, if conditions are met: * symbol in sch library have only single footprint filter, * footprint filter have no wildcards, * according footprint exists in pcb lib. This could remove need in long equ files for lots of ICs. --- cvpcb/autosel.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cvpcb/autosel.cpp b/cvpcb/autosel.cpp index d9ebe1148f..12f1cb8e26 100644 --- a/cvpcb/autosel.cpp +++ b/cvpcb/autosel.cpp @@ -128,6 +128,7 @@ found in the default search paths." ), BOOST_FOREACH( COMPONENT& component, m_components ) { + bool found = false; m_ListCmp->SetSelection( ii++, true ); if( !component.m_Module.IsEmpty() ) @@ -135,7 +136,6 @@ found in the default search paths." ), BOOST_FOREACH( FOOTPRINT_ALIAS& alias, aliases ) { - bool found = false; if( alias.m_Name.CmpNoCase( component.m_Value ) != 0 ) continue; @@ -170,5 +170,14 @@ any of the project footprint libraries." ), } } + /* obviously the last chance: there's only one filter matching one footprint */ + if( !found && 1 == component.m_FootprintFilter.GetCount() ) { + /* we do not need to analyse wildcards: single footprint do not contain them */ + /* and if there are wildcards it just will not match any */ + FOOTPRINT_INFO *module = m_footprints.GetModuleInfo( component.m_FootprintFilter[0] ); + if( module ) { + SetNewPkg( component.m_FootprintFilter[0] ); + } + } } }