Fix copy/paste error.

This commit is contained in:
Jeff Young 2021-01-26 19:00:42 +00:00
parent f3047829e5
commit 06f85471a4
3 changed files with 10 additions and 4 deletions

View File

@ -59,4 +59,5 @@
//#define SEXPR_SCHEMATIC_FILE_VERSION 20200828 // Add footprint to symbol_instances. //#define SEXPR_SCHEMATIC_FILE_VERSION 20200828 // Add footprint to symbol_instances.
//#define SEXPR_SCHEMATIC_FILE_VERSION 20201015 // Add sheet instance properties. //#define SEXPR_SCHEMATIC_FILE_VERSION 20201015 // Add sheet instance properties.
//#define SEXPR_SCHEMATIC_FILE_VERSION 20210123 // Rename "unconnected" pintype to "no_connect". //#define SEXPR_SCHEMATIC_FILE_VERSION 20210123 // Rename "unconnected" pintype to "no_connect".
#define SEXPR_SCHEMATIC_FILE_VERSION 20210125 // R/W uuids for pins, labels, wires, etc. //#define SEXPR_SCHEMATIC_FILE_VERSION 20210125 // R/W uuids for pins, labels, wires, etc.
#define SEXPR_SCHEMATIC_FILE_VERSION 20210126 // Fix bug with writing pin uuids.

View File

@ -2339,7 +2339,12 @@ SCH_COMPONENT* SCH_SEXPR_PARSER::parseSchematicSymbol()
case T_uuid: case T_uuid:
NeedSYMBOL(); NeedSYMBOL();
uuid = KIID( FromUTF8() );
// First version to write out pin uuids accidentally wrote out the symbol's
// uuid for each pin, so ignore uuids coming from that version.
if( m_requiredVersion >= 20210126 )
uuid = KIID( FromUTF8() );
NeedRIGHT(); NeedRIGHT();
break; break;

View File

@ -970,13 +970,13 @@ void SCH_SEXPR_PLUGIN::saveSymbol( SCH_COMPONENT* aSymbol, SCH_SHEET_PATH* aShee
{ {
m_out->Print( aNestLevel + 1, "(pin %s (uuid %s))\n", m_out->Print( aNestLevel + 1, "(pin %s (uuid %s))\n",
m_out->Quotew( pin->GetNumber() ).c_str(), m_out->Quotew( pin->GetNumber() ).c_str(),
TO_UTF8( aSymbol->m_Uuid.AsString() ) ); TO_UTF8( pin->m_Uuid.AsString() ) );
} }
else else
{ {
m_out->Print( aNestLevel + 1, "(pin %s (uuid %s) (alternate %s))\n", m_out->Print( aNestLevel + 1, "(pin %s (uuid %s) (alternate %s))\n",
m_out->Quotew( pin->GetNumber() ).c_str(), m_out->Quotew( pin->GetNumber() ).c_str(),
TO_UTF8( aSymbol->m_Uuid.AsString() ), TO_UTF8( pin->m_Uuid.AsString() ),
m_out->Quotew( pin->GetAlt() ).c_str() ); m_out->Quotew( pin->GetAlt() ).c_str() );
} }
} }