From acb024f622a7f04a2ed7c84e814d541b18d0229b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 29 May 2021 18:29:02 +0200 Subject: [PATCH] netlist exporter xml: fix missing space between UUIDs for multi-units symbols. (similar to the .net netlist) kicad_netlist_reader.py: fix compatibility with V6 xml netlist : "tstamp" keyword is now "tstamps" keyword. Fixes #8509 https://gitlab.com/kicad/code/kicad/issues/8509 --- eeschema/netlist_exporters/netlist_exporter_xml.cpp | 6 ++++-- .../plugins/python_scripts/kicad_netlist_reader.py | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/eeschema/netlist_exporters/netlist_exporter_xml.cpp b/eeschema/netlist_exporters/netlist_exporter_xml.cpp index 390f56dd21..ead83fcfbf 100644 --- a/eeschema/netlist_exporters/netlist_exporter_xml.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_xml.cpp @@ -347,8 +347,10 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl ) // Output a series of children with all UUIDs associated with the REFDES for( auto it = range.first; it != range.second; ++it ) - xunits->AddChild( - new XNODE( wxXML_TEXT_NODE, wxEmptyString, ( *it )->m_Uuid.AsString() ) ); + { + wxString uuid = ( *it )->m_Uuid.AsString() + " "; + xunits->AddChild( new XNODE( wxXML_TEXT_NODE, wxEmptyString, uuid ) ); + } // Output the primary UUID xunits->AddChild( diff --git a/eeschema/plugins/python_scripts/kicad_netlist_reader.py b/eeschema/plugins/python_scripts/kicad_netlist_reader.py index e9f83e13f4..9192814376 100644 --- a/eeschema/plugins/python_scripts/kicad_netlist_reader.py +++ b/eeschema/plugins/python_scripts/kicad_netlist_reader.py @@ -407,7 +407,15 @@ class comp(): return ret def getTimestamp(self): - return self.element.get("tstamp") + """ + Kicad 5 uses tstamp keyword for time stamp (8 digits) as UUID + Kicad 6 uses tstamps keyword for UUID and a multi unit symbol has more than one UUID + (UUIDs are separed by spaces) + """ + ret = self.element.get("tstamp") + if ret == "": + ret = self.element.get("tstamps") + return ret def getDescription(self): return self.element.get("libsource", "description")