X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Message-ID: <5991DDFD.7070006@xs4all.nl> Date: Mon, 14 Aug 2017 19:29:33 +0200 From: "Bert Timmerman (bert DOT timmerman AT xs4all DOT nl) [via geda-user AT delorie DOT com]" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.19) Gecko/20110429 Fedora/2.0.14-1.fc13 SeaMonkey/2.0.14 MIME-Version: 1.0 To: geda-user AT delorie DOT com CC: gedau AT igor2 DOT repo DOT hu, "Peter C.J. Clifton" Subject: Re: [geda-user] [pcb] mainline: redundant attributes: bug or feature? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfJvrrqGZE01smk9If9CCwzA8769a4rwbv3MWGWY4V0ZtOF9ZWpEkBYM769VJ/rr5jTPpXjIzqiRwcYrSFm773HSj5EvN81ZiS/ltwBStIqA1HvAdgJZk yIKjrwOWxrGImcZu8ge7V8BVcyOtydFQiW9+ypGUyfzuQZeE7ZyVJIDFkDGAeQaDAcNYuiVe26sW4i7Cv35yhZzd+iJor+zxJsW5MTk4vIHoH6P3VJB6AkF8 oO6e1SmdtptcdTXEtXE112xQYjpwMn3zk6uys4j5rUM= Reply-To: geda-user AT delorie DOT com gedau AT igor2 DOT repo DOT hu wrote: > Hello Peter, > > On Mon, 14 Aug 2017, Peter Clifton (petercjclifton AT googlemail DOT com) > [via geda-user AT delorie DOT com] wrote: > >> Hi Igor2, >> I think I agree with you that allowing multiple attributes with the same >> name on a given object is a misfeature. >> >> I didn't have involvement in developing this code, but have a >> recollection >> that it came about around the time the new import code was written - >> possibly as a part of it. When importing from schematics, attributes on >> symbols get copied over to attributes on pcb footprints. > > Thank you, I have the same impression looking at the project history. > >> >> gnetlist allows (incorrectly imo), multiple attributes with the same >> name, >> and I wonder if that might be the origin of this behaviour in pcb? > > Same impression on this too. That means the only data path we need to > worry about is gnetlist->pcb. > > A quick grep shows pcb code looks at attribute values for 3 reasons: > > 1. to display them to the user (lesstif and gtk HIDs) - redundancy > doesn't matter > > 2. to decide settings on board or layer level - the code writes these > as unique, so the only way to get redundancy here is manual file > edit/generation in which case subsequent keys are silently ignored > > 3. to decide element behaviour - this is where it will start to matter > for us > > > I found only one example of 3.: bom.c: user specified override for > centroid/rotation ("xy-centre" and "xy-fixed-rotation"); the code uses > the first match, silently ignores the rest. > > (There's also a find.c hit "PCB::skip-drc", but that's a layer > attribute, not an element attribute, so it's probably in group 2. and > not imported from the netlist; for other group 2. gets, grep for "PCB::") > > So I think it would be a reasonable behaviour to switch to unique keys > and throw a warning when any input (including netlist import) has > redundant keys, as those would be silently ignored by the code otherwise. > > Regards, > > Igor2 > Hi Igor, Always nice to chime in after a day at the day-job and everything about the subject is already been said, anyway here goes my EUR 0.02 : IMO common sense dictates unique keys as to prevent bad things from happening ;-) Another issue pcb has, and also pcb-rnd might have, with the "Import Schematics" attribute is the lack of (re)loading the netlist derived from the schematic after loading the pcb layout file in a new session (after the "import::src0" and following sources have been set). Looking at the pcb code base, and confirmed by DJ, this import is run just once (immediately after selecting the file name and starting the import process). For me this looks like obsoleting the attribute from the very moment you close the file and/or pcb application. Maybe you have solved this issue already in pcb-rnd ? As an aside, it looks like other methods involving "make" may be possible too: "import::mode" is defaulted to "gentlist", other netlisting tools could be implemented here as well (xorn ?). Like to hear your opinion regarding this peculiar attribute and its use case. Kind regards, Bert Timmerman.