Index: trunk/util/gsch2pcb_scm/Makefile =================================================================== --- trunk/util/gsch2pcb_scm/Makefile (nonexistent) +++ trunk/util/gsch2pcb_scm/Makefile (revision 253) @@ -0,0 +1,17 @@ +names = c1 c2 c3 +schematics = $(names:%=%.sch) +netlists = $(names:%=%.net) +goldens = $(names:%=golden/%.net) +diffs = $(names:%=%.diff) + +.PHONY: all clean $(netlists) +all: $(diffs) + +$(diffs): %.diff: %.net golden/%.net + diff $^ > $@ + +$(netlists): %.net: %.sch + gnetlist -g gsch2pcb -o $@ -m gnet-gsch2pcb.scm $< + +clean: + -rm -rf $(diffs) $(netlists) Index: trunk/util/gsch2pcb_scm/c1.sch =================================================================== --- trunk/util/gsch2pcb_scm/c1.sch (nonexistent) +++ trunk/util/gsch2pcb_scm/c1.sch (revision 253) @@ -0,0 +1,13 @@ +v 20130925 2 +C 18400 56000 1 0 0 connector3-2.sym +{ +T 19100 57700 5 10 1 1 0 6 1 +refdes=CONN1 +T 18700 57650 5 10 0 0 0 0 1 +device=CONNECTOR_3 +T 18700 57850 5 10 0 0 0 0 1 +footprint=CONNECTOR 3 1 +} +N 18400 57200 17800 57200 4 +N 17800 56400 17800 57200 4 +N 17800 56400 18400 56400 4 Index: trunk/util/gsch2pcb_scm/c2.sch =================================================================== --- trunk/util/gsch2pcb_scm/c2.sch (nonexistent) +++ trunk/util/gsch2pcb_scm/c2.sch (revision 253) @@ -0,0 +1,15 @@ +v 20130925 2 +C 18400 56000 1 0 0 connector3-2.sym +{ +T 19100 57700 5 10 1 1 0 6 1 +refdes=CONN1 +T 18700 57650 5 10 0 0 0 0 1 +device=CONNECTOR_3 +T 18700 57850 5 10 0 0 0 0 1 +footprint=CONNECTOR 3 1 +T 19300 56200 5 10 1 0 90 0 1 +value=val123 +} +N 18400 57200 17800 57200 4 +N 17800 56400 17800 57200 4 +N 17800 56400 18400 56400 4 Index: trunk/util/gsch2pcb_scm/c3.sch =================================================================== --- trunk/util/gsch2pcb_scm/c3.sch (nonexistent) +++ trunk/util/gsch2pcb_scm/c3.sch (revision 253) @@ -0,0 +1,15 @@ +v 20130925 2 +C 18400 56000 1 0 0 connector3-2.sym +{ +T 19100 57700 5 10 1 1 0 6 1 +refdes=CONN1 +T 18700 57650 5 10 0 0 0 0 1 +device=CONNECTOR_3 +T 18700 57850 5 10 0 0 0 0 1 +footprint=CONNECTOR(3, 1, silkmark=external) +T 19300 56200 5 10 1 0 90 0 1 +value=val123 +} +N 18400 57200 17800 57200 4 +N 17800 56400 17800 57200 4 +N 17800 56400 18400 56400 4 Index: trunk/util/gsch2pcb_scm/gnet-gsch2pcb.scm =================================================================== --- trunk/util/gsch2pcb_scm/gnet-gsch2pcb.scm (nonexistent) +++ trunk/util/gsch2pcb_scm/gnet-gsch2pcb.scm (revision 253) @@ -0,0 +1,54 @@ +;;; -*-scheme-*- +;;; + +;;; gEDA - GPL Electronic Design Automation +;;; gnetlist - gEDA Netlist +;;; Copyright (C) 1998-2010 Ales Hvezda +;;; +;;; This program is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 2 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program; if not, write to the Free Software +;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +;;; MA 02111-1301 USA. + +;; gsch2pcb format (based on PCBboard format by JM Routoure & Stefan Petersen) +;; Bill Wilson billw@wt.net +;; 6/17/2003 + +;; Simplified (thrown out m4 support) specially for Igor2 by vzh + +;; Splits a string with space separated words and returns a list +;; of the words (still as strings). +(define (gsch2pcb:split-to-list the-string) + (filter! + (lambda (x) (not (string=? "" x))) + (string-split the-string #\space))) + +;; Write the footprint for the package `refdes' to `port'. +(define (gsch2pcb:write-value-footprint refdes port) + + (let ((value (gnetlist:get-package-attribute refdes "value")) + (footprint (gsch2pcb:split-to-list + (gnetlist:get-package-attribute refdes "footprint")))) + + (format port "PKG(~A,~A,~A)\n" (string-join footprint " ") refdes value))) + +;; Write the footprints for all the refdes' in `lst'. +(define (gsch2pcb:write-value-footprints port lst) + (for-each (lambda (x) (gsch2pcb:write-value-footprint x port)) lst)) + + +(define (gsch2pcb output-filename) + (begin + (set-current-output-port (gnetlist:output-port output-filename)) + ;; don't use m4 + (gsch2pcb:write-value-footprints (current-output-port) packages))) Index: trunk/util/gsch2pcb_scm/golden/c1.net =================================================================== --- trunk/util/gsch2pcb_scm/golden/c1.net (nonexistent) +++ trunk/util/gsch2pcb_scm/golden/c1.net (revision 253) @@ -0,0 +1 @@ +PKG(CONNECTOR 3 1,CONN1,unknown) Index: trunk/util/gsch2pcb_scm/golden/c2.net =================================================================== --- trunk/util/gsch2pcb_scm/golden/c2.net (nonexistent) +++ trunk/util/gsch2pcb_scm/golden/c2.net (revision 253) @@ -0,0 +1 @@ +PKG(CONNECTOR 3 1,CONN1,val123) Index: trunk/util/gsch2pcb_scm/golden/c3.net =================================================================== --- trunk/util/gsch2pcb_scm/golden/c3.net (nonexistent) +++ trunk/util/gsch2pcb_scm/golden/c3.net (revision 253) @@ -0,0 +1 @@ +PKG(CONNECTOR(3, -1, -silkmark=external),CONN1,val123)