← Back to team overview

kicad-developers team mailing list archive

Component fields use case

 

>From the bzr log message is appears that fields not in the template list
will be deleted on exit from the component edit dialog. Or read
differently Fields with a null value and not listed in the template list
will be deleted (which seems to be the behavior when I play with it...)


I store quite a bit of component meta-data here in the fields which
either gets dumped to the BOM for automatic purchase order generation,
or get's manipulated via python scripts accessing the raw eeschema
files. 



Presently the file format uniquely identifies each field with an id
integer. So empty values for field name and field value are technically
not a problem. At least this was my assumption and it seems a reasonable
conclusion for anyone writing scripts against the .sch file.

I happen to use the field name as a key for some things and so they are
unique, and non-null in my case. However there are lots of good reasons
to stick a null in the field value and automatically stripping fields
with a null value string would be undesired. 

I just noticed that if one of my field names is in the template it get's
shuffled in the order. Also template fields get inserted before existing
fields, and this order is being propogated to the field ID in the
file... This will break things external to eeschema. I don't mind if
they get displayed in a different order on screen but changing the ID in
the file is very bad so the source of that should be tracked down and
fixed.

Regarding the fields template: In my opinion this should only be used
inside the library component editor. Once a component is in the library;
the component is *itself* a template for adding information to the
schematic.  I don't think we want to be 'automatically' modifing the
components, making assumptions about the library creators intentions.  

I hope this is useful.

-hauptmech








Follow ups

References