From: Keith Packard Date: Tue, 4 Sep 2012 04:36:46 +0000 (-0500) Subject: Ignore built files X-Git-Tag: v0.2~2 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=47ee816ab4dc08f501e8c557e4c7790607c35d48;p=hw%2Fmicropeak Ignore built files Signed-off-by: Keith Packard --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..59694c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +*.gbr +*.bak* +*- +*~ +*.zip +*.xy +*.cnc +*.csv +*.dk +*.bom +*.drc +*.net +*.ps +*.pdf +*.unsorted +*.cmd +partslist diff --git a/gnet-partslist-bom.scm b/gnet-partslist-bom.scm new file mode 100644 index 0000000..27e9813 --- /dev/null +++ b/gnet-partslist-bom.scm @@ -0,0 +1,107 @@ +; Copyright © 2012 Keith Packard +; gnet-partslist-bom.scm +; +; 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 02110-1301 USA + +; The /'s may not work on win32 +(load (string-append gedadata "/scheme/gnet-partslist-common.scm")) + +(define (caddddddr s) + (car (cdr (cdr (cdr (cdr (cdr (cdr s)))))))) + +(define (cadddddr s) + (car (cdr (cdr (cdr (cdr (cdr s))))))) + +(define (caddddr s) + (car (cdr (cdr (cdr (cdr s)))))) + +(define multiplier 1) + +(define (partslist-bom:write-part s port) + (let ((quantity (caddddddr s)) + (part (cadddddr s)) + (device (cadr s)) + (value (caddr s))) + (display (* multiplier quantity) port) + (display ", " port) + (display part port) + (display ", " port) + (display device port) + (display " " port) + (display value port) + (display "\n" port))) + +(define (partslist-bom:write-partslist ls port) + (if (null? ls) + '() + (begin (partslist-bom:write-part (car ls) port) + (partslist-bom:write-partslist (cdr ls) port)))) + +(define (count-same-parts ls) + (if (null? ls) + (append ls) + (let* ((parts-table-no-uref (let ((result '())) + (for-each (lambda (l) (set! result (cons (cdr l) result))) (reverse ls)) + (append result))) + (first-ls (car parts-table-no-uref)) + (match-length (length (member first-ls (reverse parts-table-no-uref)))) + (rest-ls (list-tail ls match-length)) + (match-ls (list-tail (reverse ls) (- (length ls) match-length))) + (uref-ls (let ((result '())) + (for-each (lambda (l) (set! result (cons (car l) result))) match-ls) + (append result)))) + (cons (cons uref-ls (append first-ls (list match-length))) (count-same-parts rest-ls))))) + +(define get-vendor + (lambda (package) + (gnetlist:get-package-attribute package "vendor"))) + +(define get-vendor-part-number + (lambda (package) + (gnetlist:get-package-attribute package "vendor_part_number"))) + +(define get-footprint + (lambda (package) + (gnetlist:get-package-attribute package "footprint"))) + +(define (get-parts-table-bom packages vendor) + (if (null? packages) + '() + (let ((package (car packages))) + (if (string=? (get-vendor package) vendor) + (if (string=? (get-device package) "include") + (get-parts-table-bom (cdr packages) vendor) + (cons (list package + (get-device package) + (get-value package) + (get-footprint package) + (get-vendor package) + (get-vendor-part-number package)) ;; sdb change + (get-parts-table-bom (cdr packages) vendor))) + (get-parts-table-bom (cdr packages) vendor))))) + + +(define (get-vendor-match) + (let ((vendor-param (calling-flag? "vendor" (gnetlist:get-calling-flags)))) + (if vendor-param + (cdr vendor-param) + "digikey"))) + +(define (partslist-bom output-filename) + (let ((port (open-output-file output-filename)) + (parts-table (marge-sort-with-multikey (get-parts-table-bom packages (get-vendor-match)) '(1 2 3 0)))) + (set! parts-table (count-same-parts parts-table)) + (partslist-bom:write-partslist parts-table port) + (close-output-port port))) diff --git a/project b/project new file mode 100644 index 0000000..42f2b86 --- /dev/null +++ b/project @@ -0,0 +1,13 @@ +# List all the schematics to be netlisted and laid out on the pc board +schematics micropeak.sch + +# for an output-name of foo, gsch2pcb generates files foo.net, foo.pcb, +# and foo.new.pcb. if there is no output name specified, the file names +# are derived from the first listed schematic... +output-name micropeak + +elements-dir packages +elements-dir /usr/share/pcb + +# stick to newlib elements, don't use the older/odder m4 stuff +skip-m4 diff --git a/symbols/conn-6.sym b/symbols/conn-6.sym new file mode 100644 index 0000000..bfaefe6 --- /dev/null +++ b/symbols/conn-6.sym @@ -0,0 +1,70 @@ +v 20080127 1 +P 0 2100 300 2100 1 0 0 +{ +T 0 2100 5 10 0 0 0 0 1 +pintype=unknown +T 355 2095 5 10 0 1 0 0 1 +pinlabel=unknown +T 205 2145 5 10 1 1 0 6 1 +pinnumber=1 +T 0 2100 5 10 0 0 0 0 1 +pinseq=0 +} +P 0 1700 300 1700 1 0 0 +{ +T 0 1700 5 10 0 0 0 0 1 +pintype=unknown +T 355 1695 5 10 0 1 0 0 1 +pinlabel=unknown +T 205 1745 5 10 1 1 0 6 1 +pinnumber=2 +T 0 1700 5 10 0 0 0 0 1 +pinseq=0 +} +P 0 1300 300 1300 1 0 0 +{ +T 0 1300 5 10 0 0 0 0 1 +pintype=unknown +T 355 1295 5 10 0 1 0 0 1 +pinlabel=unknown +T 205 1345 5 10 1 1 0 6 1 +pinnumber=3 +T 0 1300 5 10 0 0 0 0 1 +pinseq=0 +} +P 0 900 300 900 1 0 0 +{ +T 0 900 5 10 0 0 0 0 1 +pintype=unknown +T 355 895 5 10 0 1 0 0 1 +pinlabel=unknown +T 205 945 5 10 1 1 0 6 1 +pinnumber=4 +T 0 900 5 10 0 0 0 0 1 +pinseq=0 +} +P 0 500 300 500 1 0 0 +{ +T 0 500 5 10 0 0 0 0 1 +pintype=unknown +T 355 495 5 10 0 1 0 0 1 +pinlabel=unknown +T 205 545 5 10 1 1 0 6 1 +pinnumber=5 +T 0 500 5 10 0 0 0 0 1 +pinseq=0 +} +P 0 100 300 100 1 0 0 +{ +T 0 100 5 10 0 0 0 0 1 +pintype=unknown +T 355 95 5 10 0 1 0 0 1 +pinlabel=unknown +T 205 145 5 10 1 1 0 6 1 +pinnumber=6 +T 0 100 5 10 0 0 0 0 1 +pinseq=0 +} +B 300 0 400 2200 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1 +T 355 2295 8 10 1 1 0 0 1 +refdes=J? diff --git a/symbols/pico-ezmate-6.sym b/symbols/pico-ezmate-6.sym index 0c8023d..099aca7 100644 --- a/symbols/pico-ezmate-6.sym +++ b/symbols/pico-ezmate-6.sym @@ -8,7 +8,7 @@ pinlabel=unknown T 205 2145 5 10 1 1 0 6 1 pinnumber=1 T 0 2100 5 10 0 0 0 0 1 -pinseq=0 +pinseq=1 } P 0 1700 300 1700 1 0 0 { @@ -19,7 +19,7 @@ pinlabel=unknown T 205 1745 5 10 1 1 0 6 1 pinnumber=2 T 0 1700 5 10 0 0 0 0 1 -pinseq=0 +pinseq=2 } P 0 1300 300 1300 1 0 0 { @@ -30,7 +30,7 @@ pinlabel=unknown T 205 1345 5 10 1 1 0 6 1 pinnumber=3 T 0 1300 5 10 0 0 0 0 1 -pinseq=0 +pinseq=3 } P 0 900 300 900 1 0 0 { @@ -41,7 +41,7 @@ pinlabel=unknown T 205 945 5 10 1 1 0 6 1 pinnumber=4 T 0 900 5 10 0 0 0 0 1 -pinseq=0 +pinseq=4 } P 0 500 300 500 1 0 0 { @@ -52,7 +52,7 @@ pinlabel=unknown T 205 545 5 10 1 1 0 6 1 pinnumber=5 T 0 500 5 10 0 0 0 0 1 -pinseq=0 +pinseq=5 } P 0 100 300 100 1 0 0 { @@ -63,22 +63,11 @@ pinlabel=unknown T 205 145 5 10 1 1 0 6 1 pinnumber=6 T 0 100 5 10 0 0 0 0 1 -pinseq=0 +pinseq=6 } B 300 0 400 2200 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1 T 355 2295 8 10 1 1 0 0 1 refdes=J? -P 1000 100 700 100 1 0 0 -{ -T 1000 100 5 10 0 0 180 0 1 -pintype=unknown -T 1045 145 5 10 1 1 0 6 1 -pinlabel=GND -T 795 145 5 10 0 1 0 0 1 -pinnumber=GND -T 1000 100 5 10 0 0 180 0 1 -pinseq=0 -} T -5 -25 8 10 0 1 0 0 1 footprint=pico-ezmate-6 T -5 -25 8 10 0 1 0 0 1