CADSTAR Schematic Archive Importer: Symbol name is case insensitive

Fixes an issue on some designs that would not be able to find the
symbol definition referenced by the part due to different
capitalisation of the symbol name in the part definition and
the symbol definition.
This commit is contained in:
Roberto Fernandez Bautista 2021-02-02 15:38:46 +00:00 committed by Wayne Stambaugh
parent 914ae001b5
commit 4dc264175a
1 changed files with 5 additions and 1 deletions

View File

@ -1976,14 +1976,18 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadItemOntoKiCadSheet( LAYER_ID aCadstarSheetI
CADSTAR_SCH_ARCHIVE_LOADER::SYMDEF_ID CADSTAR_SCH_ARCHIVE_LOADER::getSymDefFromName( CADSTAR_SCH_ARCHIVE_LOADER::SYMDEF_ID CADSTAR_SCH_ARCHIVE_LOADER::getSymDefFromName(
const wxString& aSymdefName, const wxString& aSymDefAlternate ) const wxString& aSymdefName, const wxString& aSymDefAlternate )
{ {
// Do a case-insensitive comparison
for( std::pair<SYMDEF_ID, SYMDEF_SCM> symPair : Library.SymbolDefinitions ) for( std::pair<SYMDEF_ID, SYMDEF_SCM> symPair : Library.SymbolDefinitions )
{ {
SYMDEF_ID id = symPair.first; SYMDEF_ID id = symPair.first;
SYMDEF_SCM symdef = symPair.second; SYMDEF_SCM symdef = symPair.second;
if( symdef.ReferenceName == aSymdefName && symdef.Alternate == aSymDefAlternate ) if( symdef.ReferenceName.Lower() == aSymdefName.Lower()
&& symdef.Alternate.Lower() == aSymDefAlternate.Lower() )
{
return id; return id;
} }
}
return SYMDEF_ID(); return SYMDEF_ID();
} }