diff --git a/eeschema/sch_file_versions.h b/eeschema/sch_file_versions.h index 309504f020..d02d0959b3 100644 --- a/eeschema/sch_file_versions.h +++ b/eeschema/sch_file_versions.h @@ -59,4 +59,5 @@ //#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 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. diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp index 861e1e7f7e..0ced233cfc 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp @@ -2339,7 +2339,12 @@ SCH_COMPONENT* SCH_SEXPR_PARSER::parseSchematicSymbol() case T_uuid: 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(); break; diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index 36ea6ddc53..47ad8bda9a 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -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->Quotew( pin->GetNumber() ).c_str(), - TO_UTF8( aSymbol->m_Uuid.AsString() ) ); + TO_UTF8( pin->m_Uuid.AsString() ) ); } else { m_out->Print( aNestLevel + 1, "(pin %s (uuid %s) (alternate %s))\n", 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() ); } }