[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: multiple attributes (was: [Patches] GTK Recent-file-manager)

>How would the dialog establish the order? Would the order be significant 
>to some action? If so, there should be a way to manipulate order from 
>the GUI.

As far as I can see, the only way for a program to distinguish between two 
attributes with the same name, attached to the same symbol is by the order that 
they appear in the symbol's attribute list.  This is defined by the order in 
which they were attached to the symbol originally, or the order that they appear 
in the symbol file.

As far as I know, none of the use cases that people have mentioned assign any 
meaning to the order in which the symbols appear in the list.  It's possible for 
someone to write a script or netlister that does assign some meaning, but it 
doesn't seem like a good idea.  Better to give different names to the 
attributes, like slotdef-A slotdef-B, etc. and have the code search for any 
attribute names beginning with "slotdef-".

There _is_ a meaning to the order if a netlister expects only one attribute, but 
the symbol has several of the same name.  In that case, the netlister could find 
either the first attribute of that name or the last, depending on how the 
netlister was written.

About overloading:

Sometimes it's desirable to overload attributes;  for example I might want to 
simulate a circuit through a spice netlister, then generate a BOM of the parts 
in the simulation.  Having the BOM netlister use the same "value" attributes as 
the simulation helps prevent errors in keeping the two flows in sync.

To give the user the choice of overloading the symbols or not, each netlister 
could first look for a netlister-specific attribute, and if that doesn't exist 
then use a generic attribute.  i.e   first look for "spice-sdb-value", and if 
that doesn't exist then use the generic "value".

geda-user mailing list