CADSTAR Schematic Archive Importer: Handle undefined pin number in part

Use terminal pin number (i.e. from the symbol definition) when the pin
number is undefined in the part.
This fixes a bug that resulted in symbols with "0" as the pin numbers.
This commit is contained in:
Roberto Fernandez Bautista 2021-02-02 15:35:45 +00:00 committed by Wayne Stambaugh
parent cc27c31ab0
commit f530b12c31
2 changed files with 3 additions and 1 deletions

View File

@ -970,7 +970,7 @@ public:
BOTTOM_RIGHT = 3
};
PART_DEFINITION_PIN_ID ID;
PART_DEFINITION_PIN_ID ID = UNDEFINED_VALUE;
wxString Identifier = wxEmptyString; ///< This should match a pad identifier
///< in the component footprint

View File

@ -1095,6 +1095,8 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
{
if( !csPin.Identifier.IsEmpty() )
pinNum = csPin.Identifier;
else if( csPin.ID == UNDEFINED_VALUE )
pinNum = wxString::Format( "%ld", term.ID );
else
pinNum = wxString::Format( "%ld", csPin.ID );
}