lose vestiges of pre-pref-parts era
authorBdale Garbee <bdale@gag.com>
Tue, 8 May 2018 20:10:24 +0000 (13:10 -0700)
committerBdale Garbee <bdale@gag.com>
Tue, 8 May 2018 20:10:24 +0000 (13:10 -0700)
gnet-partslist-bom.scm [deleted file]
gnet-partslist-keithp.scm [deleted file]
retab [deleted file]

diff --git a/gnet-partslist-bom.scm b/gnet-partslist-bom.scm
deleted file mode 100644 (file)
index 27e9813..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-; Copyright © 2012 Keith Packard <keithp@keithp.com>
-; 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/gnet-partslist-keithp.scm b/gnet-partslist-keithp.scm
deleted file mode 100644 (file)
index 2d01305..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-; Copyright (C) 2001-2010 MIYAMOTO Takanori
-; gnet-partslist-keithp.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 partslist-keithp:write-top-header
-  (lambda (port)
-    (display ".START\n" port)
-    (display "..device\tvalue\tfootprint\t\tvendor\tvendor_part_number\tquantity\trefdes\n" port)))
-
-(define (partslist-keithp:write-partslist ls port)
-  (if (null? ls)
-      '()
-      (begin (write-one-row (cdar ls) "\t" "\t" port)
-            (write-one-row (caar ls) " " "\n" port)
-            (partslist-keithp:write-partslist (cdr ls) port))))
-
-(define partslist-keithp:write-bottom-footer
-  (lambda (port)
-    (display ".END" port)
-    (newline 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-keithp packages)
-  (if (null? packages)
-      '()
-      (let ((package (car packages)))
-       (if (string=? (get-device package) "include")
-           (get-parts-table-keithp (cdr packages))
-           (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-keithp (cdr packages)))))))
-
-(define partslist-keithp
-  (lambda (output-filename)
-    (let ((port (open-output-file output-filename))
-         (parts-table (marge-sort-with-multikey (get-parts-table-keithp packages) '(1 2 3 0))))
-      (set! parts-table (count-same-parts parts-table))
-      (partslist-keithp:write-top-header port)
-      (partslist-keithp:write-partslist parts-table port)
-      (close-output-port port))))
diff --git a/retab b/retab
deleted file mode 100644 (file)
index b04ee10..0000000
--- a/retab
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/nickle
-
-string[*][*]   lines;
-int[*]         widths;
-
-string[*] get_one(file in) {
-       string  l = File::fgets(in);
-       return String::wordsplit(l, "\t");
-}
-
-string[*][*] get_all(file in) {
-       string[...][*] l = {};
-       while (!File::end(in))
-               l[dim(l)] = get_one(in);
-       return l;
-}
-
-int[*] find_widths(string[*][*] lines) {
-       int[...]        w = {};
-       for (int r = 0; r < dim(lines); r++) {
-               for (int c = 0; c < dim(lines[r]); c++) {
-                       int     len = String::length(lines[r][c]);
-                       if (c >= dim(w))
-                               w[c] = len;
-                       else
-                               w[c] = max(w[c], len);
-               }
-       }
-       return w;
-}
-
-void print_one(string s, int w) {
-       int     l = String::length(s);
-       printf ("%s ", s);
-       while (l < w) {
-               putchar(' ');
-               l++;
-       }
-}
-
-void print_line(string[*] line) {
-       for (int c = 0; c < dim(line); c++)
-               print_one(line[c], widths[c]);
-       putchar('\n');
-}
-
-void print_all() {
-       for (int r = 0; r < dim(lines); r++)
-               print_line(lines[r]);
-}
-
-void doit () {
-       lines = get_all(stdin);
-       widths = find_widths(lines);
-       print_all();
-}
-
-doit();