+++ /dev/null
-; Copyright 2009 by Bdale Garbee <bdale@gag.com>
-; gnet-partslistgag.scm
-;
-; derived from gnet-partslist3.scm
-; Copyright (C) 2001 MIYAMOTO Takanori
-;
-; 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., 59 Temple Place, Suite 330, Boston, MA 02111 USA
-
-; The /'s may not work on win32
-
-; Copyright (C) 2001 MIYAMOTO Takanori
-; gnet-partslist-common.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., 59 Temple Place, Suite 330, Boston, MA 02111 USA
-
-(define (get-parts-table packages)
- (if (null? packages)
- '()
- (let ((package (car packages)))
- (if (string=? "1" (gnetlist:get-package-attribute package "nobom"))
- (get-parts-table (cdr packages))
- (cons (list (gnetlist:get-package-attribute package "refdes")
- (get-device package)
- (get-value package)
- (gnetlist:get-package-attribute package "footprint")
- (gnetlist:get-package-attribute package "loadstatus")
- (gnetlist:get-package-attribute package "vendor")
- (gnetlist:get-package-attribute package "vendor_part_number")) ;; sdb change
- (get-parts-table (cdr packages)))))))
-
-(define (write-one-row ls separator end-char port)
- (if (null? ls)
- '()
- (begin (display "\"" port)
- (display (car ls) port)
- (for-each (lambda (st) (display separator port)(display st port)) (cdr ls))
- (display end-char port))))
-
-(define (get-sortkey-value ls key-column)
- (list-ref (car ls) key-column))
-
-(define (marge-sort-sub ls1 ls2 key-column)
- (if (or (null? ls1) (null? ls2))
- (append ls1 ls2)
- (if (string-ci<=? (get-sortkey-value ls1 key-column) (get-sortkey-value ls2 key-column))
- (cons (car ls1) (marge-sort-sub (cdr ls1) ls2 key-column))
- (cons (car ls2) (marge-sort-sub ls1 (cdr ls2) key-column)))))
-
-(define (marge-sort ls key-column)
- (let ((midpoint (inexact->exact (floor (/ (length ls) 2)))))
- (if (<= (length ls) 1)
- (append ls)
- (let ((top-half (reverse (list-tail (reverse ls) midpoint)))
- (bottom-half (list-tail ls (- (length ls) midpoint))))
- (set! top-half (marge-sort top-half key-column))
- (set! bottom-half (marge-sort bottom-half key-column))
- (marge-sort-sub top-half bottom-half key-column)))))
-
-(define (marge-sort-with-multikey ls key-columns)
- (if (or (<= (length ls) 1) (null? key-columns))
- (append ls)
- (let* ((key-column (car key-columns))
- (sorted-ls (marge-sort ls key-column))
- (key-column-only-ls
- ((lambda (ls) (let loop ((l ls))
- (if (null? l)
- '()
- (cons (get-sortkey-value l key-column) (loop (cdr l))))))
- sorted-ls))
- (first-value (get-sortkey-value sorted-ls key-column))
- (match-length (length (member first-value (reverse key-column-only-ls))))
- (first-ls (list-tail (reverse sorted-ls) (- (length sorted-ls) match-length)))
- (rest-ls (list-tail sorted-ls match-length)))
- (append (marge-sort-with-multikey first-ls (cdr key-columns))
- (marge-sort-with-multikey rest-ls key-columns)))))
-
-(define partslistgag:write-top-header
- (lambda (port)
- (display "\"device\",\"value\",\"footprint\",\"loadstatus\",\"vendor\",\"vendor_part_number\",\"quantity\",\"refdes\"\n" port)))
-
-(define (partslistgag:write-partslist ls port)
- (if (null? ls)
- '()
- (begin (write-one-row (cdar ls) "\",\"" "\"," port)
- (write-one-row (caar ls) " " "\"\n" port)
- (partslistgag:write-partslist (cdr ls) port))))
-
-(define partslistgag:write-bottom-footer
- (lambda (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 partslistgag
- (lambda (output-filename)
- (let ((port (open-output-file output-filename))
- (parts-table (marge-sort-with-multikey (get-parts-table packages) '(1 2 3 0))))
- (set! parts-table (count-same-parts parts-table))
- (partslistgag:write-top-header port)
- (partslistgag:write-partslist parts-table port)
- (partslistgag:write-bottom-footer port)
- (close-output-port port))))
-v 20100214 2
+v 20130925 2
C 40000 40000 0 0 0 title-D-bdale.sym
C 47200 57600 1 0 0 miniUSB.sym
{
N 47200 58000 46700 58000 4
N 46400 60400 46400 59600 4
N 46400 59600 47200 59600 4
-N 46400 60400 51900 60400 4
+N 46400 60400 51200 60400 4
{
T 46600 59700 5 10 1 1 0 0 1
netname=v_usb
}
-C 52900 58600 1 0 0 gnd-1.sym
+C 52200 58600 1 0 0 gnd.sym
T 40000 40000 8 10 1 1 0 0 1
value=270
-C 51400 59100 1 90 0 capacitor-1.sym
+C 50700 59100 1 90 0 capacitor.sym
{
-T 50700 59300 5 10 0 0 90 0 1
+T 50000 59300 5 10 0 0 90 0 1
device=CAPACITOR
-T 51700 59900 5 10 1 1 180 0 1
+T 50900 59900 5 10 1 1 180 0 1
refdes=C5
-T 50500 59300 5 10 0 0 90 0 1
+T 49800 59300 5 10 0 0 90 0 1
symversion=0.1
-T 51300 59200 5 10 1 1 0 0 1
+T 50600 59200 5 10 1 1 0 0 1
value=1uF
-T 51400 59100 5 10 0 0 0 0 1
+T 50700 59100 5 10 0 0 0 0 1
vendor_part_number=490-1320-1-ND
-T 51400 59100 5 10 0 0 0 0 1
+T 50700 59100 5 10 0 0 0 0 1
footprint=0402
-T 51400 59100 5 10 0 0 0 0 1
+T 50700 59100 5 10 0 0 0 0 1
vendor=digikey
-T 51400 59100 5 10 0 1 0 0 1
+T 50700 59100 5 10 0 1 0 0 1
loadstatus=smt
}
-N 51200 60400 51200 60000 4
-N 51200 59100 51200 58900 4
-C 51900 59500 1 0 0 LP2980.sym
+N 50500 60400 50500 60000 4
+N 50500 59100 50500 58900 4
+C 51200 59500 1 0 0 TC2185.sym
{
-T 52295 60695 5 10 1 1 0 0 1
+T 51595 60695 5 10 1 1 0 0 1
refdes=U1
-T 52495 60195 5 10 0 1 0 0 1
+T 51795 60195 5 10 0 1 0 0 1
device=IC
-T 51895 59495 5 10 0 1 0 0 1
+T 51195 59495 5 10 0 1 0 0 1
footprint=SOT23-5
-T 51900 59500 5 10 0 0 0 0 1
+T 51200 59500 5 10 0 0 0 0 1
vendor_part_number=TC10553.3VCT713CT-ND
-T 51900 59500 5 10 0 0 0 0 1
+T 51200 59500 5 10 0 0 0 0 1
vendor=digikey
-T 51900 59500 5 10 1 1 0 0 1
+T 52000 60700 5 10 1 1 0 0 1
value=TC1055-3.3
-T 51900 59500 5 10 0 1 0 0 1
+T 51200 59500 5 10 0 1 0 0 1
loadstatus=smt
}
-N 53000 58900 53000 59500 4
+N 52300 58900 52300 59500 4
T 40000 40000 8 10 1 1 0 0 1
netname=3.3V
C 50600 45500 1 0 0 CC1111.sym
N 50600 57300 50200 57300 4
N 50600 56900 50200 56900 4
N 50600 56500 50200 56500 4
-C 48900 55500 1 0 0 capacitor-1.sym
+C 48900 55500 1 0 0 capacitor.sym
{
T 49100 56200 5 10 0 0 0 0 1
device=CAPACITOR
T 48900 55500 5 10 0 1 0 0 1
loadstatus=smt
}
-C 48900 56300 1 0 0 capacitor-1.sym
+C 48900 56300 1 0 0 capacitor.sym
{
T 49100 57000 5 10 0 0 0 0 1
device=CAPACITOR
T 48900 56300 5 10 0 1 0 0 1
loadstatus=smt
}
-C 48900 57100 1 0 0 capacitor-1.sym
+C 48900 57100 1 0 0 capacitor.sym
{
T 49100 57800 5 10 0 0 0 0 1
device=CAPACITOR
N 48700 57300 48700 55400 4
N 48900 55700 48700 55700 4
N 48900 56500 48700 56500 4
-C 48600 55100 1 0 0 gnd-1.sym
-C 56100 56000 1 270 0 capacitor-1.sym
+C 48600 55100 1 0 0 gnd.sym
+C 56100 56000 1 270 0 capacitor.sym
{
T 56800 55800 5 10 0 0 270 0 1
device=CAPACITOR
T 56100 56000 5 10 0 1 0 0 1
loadstatus=smt
}
-C 57100 56000 1 270 0 capacitor-1.sym
+C 57100 56000 1 270 0 capacitor.sym
{
T 57800 55800 5 10 0 0 270 0 1
device=CAPACITOR
T 57100 56000 5 10 0 1 0 0 1
loadstatus=smt
}
-C 58100 56000 1 270 0 capacitor-1.sym
+C 58100 56000 1 270 0 capacitor.sym
{
T 58800 55800 5 10 0 0 270 0 1
device=CAPACITOR
T 58100 56000 5 10 0 1 0 0 1
loadstatus=smt
}
-C 59100 56000 1 270 0 capacitor-1.sym
+C 59100 56000 1 270 0 capacitor.sym
{
T 59800 55800 5 10 0 0 270 0 1
device=CAPACITOR
N 58300 56000 58300 56800 4
N 59300 56000 59300 57200 4
N 59300 57200 55900 57200 4
-C 59200 54800 1 0 0 gnd-1.sym
-C 58200 54800 1 0 0 gnd-1.sym
-C 57200 54800 1 0 0 gnd-1.sym
-C 56200 54800 1 0 0 gnd-1.sym
-C 59500 52800 1 270 0 capacitor-1.sym
+C 59200 54800 1 0 0 gnd.sym
+C 58200 54800 1 0 0 gnd.sym
+C 57200 54800 1 0 0 gnd.sym
+C 56200 54800 1 0 0 gnd.sym
+C 59500 52800 1 270 0 capacitor.sym
{
T 60200 52600 5 10 0 0 270 0 1
device=CAPACITOR
T 59500 52800 5 10 0 1 0 0 1
loadstatus=smt
}
-C 61000 52700 1 0 0 inductor-1.sym
+C 61000 52700 1 0 0 inductor.sym
{
T 61200 53200 5 10 0 0 0 0 1
device=INDUCTOR
T 61000 52700 5 10 0 1 0 0 1
loadstatus=smt
}
-C 62300 53500 1 0 0 inductor-1.sym
+C 62300 53500 1 0 0 inductor.sym
{
T 62500 54000 5 10 0 0 0 0 1
device=INDUCTOR
T 62300 53500 5 10 0 1 0 0 1
loadstatus=smt
}
-C 59600 54500 1 270 0 inductor-1.sym
+C 59600 54500 1 270 0 inductor.sym
{
T 60100 54300 5 10 0 0 270 0 1
device=INDUCTOR
T 59600 54500 5 10 0 1 0 0 1
loadstatus=smt
}
-C 61000 54300 1 0 0 capacitor-1.sym
+C 61000 54300 1 0 0 capacitor.sym
{
T 61200 55000 5 10 0 0 0 0 1
device=CAPACITOR
T 61000 54300 5 10 0 1 0 0 1
loadstatus=smt
}
-C 61800 54200 1 0 0 gnd-1.sym
+C 61800 54200 1 0 0 gnd.sym
N 61000 54500 59700 54500 4
N 55500 53600 61000 53600 4
-C 61000 53400 1 0 0 capacitor-1.sym
+C 61000 53400 1 0 0 capacitor.sym
{
T 61200 54100 5 10 0 0 0 0 1
device=CAPACITOR
N 61900 52800 62100 52800 4
N 62100 52800 62100 53600 4
N 61000 52800 55500 52800 4
-C 59600 51600 1 0 0 gnd-1.sym
-C 65200 53400 1 0 0 capacitor-1.sym
+C 59600 51600 1 0 0 gnd.sym
+C 65200 53400 1 0 0 capacitor.sym
{
T 65400 54100 5 10 0 0 0 0 1
device=CAPACITOR
T 65200 53400 5 10 0 1 0 0 1
loadstatus=smt
}
-C 63300 53200 1 270 0 capacitor-1.sym
+C 63300 53200 1 270 0 capacitor.sym
{
T 64000 53000 5 10 0 0 270 0 1
device=CAPACITOR
loadstatus=smt
}
N 63500 53200 63500 53600 4
-C 63400 52000 1 0 0 gnd-1.sym
-C 64800 53200 1 270 0 capacitor-1.sym
+C 63400 52000 1 0 0 gnd.sym
+C 64800 53200 1 270 0 capacitor.sym
{
T 65200 52900 5 10 1 1 0 0 1
refdes=C24
T 64800 53200 5 10 0 1 0 0 1
loadstatus=smt
}
-C 64900 52000 1 0 0 gnd-1.sym
-C 63800 53500 1 0 0 inductor-1.sym
+C 64900 52000 1 0 0 gnd.sym
+C 63800 53500 1 0 0 inductor.sym
{
T 64000 54000 5 10 0 0 0 0 1
device=INDUCTOR
device=CONNECTOR
}
N 66100 53600 66700 53600 4
-C 66500 52800 1 0 0 gnd-1.sym
+C 66500 52800 1 0 0 gnd.sym
N 66700 53200 66600 53200 4
N 66600 53200 66600 53100 4
-C 55600 45300 1 0 0 gnd-1.sym
+C 55600 45300 1 0 0 gnd.sym
N 55500 46000 55700 46000 4
N 55700 46000 55700 45600 4
-C 56200 46600 1 270 0 resistor-1.sym
+C 56200 46600 1 270 0 resistor.sym
{
T 56600 46300 5 10 0 0 270 0 1
device=RESISTOR
N 55500 47600 58300 47600 4
N 55500 48000 59300 48000 4
N 59300 47600 59000 47600 4
-C 59100 46600 1 270 0 capacitor-1.sym
+C 59100 46600 1 270 0 capacitor.sym
{
T 59800 46400 5 10 0 0 270 0 1
device=CAPACITOR
T 59100 46600 5 10 0 1 0 0 1
loadstatus=smt
}
-C 57800 46600 1 270 0 capacitor-1.sym
+C 57800 46600 1 270 0 capacitor.sym
{
T 58500 46400 5 10 0 0 270 0 1
device=CAPACITOR
T 57800 46600 5 10 0 1 0 0 1
loadstatus=smt
}
-C 59200 45400 1 0 0 gnd-1.sym
-C 57900 45400 1 0 0 gnd-1.sym
+C 59200 45400 1 0 0 gnd.sym
+C 57900 45400 1 0 0 gnd.sym
N 58000 46600 58000 47600 4
N 59300 46600 59300 48000 4
T 67700 53300 9 10 1 0 0 0 1
70CM Antenna
-C 48000 45500 1 90 0 capacitor-1.sym
+C 48000 45500 1 90 0 capacitor.sym
{
T 47300 45700 5 10 0 0 90 0 1
device=CAPACITOR
T 48000 45500 5 10 0 1 0 0 1
loadstatus=smt
}
-C 48800 45500 1 90 0 capacitor-1.sym
+C 48800 45500 1 90 0 capacitor.sym
{
T 48100 45700 5 10 0 0 90 0 1
device=CAPACITOR
T 48800 45500 5 10 0 1 0 0 1
loadstatus=smt
}
-C 46300 46800 1 0 0 resistor-1.sym
+C 46300 46800 1 0 0 resistor.sym
{
T 46600 47200 5 10 0 0 0 0 1
device=RESISTOR
T 46300 46800 5 10 0 1 0 0 1
loadstatus=smt
}
-C 46300 46400 1 0 0 resistor-1.sym
+C 46300 46400 1 0 0 resistor.sym
{
T 46600 46800 5 10 0 0 0 0 1
device=RESISTOR
}
N 47800 46400 47800 46900 4
N 46100 58800 47200 58800 4
-C 48100 44900 1 0 0 gnd-1.sym
+C 48100 44900 1 0 0 gnd.sym
N 47800 45500 47800 45300 4
N 47800 45300 48600 45300 4
N 48600 45300 48600 45500 4
N 48200 45200 48200 45300 4
-C 47400 56100 1 90 0 resistor-1.sym
+C 47400 56100 1 90 0 resistor.sym
{
T 47000 56400 5 10 0 0 90 0 1
device=RESISTOR
T 47400 56100 5 10 0 1 0 0 1
loadstatus=smt
}
-C 46600 57500 1 0 0 gnd-1.sym
+C 46600 57500 1 0 0 gnd.sym
T 68800 41800 9 30 1 0 0 0 1
TeleDongle
N 46100 46900 46300 46900 4
T 49300 54200 5 10 1 1 0 0 1
netname=debug_clock
}
-N 51900 60000 51900 60400 4
-C 63800 49700 1 0 0 gnd-1.sym
+N 51200 60000 51200 60400 4
+C 63800 49700 1 0 0 gnd.sym
N 64100 49600 62100 49600 4
{
T 62100 49700 5 10 1 1 0 0 1
T 49300 52600 5 10 1 1 0 0 1
netname=cs1
}
-C 47100 57000 1 0 0 3.3V-plus-1.sym
+C 47100 57000 1 0 0 3.3V-plus.sym
N 47300 56100 47300 55900 4
N 47300 55900 46100 55900 4
-C 47200 53000 1 270 0 resistor-1.sym
+C 47200 53000 1 270 0 resistor.sym
{
T 47600 52700 5 10 0 0 270 0 1
device=RESISTOR
T 47200 53000 5 10 0 1 0 0 1
loadstatus=smt
}
-C 47200 51200 1 0 0 gnd-1.sym
+C 47200 51200 1 0 0 gnd.sym
N 50600 53300 47300 53300 4
{
T 49300 53400 5 10 1 1 0 0 1
T 67200 48700 5 10 0 1 0 0 1
vendor=none
}
-C 54900 60400 1 0 0 3.3V-plus-1.sym
-C 56200 45300 1 0 0 gnd-1.sym
+C 54900 60400 1 0 0 3.3V-plus.sym
+C 56200 45300 1 0 0 gnd.sym
C 58300 47200 1 0 0 ABM8.sym
{
T 58500 47700 5 10 0 0 0 0 1
T 58300 47200 5 10 0 1 0 0 1
loadstatus=smt
}
-C 58900 46900 1 0 0 gnd-1.sym
-C 58200 46900 1 0 0 gnd-1.sym
+C 58900 46900 1 0 0 gnd.sym
+C 58200 46900 1 0 0 gnd.sym
N 50600 45700 49800 45700 4
N 49800 43100 49800 45700 4
-C 65000 46800 1 0 0 gnd-1.sym
+C 65000 46800 1 0 0 gnd.sym
N 65400 45500 63700 45500 4
{
T 63700 45600 5 10 1 1 0 0 1
T 64300 48400 5 10 1 1 0 0 1
value=Debug
T 64100 48700 5 10 0 0 0 0 1
-loadstatus=throughhole
+loadstatus=noload
T 64100 48700 5 10 0 0 0 0 1
vendor=mouser
T 64100 48700 5 10 0 1 0 0 1
device=CONNECTOR
}
-N 54000 60400 55100 60400 4
+N 53300 60400 55100 60400 4
C 47000 43300 1 90 0 resistor.sym
{
T 46600 43600 5 10 0 0 90 0 1
T 65400 44200 5 10 0 0 0 0 1
vendor_part_number=571-215079-8
T 65400 44200 5 10 0 0 0 0 1
-loadstatus=throughhole
+loadstatus=noload
T 65400 44200 5 10 0 0 0 0 1
vendor=mouser
T 65400 44200 5 10 0 1 0 0 1
device=CONNECTOR
}
-C 62800 44900 1 0 0 3.3V-plus-1.sym
+C 62800 44900 1 0 0 3.3V-plus.sym
N 65400 44700 63000 44700 4
N 63000 44700 63000 44900 4
C 47200 51900 1 270 0 led.sym
T 66400 54300 9 10 1 0 0 0 2
SMA is optional
default is wire whip
-C 46700 44200 1 0 0 3.3V-plus-1.sym
-C 47100 41800 1 90 0 capacitor-1.sym
+C 46700 44200 1 0 0 3.3V-plus.sym
+C 47100 41800 1 90 0 capacitor.sym
{
T 46400 42000 5 10 0 0 90 0 1
device=CAPACITOR
T 47100 41800 5 10 0 1 0 0 1
loadstatus=smt
}
-C 46800 41200 1 0 0 gnd-1.sym
+C 46800 41200 1 0 0 gnd.sym
N 46900 41500 46900 41800 4
N 46900 43100 49800 43100 4
{
netname=rstn
}
N 46900 42700 46900 43300 4
-C 54400 59400 1 90 0 capacitor-1.sym
+C 54400 59400 1 90 0 capacitor.sym
{
T 53700 59600 5 10 0 0 90 0 1
device=CAPACITOR
}
N 54200 60300 54200 60400 4
N 46000 43100 46900 43100 4
-N 51200 58900 54200 58900 4
+N 50500 58900 54200 58900 4
N 54200 58900 54200 59400 4
-C 48100 52700 1 270 0 resistor-1.sym
+C 48100 52700 1 270 0 resistor.sym
{
T 48500 52400 5 10 0 0 270 0 1
device=RESISTOR
T 48100 52700 5 10 0 1 0 0 1
loadstatus=smt
}
-C 48100 50900 1 0 0 gnd-1.sym
+C 48100 50900 1 0 0 gnd.sym
C 48100 51600 1 270 0 led.sym
{
T 48400 51550 5 10 1 1 0 0 1
netname=led_green
}
N 48200 52700 48200 52900 4
+C 53300 59900 1 0 0 nc-right.sym
+{
+T 53400 60400 5 10 0 0 0 0 1
+value=NoConnection
+T 53400 60600 5 10 0 0 0 0 1
+device=DRC_Directive
+}