From e0c881b63923d62ee95e947501fd6bb30d951644 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 5 Jun 2018 21:01:14 +0100 Subject: [PATCH] Output descriptions to components in generic netlist. Also hooks up the Python netlist reader to the descriptions so that they appear correctly in BOMs. (The BOM generators used to always get the root component's description rather than the alias's description.) Fixes: lp:1774358 * https://bugs.launchpad.net/kicad/+bug/1774358 --- eeschema/netlist_exporters/netlist_exporter_generic.cpp | 2 ++ eeschema/plugins/python_scripts/kicad_netlist_reader.py | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/eeschema/netlist_exporters/netlist_exporter_generic.cpp b/eeschema/netlist_exporters/netlist_exporter_generic.cpp index 0043d183f9..faac2bbfc6 100644 --- a/eeschema/netlist_exporters/netlist_exporter_generic.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_generic.cpp @@ -246,6 +246,8 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeComponents() // We only want the symbol name, not the full LIB_ID. xlibsource->AddAttribute( "part", comp->GetLibId().GetLibItemName() ); + xlibsource->AddAttribute( "description", comp->GetAliasDescription() ); + XNODE* xsheetpath; xcomp->AddChild( xsheetpath = node( "sheetpath" ) ); diff --git a/eeschema/plugins/python_scripts/kicad_netlist_reader.py b/eeschema/plugins/python_scripts/kicad_netlist_reader.py index be6c7791fc..fbf498469d 100644 --- a/eeschema/plugins/python_scripts/kicad_netlist_reader.py +++ b/eeschema/plugins/python_scripts/kicad_netlist_reader.py @@ -408,10 +408,7 @@ class comp(): return self.element.get("tstamp") def getDescription(self): - if not self.libpart: - return "" - - return self.libpart.getDescription() + return self.element.get("libsource", "description") class netlist():