Re: gEDA-user: help with pcb dsn plugin
Hi all, -Original Message- From: geda-user-boun...@moria.seul.org [mailto:geda-user-boun...@moria.seul.org] On Behalf Of Peter Clifton Sent: Sunday, September 18, 2011 12:16 AM To: geda-user@moria.seul.org Subject: Re: gEDA-user: help with pcb dsn plugin On Fri, 2011-09-16 at 11:58 -0700, Jared Casper wrote: -- extensive style changes for my own sanity. There was inconsistent style throughout (like all of pcb's code), so I chose the one I personally like best (linux kernel style with indent of 4 instead of 8). :) PCB mostly has a consistent style, and we won't apply patches which don't follow that. Two space indents, if (test) { statements (like, this); } else { even_if_they_ARE_horrid (); } This is the next patch on my todo list. Is the above the exact syntax ? A lot of the code then substitutes 8 spaces for a tab character (at the beginnings of lines), but that is just the work of the devil IMO ;). -- Brought all the handling of coordinates up to date with the new Coord type and nm precision. There were a few places where dimensions were being rounded to the nearest mil, etc. which would've been bad for metric based boards. This has all been taken care of and appears to be working in some simple tests. DSN files are now in mm units with nm precision. Nice. -- Removed the somewhat dubious code for finding the rotation of the part copied over from bom.c. We don't have the original footprint anyway, so the rotation was not being used. The code is still there in bom.c if it is needed in the future. Good idea. [snip] Some things still not quite handled: -- Existing polygons on the pcb don't make it into the dsn. If you need any pointers on that, give me a shout. -- As noted in the bug report, there is no copyright/license notice from the original authors. Maybe some legal issues with the Specctra file format as well (I doubt it though, the text-based file format would be trivial to reverse-engineer even without the spec). You might need to try and contact the original author, but I'd personally not worry about implementing compatibility with the file-format. The only issue we might have is what we call it - Specctra might be a trademarked name. I contacted Josh Jordan (PM), see the copyright notice and license stanza in patch 0003 on LP. -- Probably some other stuff. It appears to be working with some early tests, and freerouting.net is pretty awesome. I still have issues with examples/LED.pcb getting imported without tweaking, the dsn exporter should work straight out-of-the-box without massaging quotes and other tweaks. Great! Best wishes, -- Peter Clifton Electrical Engineering Division, Engineering Department, University of Cambridge, 9, JJ Thomson Avenue, Cambridge CB3 0FA Tel: +44 (0)7729 980173 - (No signal in the lab!) Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me) Kind regards, Bert Timmerman. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
On Sun, Sep 18, 2011 at 1:00 AM, Bert Timmerman bert.timmer...@xs4all.nl wrote: PCB mostly has a consistent style, and we won't apply patches which don't follow that. This is the next patch on my todo list. Is the above the exact syntax ? No worries, I changed the style in the first place (when a good chunk of it was already in the standard style), I'll change it all to the standard when I put in some of the bug fixes I'm finding right now... Jared ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
On Sun, 2011-09-18 at 01:25 -0700, Jared Casper wrote: On Sun, Sep 18, 2011 at 1:00 AM, Bert Timmerman bert.timmer...@xs4all.nl wrote: PCB mostly has a consistent style, and we won't apply patches which don't follow that. This is the next patch on my todo list. Is the above the exact syntax ? No worries, I changed the style in the first place (when a good chunk of it was already in the standard style), I'll change it all to the standard when I put in some of the bug fixes I'm finding right now... Cool. Just for the record, I don't like PCB's code formatting style myself either ;) -- Peter Clifton Electrical Engineering Division, Engineering Department, University of Cambridge, 9, JJ Thomson Avenue, Cambridge CB3 0FA Tel: +44 (0)7729 980173 - (No signal in the lab!) Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me) signature.asc Description: This is a digitally signed message part ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
Peter Clifton wrote: PCB mostly has a consistent style, and we won't apply patches which don't follow that. Two space indents, if (test) { statements (like, this); } else { even_if_they_ARE_horrid (); } Can the style conventions be found anywhere in a halfway comprehensive written form? ---)kaimartin(--- -- Kai-Martin Knaak, Email: k...@familieknaak.de http://pool.sks-keyservers.net:11371/pks/lookup?search=0x6C0B9F53 Still unhappy with moderation of geda-user. Why? Because it is completely intransparent. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
Can the style conventions be found anywhere in a halfway comprehensive written form? http://astyle.sourceforge.net/ Better would be to write a AStyle configuration file, that matches the standard style of the code, that could then be applied to the code so all of it is completely self-consistent. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
Is the above the exact syntax ? PCB follows the GNU coding standards, Run the source through indent and it should come out correct. The only exception, usually, is comments (since we build docs from them) and table-formatted structure data, since GNU style creates much more whitespace than we need, reducing readability. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
Can the style conventions be found anywhere in a halfway comprehensive written form? http://www.gnu.org/prep/standards/ ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
On Sun, Sep 18, 2011 at 4:18 AM, Peter Clifton pc...@cam.ac.uk wrote: Just for the record, I don't like PCB's code formatting style myself either ;) I assume there are PCB devs that prefer the gnu style? Or is it only enforced to be consistent with all the legacy code? Jared ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
I assume there are PCB devs that prefer the gnu style? 1. I prefer GNU style. Emacs automatically does this style when coding, too. 2. GNU style seems to be popular elsewhere too, which reduces the learning curve for many new developers 3. Historically, that's what we've used. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
On Sun, Sep 18, 2011 at 11:46 AM, DJ Delorie d...@delorie.com wrote: I assume there are PCB devs that prefer the gnu style? 1. I prefer GNU style. Emacs automatically does this style when coding, too. Good enough. Note that Emacs automatically does whatever style you tell it to, including the linux kernel style. The default is just gnu, because, well, it's a gnu program. A quick ctrl-c . and you are writing in a different style. 2. GNU style seems to be popular elsewhere too, which reduces the learning curve for many new developers I'm sure you've seen a lot more code than I have, but from my own experience it's only projects with a code base 10 something years old or more that use it. Most newer code I've seen, especially in academia, use something more like the linux kernel style. Maybe it's just the circles I code in. I'm personally not a fan of the gnu style, but don't go as far as Linus to think that people should print it out and burn it. :) I just don't think it looks aesthetically pleasing and find it difficult to read, but probably just because I'm used to the other style. Jared ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
DJ Delorie wrote: Is the above the exact syntax ? PCB follows the GNU coding standards, (.. snip ..) The only exception, usually, is comments Is this also true for the c portion of gschem, gnetlist, gerbvierw, etc. ? ---)kaimartin(--- -- Kai-Martin Knaak, Email: k...@familieknaak.de http://pool.sks-keyservers.net:11371/pks/lookup?search=0x6C0B9F53 Still unhappy with moderation of geda-user. Why? Because it is completely intransparent. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
On Fri, 2011-09-16 at 11:58 -0700, Jared Casper wrote: -- extensive style changes for my own sanity. There was inconsistent style throughout (like all of pcb's code), so I chose the one I personally like best (linux kernel style with indent of 4 instead of 8). :) PCB mostly has a consistent style, and we won't apply patches which don't follow that. Two space indents, if (test) { statements (like, this); } else { even_if_they_ARE_horrid (); } A lot of the code then substitutes 8 spaces for a tab character (at the beginnings of lines), but that is just the work of the devil IMO ;). -- Brought all the handling of coordinates up to date with the new Coord type and nm precision. There were a few places where dimensions were being rounded to the nearest mil, etc. which would've been bad for metric based boards. This has all been taken care of and appears to be working in some simple tests. DSN files are now in mm units with nm precision. Nice. -- Removed the somewhat dubious code for finding the rotation of the part copied over from bom.c. We don't have the original footprint anyway, so the rotation was not being used. The code is still there in bom.c if it is needed in the future. Good idea. [snip] Some things still not quite handled: -- Existing polygons on the pcb don't make it into the dsn. If you need any pointers on that, give me a shout. -- As noted in the bug report, there is no copyright/license notice from the original authors. Maybe some legal issues with the Specctra file format as well (I doubt it though, the text-based file format would be trivial to reverse-engineer even without the spec). You might need to try and contact the original author, but I'd personally not worry about implementing compatibility with the file-format. The only issue we might have is what we call it - Specctra might be a trademarked name. -- Probably some other stuff. It appears to be working with some early tests, and freerouting.net is pretty awesome. Great! Best wishes, -- Peter Clifton Electrical Engineering Division, Engineering Department, University of Cambridge, 9, JJ Thomson Avenue, Cambridge CB3 0FA Tel: +44 (0)7729 980173 - (No signal in the lab!) Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me) signature.asc Description: This is a digitally signed message part ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
I just posted this to the related bug tracker, but thought some people that would be interested wouldn't be following that, so reposting here: I wanted try out this freerouting.net thing so went ahead and updated this patch to work with the latest git head and nanometer awesomeness. Here's what I did: -- extensive style changes for my own sanity. There was inconsistent style throughout (like all of pcb's code), so I chose the one I personally like best (linux kernel style with indent of 4 instead of 8). :) -- Brought all the handling of coordinates up to date with the new Coord type and nm precision. There were a few places where dimensions were being rounded to the nearest mil, etc. which would've been bad for metric based boards. This has all been taken care of and appears to be working in some simple tests. DSN files are now in mm units with nm precision. -- Removed the somewhat dubious code for finding the rotation of the part copied over from bom.c. We don't have the original footprint anyway, so the rotation was not being used. The code is still there in bom.c if it is needed in the future. -- Fixed some minor issues like a small memory leak, etc. -- Fixed issues registering the action and updated config values to use Coord. -- New line from the session file weren't clearing polygons. -- Possibly some other stuff, I forget, I just went through the whole thing top to bottom and fixed anything I saw weird. Some things still not quite handled: -- Existing polygons on the pcb don't make it into the dsn. -- Parts rotated at non-orthogonal angles probably won't work since rectangular pads won't be rotated correctly. -- As noted in the bug report, there is no copyright/license notice from the original authors. Maybe some legal issues with the Specctra file format as well (I doubt it though, the text-based file format would be trivial to reverse-engineer even without the spec). -- Probably some other stuff. It appears to be working with some early tests, and freerouting.net is pretty awesome. Jared On Sun, Jun 12, 2011 at 12:45 PM, Josh Jordan outerspacema...@yahoo.com wrote: I was able to fix the action problem and create a single patch, if anyone is interested in using freerouting.net. Turn on only the layers you want routed on before exporting. -Josh Jordan --- On Sun, 6/12/11, Josh Jordan outerspacema...@yahoo.com wrote: From: Josh Jordan outerspacema...@yahoo.com Subject: gEDA-user: help with pcb dsn plugin To: geda-user@moria.seul.org Date: Sunday, June 12, 2011, 12:14 PM I made a dsn export/import plugin a few years back that I am trying to merge into latest git pcb version. It works to export and the dsn can be routed with freerouting.net, and the import function appears in the menu, but the import action does not work. The function name is ActionLoadDsnFrom() but somehow during compilation it lists a LoaddsnFrom in the list of actions. It says Unknown Action when I try to use LoaddsnFrom or ActionLoadDsnFrom, or LoadDsnFrom. Is there a way to list what actions exist in pcb? I had to make 2 patches, the first one with git diff it only shows files that were changed. The second patch is from git add -i /src/hid/dsn, git commit and git format-patch -1 and it will only show files that were added. If anyone knows how to make the patch with 1 command that would also help. Thanks, Josh Jordan -Inline Attachment Follows- ___ geda-user mailing list [1]geda-user@moria.seul.org [2]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user References 1. file://localhost/mc/compose?to=geda-user@moria.seul.org 2. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user From a0bb98376c96e91876bebdcc6d958c8a9f07d6e4 Mon Sep 17 00:00:00 2001 From: Jared Casper jaredcas...@gmail.com Date: Thu, 15 Sep 2011 17:12:52 -0700 Subject: [PATCH] Add SPECCTRA dsn export and session file (.ses) import. Original patch by Josh Jordan and Dan McMahill. --- configure.ac |2 +- src/Makefile.am | 18 ++- src/gpcb-menu.res.in |1 + src/hid/dsn/dsn.c| 609 ++ src/hid/dsn/dsn.h|3 + src/hid/dsn/hid.conf |1 + src/pcb-menu.res.in |1 + 7 files changed, 633 insertions(+), 2 deletions(-) create mode 100644 src/hid/dsn/dsn.c create mode 100644 src/hid/dsn/dsn.h create mode 100644 src/hid/dsn/hid.conf diff --git a/configure.ac b/configure.ac index a802790..197e325 100644 --- a/configure.ac +++ b/configure.ac @@ -436,7 +436,7 @@ esac AC_MSG_CHECKING([for which exporters to use
gEDA-user: help with pcb dsn plugin
I made a dsn export/import plugin a few years back that I am trying to merge into latest git pcb version. It works to export and the dsn can be routed with freerouting.net, and the import function appears in the menu, but the import action does not work. The function name is ActionLoadDsnFrom() but somehow during compilation it lists a LoaddsnFrom in the list of actions. It says Unknown Action when I try to use LoaddsnFrom or ActionLoadDsnFrom, or LoadDsnFrom. Is there a way to list what actions exist in pcb? I had to make 2 patches, the first one with git diff it only shows files that were changed. The second patch is from git add -i /src/hid/dsn, git commit and git format-patch -1 and it will only show files that were added. If anyone knows how to make the patch with 1 command that would also help. Thanks, Josh Jordan diff --git a/configure.ac b/configure.ac index 6736466..7bcfe77 100644 --- a/configure.ac +++ b/configure.ac @@ -447,7 +447,7 @@ esac AC_MSG_CHECKING([for which exporters to use]) AC_ARG_WITH([exporters], -[ --with-exporters= Enable export devices: bom gerber gcode nelma png ps [[default=bom gerber gcode nelma png ps]]], +[ --with-exporters= Enable export devices: bom dsn gerber gcode nelma png ps [[default=bom gerber gcode nelma png ps]]], [],[with_exporters=$hid_exporters]) AC_MSG_RESULT([$with_exporters]) for e in `echo $with_exporters | sed 's/,/ /g'`; do diff --git a/src/Makefile.am b/src/Makefile.am index 18fe5c1..0c4a42a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,7 +15,7 @@ HIDLIST = @HIDLIST@ noinst_LIBRARIES = @HIDLIBS@ EXTRA_LIBRARIES = \ libgtk.a liblesstif.a libbatch.a \ - liblpr.a libgerber.a libbom.a libpng.a libps.a libnelma.a \ + liblpr.a libgerber.a libbom.a libdsn.a libpng.a libps.a libnelma.a \ libgcode.a pcblib_DATA= \ @@ -185,6 +185,7 @@ BUILT_SOURCES = \ hid/gcode/gcode_lists.h \ hid/nelma/nelma_lists.h \ hid/ps/ps_lists.h \ + hid/dsn/dsn_lists.h \ parse_y.h \ pcb-menu.h \ res_parse.h \ @@ -217,6 +218,7 @@ EXTRA_DIST= \ default_font \ $(srcdir)/hid/batch/hid.conf \ $(srcdir)/hid/bom/hid.conf \ + $(srcdir)/hid/dsn/hid.conf \ $(srcdir)/hid/gcode/hid.conf \ $(srcdir)/hid/gerber/hid.conf \ $(srcdir)/hid/gtk/gui-icons-misc.data \ @@ -359,6 +361,20 @@ hid/batch/batch_lists.h : ${LIBBATCH_SRCS} Makefile (for f in ${LIBBATCH_SRCS} ; do cat $(srcdir)/$$f ; done) | grep ^REGISTER $@.tmp mv $@.tmp $@ +libdsn_a_CPPFLAGS = -I./hid/dsn + +LIBDSN_SRCS = \ + hid/hidint.h \ + hid/dsn/dsn.c \ + hid/dsn/dsn.h +libdsn_a_SOURCES = ${LIBDSN_SRCS} hid/dsn/dsn_lists.h + +hid/dsn/dsn_lists.h : ${LIBDSN_SRCS} Makefile + $(MKDIR_P) hid/dsn + true $@ + (for f in ${LIBDSN_SRCS} ; do cat $(srcdir)/$$f ; done) |grep ^REGISTER $@.tmp + mv $@.tmp $@ + libgerber_a_SOURCES = \ hid/hidint.h \ hid/gerber/gerber.c @@ -446,6 +462,7 @@ DISTCLEANFILES= pcbtest.sh gpcb-menu.h pcb-menu.h \ hid/gcode/gcode_lists.h \ hid/nelma/nelma_lists.h \ hid/ps/ps_lists.h \ + hid/dsn/dsn_lists.h \ core_lists.h \ dbus-introspect.h diff --git a/src/gpcb-menu.res b/src/gpcb-menu.res index e9469e9..0af56b6 100644 --- a/src/gpcb-menu.res +++ b/src/gpcb-menu.res @@ -57,6 +57,7 @@ MainMenu = {Load layout data to paste-buffer PasteBuffer(Clear) Load(LayoutTobuffer)} {Load netlist file Load(Netlist)} {Load vendor resource file LoadVendorFrom()} + {Load autorouted session file LoaddsnFrom()} - {Save connection data of { a single element GetXY(Click to set the element mark ) Save(ElementConnections)} diff --git a/src/pcb-menu.res b/src/pcb-menu.res index aaf48c4..1a8c484 100644 --- a/src/pcb-menu.res +++ b/src/pcb-menu.res @@ -38,6 +38,7 @@ MainMenu = {Load layout data to paste-buffer PasteBuffer(Clear) Load(LayoutTobuffer)} {Load netlist file Load(Netlist)} {Load vendor resource file LoadVendor()} + {Load autorouted session file LoaddsnFrom()} {Print layout... Print()} {Export layout... Export()} {Calibrate Printer... PrintCalibrate()} From d44082a55b62692c0f1fad022f8bb59a8cef7480 Mon Sep 17 00:00:00 2001 From: josh josh@josh-desktop.(none) Date: Sun, 12 Jun 2011 10:53:05 -0500 Subject: [PATCH] Committer: josh joshjor...@robotjosh.com --- src/hid/dsn/dsn.c| 781 ++ src/hid/dsn/dsn.h|3 + src/hid/dsn/hid.conf |1 + 3 files changed, 785 insertions(+), 0 deletions(-) create mode 100644 src/hid/dsn/dsn.c create mode 100644 src/hid/dsn/dsn.h create mode 100644 src/hid/dsn/hid.conf diff --git a/src/hid/dsn/dsn.c b/src/hid/dsn/dsn.c new file mode 100644 index 000..eea82b9 --- /dev/null +++ b/src/hid/dsn/dsn.c @@ -0,0 +1,781 @@ +/* +This program exports specctra .dsn files from geda .pcb files. +By Josh Jordan and Dan McMahill, modified from bom.c + +*/ + +#ifdef HAVE_CONFIG_H +#include config.h +#endif + +#include stdio.h +#include stdarg.h +#include
Re: gEDA-user: help with pcb dsn plugin
it lists a LoaddsnFrom in the list of actions. It says Unknown Action when I try to use LoaddsnFrom or ActionLoadDsnFrom, or LoadDsnFrom. Is there a way to list what actions exist in pcb? pcb --show-actions ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: help with pcb dsn plugin
I was able to fix the action problem and create a single patch, if anyone is interested in using freerouting.net. Turn on only the layers you want routed on before exporting. -Josh Jordan --- On Sun, 6/12/11, Josh Jordan outerspacema...@yahoo.com wrote: From: Josh Jordan outerspacema...@yahoo.com Subject: gEDA-user: help with pcb dsn plugin To: geda-user@moria.seul.org Date: Sunday, June 12, 2011, 12:14 PM I made a dsn export/import plugin a few years back that I am trying to merge into latest git pcb version. It works to export and the dsn can be routed with freerouting.net, and the import function appears in the menu, but the import action does not work. The function name is ActionLoadDsnFrom() but somehow during compilation it lists a LoaddsnFrom in the list of actions. It says Unknown Action when I try to use LoaddsnFrom or ActionLoadDsnFrom, or LoadDsnFrom. Is there a way to list what actions exist in pcb? I had to make 2 patches, the first one with git diff it only shows files that were changed. The second patch is from git add -i /src/hid/dsn, git commit and git format-patch -1 and it will only show files that were added. If anyone knows how to make the patch with 1 command that would also help. Thanks, Josh Jordan -Inline Attachment Follows- ___ geda-user mailing list [1]geda-user@moria.seul.org [2]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user References 1. file://localhost/mc/compose?to=geda-user@moria.seul.org 2. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user