Re: gEDA-user: pcb: experience with import-schematics
kai-martin knaak wrote: Look at make_footprint_hash() in src/buffer.c Maybe we need to read the menus in reverse order? ^ paths? I'd say, the last path should receive highest priority. This is how the PATH environment variable of the shell is parsed. you mean the first directory has highest priority, same in linker paths ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
Armin Faltl wrote: you mean the first directory has highest priority, same in linker paths Ouups, your are right. ---)kaimartin(--- -- Kai-Martin Knaak tel: +49-511-762-2895 Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211 Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de GPG key:http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmkop=get ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
DJ Delorie wrote: For PCB, you'd edit $HOME/.pcb/settings to say something like: lib-newlib = ../imported- symbols/:../gedasymbols.org_salewski_symbols/:../custom-symbols/ For the GTK GUI this is overwritten by $HOME/.pcb/preferences IMHO, the settings/preferences confusion needs to be sorted. lib-contents-command = /bin/true What is this command supposed to do? ---)kaimartin(--- -- Kai-Martin Knaak tel: +49-511-762-2895 Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211 Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de GPG key:http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmkop=get ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
lib-contents-command = /bin/true What is this command supposed to do? The default is the command to provide the M4 library contents. Without the contents list, there is no M4 library. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
On Sun, 2010-08-15 at 00:35 -0400, DJ Delorie wrote: More generally: What config files does import schematics look at? Importing uses pcb's internal paths, not gafrc. Gnetlist simply passes the list of elements to pcb and lets pcb load them. You can point pcb's m4 library at a non-existing directory, I suppose. Look at make_footprint_hash() in src/buffer.c Maybe we need to read the menus in reverse order? I'm not sure we ever had a rule about what the priorities were if two libraries had the same element, as from within pcb you always specified the library too. I always have my own symbols and footprints, some with the same name as files shipped with gEDA/PCB. And I think a few of John Luciani's footprints have the same name as files shipped with PCB. For me these configuration files solved this problem (for gsch2pcb), giving John's files higher priority than PCB's own files, and my local files even higher priority: ste...@amd64x2 ~ $ cat /mnt/data/stefan/gEDA/DAD/gafrc (debug-options (list 'stack 20)) (component-library ../imported-symbols/) (component-library ../gedasymbols.org_salewski_symbols/) (component-library ../custom-symbols/) ;(component-library local-symbols/) ste...@amd64x2 ~ $ cat /mnt/data/stefan/gEDA/DAD/p1 schematics FPGA_Power.sch FPGA_B0B1.sch FPGA_B2B3.sch RAM.sch ADC.sch TDC.sch Digital_In_A.sch Digital_In_B.sch Digital_In_C.sch InputDividerCh1.sch InputDividerCh2.sch AmplifierCh1.sch AmplifierCh2.sch Controller.sch PowerManager.sch DC_DC_Converter.sch Lin_Regulators.sch Misc.sch AmpCommon.sch output-name b1 skip-m4 elements-dir /usr/local/share/pcb-symbols-jcl_2008-4-25 elements-dir ../imported-footprints elements-dir ../gedasymbols.org_salewski_footprints elements-dir ../custom-footprints #elements-dir local-footprints ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
For PCB, you'd edit $HOME/.pcb/settings to say something like: lib-newlib = ../imported-symbols/:../gedasymbols.org_salewski_symbols/:../custom-symbols/ lib-contents-command = /bin/true ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
DJ Delorie wrote: More generally: What config files does import schematics look at? Importing uses pcb's internal paths, not gafrc. This adds to the confusion. Both methods to transfer the the schematic information to pcb should come up with the same set of footprints with no subtleties in different config files involved. I see nasty errors creeping up, even for experienced users. From a user point of view I don't care which of the two applications is the master of the footprint path. But there definitely should be just one unique config for gnetlist and pcb import. If the pcb internal path variable is the way to go, it should be possible to set it differently for different projects. Maybe as a global attribute attached to the pcb? If pcb is the master of the footprint paths gnetlist should read the pcb setting. That is, first read the library-path attribute from the target layout, then the setting in $HOME/pcb/preferences, then the project file and only then fall back to whatever the gafrc says. BTW, it would be nice to if the similar issue of default settings of a newly created layout file would also be resolved. You can point pcb's m4 library at a non-existing directory, I suppose. Unfortunately, if the m4 library can't be disabled, or at least be considered as lowest priority, the import feature is no much use for me. I'd suggest a m4 enable switch in the library Look at make_footprint_hash() in src/buffer.c Maybe we need to read the menus in reverse order? ^ paths? I'd say, the last path should receive highest priority. This is how the PATH environment variable of the shell is parsed. ---)kaimartin(--- -- Kai-Martin Knaak Öffentlicher PGP-Schlüssel: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x6C0B9F53 ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
More generally: What config files does import schematics look at? Importing uses pcb's internal paths, not gafrc. This adds to the confusion. No, this is the same confusion that's always existed, which is why we wanted to get rid of gsch2pcb and *only* use pcb's list. We've always had the problem of gsch2pcb and pcb's library not having the same list of parts, or not searching the same locations, etc. From a user point of view I don't care which of the two applications is the master of the footprint path. But there definitely should be just one unique config for gnetlist and pcb import. It's not gnetlist, it's gsch2pcb. gnetlist knows *nothing* of pcb's libraries. gsch2pcb knows way too much about pcb's internals. If the pcb internal path variable is the way to go, it should be possible to set it differently for different projects. It can go in a local pcb.settings file. I don't think the *.pcb should have it, because the location is machine-dependent, not board-dependent. You can point pcb's m4 library at a non-existing directory, I suppose. Unfortunately, if the m4 library can't be disabled, or at least be considered as lowest priority, the import feature is no much use for me. I'd suggest a m4 enable switch in the library That's what pointing the library query program at /bin/true does. Maybe we need to read the menus in reverse order? ^ paths? No, read the code and it will make sense. :-P I'd say, the last path should receive highest priority. This is how the PATH environment variable of the shell is parsed. $PATH is the other way - first match wins, not last match. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
Seems to work, I pushed it to master tree. Thanks! ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
More generally: What config files does import schematics look at? Importing uses pcb's internal paths, not gafrc. Gnetlist simply passes the list of elements to pcb and lets pcb load them. You can point pcb's m4 library at a non-existing directory, I suppose. Look at make_footprint_hash() in src/buffer.c Maybe we need to read the menus in reverse order? I'm not sure we ever had a rule about what the priorities were if two libraries had the same element, as from within pcb you always specified the library too. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
bump. More generally: What config files does import schematics look at? The import feature needs a bit more documentation. --)kaimartin(--- -- Kai-Martin Knaak tel: +49-511-762-2895 Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211 Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de GPG key:http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmkop=get ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
Kai-Martin Knaak wrote: Yes please, with git format-patch if you can. Here you go. Did the patch apply? ---)kaimartin(--- -- Kai-Martin Knaak Öffentlicher PGP-Schlüssel: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x6C0B9F53 ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
DJ Delorie wrote: Yes please, with git format-patch if you can. Here you go. I tried to follow the recipe in http://www.geda.seul.org/wiki/geda:scm#format_a_patch_to_send_to_the_developers Hope, I didn't mess it. ---)kaimartin(--- -- Kai-Martin Knaak tel: +49-511-762-2895 Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211 Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de GPG key:http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmkop=getFrom 4ce29f9f8d79abd10e1b94c92e265c6affec905c Mon Sep 17 00:00:00 2001 From: kai-martin k...@bibo.iqo.uni-hannover.de Date: Tue, 10 Aug 2010 11:25:52 +0200 Subject: [PATCH] modified: action.c (fix element name position on import schematic) --- src/action.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/action.c b/src/action.c index 5f1c7a1..12745d1 100644 --- a/src/action.c +++ b/src/action.c @@ -7112,8 +7112,8 @@ ActionElementList (int argc, char **argv, int x, int y) for (i=0; iMAX_ELEMENTNAMES; i++) { - pe-Name[i].X = e-Name[i].X - mx; - pe-Name[i].Y = e-Name[i].Y - my; + pe-Name[i].X = e-Name[i].X - mx + pe-MarkX ; + pe-Name[i].Y = e-Name[i].Y - my + pe-MarkY ; pe-Name[i].Direction = e-Name[i].Direction; pe-Name[i].Scale = e-Name[i].Scale; } -- 1.7.1 ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
During my trial runs I noted, that the import prefers the default library for footprints that have the same file name. But most of the time I want my local footprints. Is there a way to make import ignore the default library? With gsch2pcb I achieve this feat with (reset-source-library) in the gafrc file. If I specify import(gnetlist), the local gafrc does not seem to be read. How about the M4 library? Does the import look at it, too? If so, how can I make it ignore the m4 lib? More generally: What config files does import schematics look at? ---)kaimartin(--- -- Kai-Martin Knaak tel: +49-511-762-2895 Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211 Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de GPG key:http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmkop=get ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
DJ Delorie wrote: Is this the latest git pcb? looks-at-the-date Not quite. It is git-head from june 15th. I'll update and and report my mileage. ---)kaimartin(--- -- Kai-Martin Knaak tel: +49-511-762-2895 Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211 Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de GPG key:http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmkop=get ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
Kai-Martin Knaak wrote: I'll update and and report my mileage. Did an update and got no change. Text of replaced footprints is still offset about 15 cm to the upper left. ---)kaimartin(--- -- Kai-Martin Knaak tel: +49-511-762-2895 Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211 Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de GPG key:http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmkop=get ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
Well, you'll have to help with this then... The code is in action.c near the end of ActionElementList() : er = ElementOrientation (e); pe = PASTEBUFFER-Data-Element[0]; pr = ElementOrientation (pe); mx = e-MarkX; my = e-MarkY; if (er != pr) RotateElementLowLevel (PASTEBUFFER-Data, pe, pe-MarkX, pe-MarkY, (er-pr+4)%4); for (i=0; iMAX_ELEMENTNAMES; i++) { pe-Name[i].X = e-Name[i].X - mx; pe-Name[i].Y = e-Name[i].Y - my; pe-Name[i].Direction = e-Name[i].Direction; pe-Name[i].Scale = e-Name[i].Scale; } There's a couple of coordinates in play - the stored location of the new element, the mark relative to that, the text location relative to the element, the old element location, and the old element's text location. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
DJ Delorie wrote: Well, you'll have to help with this then... (...) for (i=0; iMAX_ELEMENTNAMES; i++) { pe-Name[i].X = e-Name[i].X - mx; pe-Name[i].Y = e-Name[i].Y - my; pe-Name[i].Direction = e-Name[i].Direction; pe-Name[i].Scale = e-Name[i].Scale; } Ok, found it. The names need an additional shift by the coordinates of the mark of the new element. This translates the code snippet to: for (i=0; iMAX_ELEMENTNAMES; i++) { pe-Name[i].X = e-Name[i].X - mx + pe-MarkX ; pe-Name[i].Y = e-Name[i].Y - my + pe-MarkY ; pe-Name[i].Direction = e-Name[i].Direction; pe-Name[i].Scale = e-Name[i].Scale; } The mark of footprints in the default lib are located at 0/0. So the bug does not show with them. By contrast, footprint made with the GUI typically have a large offset. (What determines its size?) Should I produce a patch file? ---)kaimartin(--- -- Kai-Martin Knaak tel: +49-511-762-2895 Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211 Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de GPG key:http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmkop=get ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: pcb: experience with import-schematics
Should I produce a patch file? Yes please, with git format-patch if you can. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user