From f53e8971b41750a286b75d7bdc12b5dfdb26bbc2 Mon Sep 17 00:00:00 2001 From: Vladimir Ur Date: Wed, 8 Jun 2011 18:35:03 +0400 Subject: [PATCH] Annotation of multiparts gets CHINAME compared. This fixes bug when annotating components of same value (model) in several forms (e.g. dual opamp in single-body and dedicated representation). --- eeschema/component_references_lister.cpp | 3 +++ eeschema/netlist.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/eeschema/component_references_lister.cpp b/eeschema/component_references_lister.cpp index 619de2769a..0cb35c9307 100644 --- a/eeschema/component_references_lister.cpp +++ b/eeschema/component_references_lister.cpp @@ -438,6 +438,9 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId ) if( componentFlatList[jj].CompareValue( componentFlatList[ii] ) != 0 ) continue; + if( componentFlatList[jj].CompareLibName( componentFlatList[ii] ) != 0 ) + continue; + if( !componentFlatList[jj].m_IsNew ) continue; diff --git a/eeschema/netlist.h b/eeschema/netlist.h index 848086cd89..6c30323e3e 100644 --- a/eeschema/netlist.h +++ b/eeschema/netlist.h @@ -36,6 +36,7 @@ #include "class_libentry.h" #include "sch_sheet_path.h" +#include "sch_component.h" class SCH_COMPONENT; @@ -154,6 +155,11 @@ public: return m_Ref.compare( item.m_Ref ); } + int CompareLibName( const SCH_REFERENCE& item ) const + { + return m_RootCmp->GetLibName().CmpNoCase( item.m_RootCmp->GetLibName() ); + } + bool IsPartsLocked() { return m_Entry->UnitsLocked();