Write Eeschema "AR" references in legacy timestamp format.

Also fixes a bug with path separators not getting added to the
m_PathsAndReferences array.

Fixes https://gitlab.com/kicad/code/kicad/issues/3925
This commit is contained in:
Jeff Young 2020-02-21 23:18:43 +00:00
parent ea025a35e5
commit 83057a48e1
2 changed files with 12 additions and 2 deletions

View File

@ -2026,8 +2026,18 @@ void SCH_LEGACY_PLUGIN::saveComponent( SCH_COMPONENT* aComponent )
reference_fields = wxStringTokenize( aComponent->GetPathsAndReferences()[ii],
delimiters );
// Convert Alternate Reference paths back to legacy timestamps:
wxArrayString pathParts = wxSplit( reference_fields[0], '/' );
wxString path;
for( const wxString& pathPart : pathParts )
{
if( !pathPart.IsEmpty() )
path += "/" + KIID( pathPart ).AsLegacyTimestampString();
}
m_out->Print( 0, "AR Path=\"%s\" Ref=\"%s\" Part=\"%s\" \n",
TO_UTF8( reference_fields[0] ),
TO_UTF8( path ),
TO_UTF8( reference_fields[1] ),
TO_UTF8( reference_fields[2] ) );
}

View File

@ -125,7 +125,7 @@ wxString SCH_SHEET_PATH::Path() const
// Start at 1 to avoid the root sheet, which does not need to be added to the path.
// It's timestamp changes anyway.
for( unsigned i = 1; i < size(); i++ )
s += at( i )->m_Uuid.AsString();
s += at( i )->m_Uuid.AsString() + "/";
return s;
}