Eeschema: multi part with empty value (~) generates incorrect netlist

Fixes: lp:1734453
https://bugs.launchpad.net/kicad/+bug/1734453
This commit is contained in:
jean-pierre charras 2017-11-26 10:51:14 +01:00
parent a01d81e4b4
commit 6e728739bb
1 changed files with 6 additions and 2 deletions

View File

@ -118,7 +118,7 @@ void NETLIST_EXPORTER_GENERIC::addComponentFields( XNODE* xcomp, SCH_COMPONENT*
continue;
// The last guy wins. User should only set fields in any one unit.
// remark: IsVoid() returns true for empty strings or the "~" string (empty field value)
if( !comp2->GetField( VALUE )->IsVoid() )
fields.value = comp2->GetField( VALUE )->GetText();
@ -140,7 +140,11 @@ void NETLIST_EXPORTER_GENERIC::addComponentFields( XNODE* xcomp, SCH_COMPONENT*
}
}
xcomp->AddChild( node( "value", fields.value ) );
// Do not output field values blank in netlist:
if( fields.value.size() )
xcomp->AddChild( node( "value", fields.value ) );
else // value field always written in netlist
xcomp->AddChild( node( "value", "~" ) );
if( fields.footprint.size() )
xcomp->AddChild( node( "footprint", fields.footprint ) );