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:
parent
ea025a35e5
commit
83057a48e1
|
@ -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] ) );
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue