Netlist: export fields in its own section

This commit is contained in:
Mike Williams 2023-05-09 21:31:18 -04:00
parent 8e13f2d535
commit 941d9c957d
1 changed files with 15 additions and 0 deletions

View File

@ -311,6 +311,21 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
xlibsource->AddAttribute( wxT( "description" ), symbol->GetDescription() );
/* Add the symbol fields. Yes, this is redudant with the "properties"
* exported below, but properties has accreted everything we want to send to
* the footprint over time so we can't tell what's really a field.
*/
XNODE* xfields = node( "fields" );
xcomp->AddChild( xfields );
for( const SCH_FIELD& field : symbol->GetFields() )
{
XNODE* xfield = node( wxT( "field" ), field.GetText() );
xfields->AddChild( xfield );
xfield->AddAttribute( wxT( "name" ), field.GetCanonicalName() );
}
/* Add the symbol properties. */
XNODE* xproperty;
std::vector<SCH_FIELD>& fields = symbol->GetFields();