Index: MergePCBPS =================================================================== --- MergePCBPS (nonexistent) +++ MergePCBPS (revision 1033) @@ -0,0 +1,49 @@ +#!/bin/sh +# +# $Id$ +# +# merges PostScript files created by pcb (version >= 1.4.2) into +# a single file for backward compatibility +# +# Usage: name files... +# +# by Thomas Nau 9/96 +# + +if [ $# -eq 0 ]; then + echo "Usage: `basename $0` files..." >&2 + exit 1 +fi + +# some system need nawk +# +case `uname` in + SunOS) AWK=nawk;; + *) AWK=awk;; +esac + +$AWK ' + BEGIN { filecount = 0; } + /^%!PS/ { filecount++; } + /^%!PS/,/^% PCBENDDATA/ { + if (filecount == 1) + { + if (index($0, "%%Title:") == 1) + sub(",.*$", ", merged layouts"); + print $0; + next; + } + } + /^% PCBSTARTDATA/,/^% PCBENDDATA/ { + if (filecount > 1) + { + print $0; + next; + } + } + { next; } + END { + print "showpage"; + print "%%EOF"; + } +' $@ Property changes on: MergePCBPS ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: Merge_dimPCBPS =================================================================== --- Merge_dimPCBPS (nonexistent) +++ Merge_dimPCBPS (revision 1033) @@ -0,0 +1,51 @@ +#!/bin/sh +# +# $Id$ +# +# merges PostScript files created by pcb (version >= 1.4.2) into +# a single file for backward compatibility +# +# Usage: name files... +# +# by Thomas Nau 9/96 +# + +if [ $# -eq 0 ]; then + echo "Usage: `basename $0` files..." >&2 + exit 1 +fi + +# some system need nawk +# +case `uname` in + SunOS) AWK=nawk;; + *) AWK=awk;; +esac + +$AWK ' + BEGIN { filecount = 0; } + /^%!PS/ { filecount++; if (filecount > 1) { print "Black"; } } + /^%!PS/,/^% PCBENDDATA/ { + if (filecount == 1) + { + if (index($0, "%%Title:") == 1) + sub(",.*$", ", merged layouts"); + if (index($0, "Black") == 1) + sub ("Black", "0.9 mysetgray"); + print $0; + next; + } + } + /^% PCBSTARTDATA/,/^% PCBENDDATA/ { + if (filecount > 1) + { + print $0; + next; + } + } + { next; } + END { + print "showpage"; + print "%%EOF"; + } +' $@ Property changes on: Merge_dimPCBPS ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: PCB2HPGL =================================================================== --- PCB2HPGL (nonexistent) +++ PCB2HPGL (revision 1033) @@ -0,0 +1,147 @@ +#!/usr/bin/perl +# +# +# Der der Autor ist kein geringerer wie der Smilie +# Also Fragen zu Hpgl oder Plotter, +# möglicherweise kann ich ja helfen +# +# Also ganz einfach die Layer.Dateien mit diesen Program erzeugen +# mit "Program pcb-Datei" +# das ganze in einem Verzeichnis wo ihr auch schreibrechte habt +# und dann ganz einfach den gewünchten Layer auf den Plotter kopieren +# zBsp. so "cat Layer.1.jenachdem.hpgl > /dev/lp0 +# den Stift müßt ihr dem Plotter in die Hand geben +# und den Stiftrevolver entnehmen daß es eine Kollision giebt. + +if( $ARGV[0] ) +{ +} +else{print "use ".$0." [pcb-file] to convert to hpgl\n"; +exit;}; + +sub abschnitt + +{ +close(DATEI); +if(/Layer.(\d)\s.(\w+)../) +{ +$da="Layer.$1.$2.hpgl"; +} +open(DATEI , ">$da"); +} + + + +sub via + +{ + +open(DATE,">>Layer.Via.hpgl"); +if(/Via.(\S+)\s(\S+)\s(\S+)\s(\S+)/) +{ +print(DATE "PA".($1).",".($2).";CI".($4).";"); +} +close(DATE); +} +sub pin + +{ +open(DATE,">>Layer.Pin.hpgl"); +if(/\tPin.(\S+)\s(\S+)\s(\S+)\s(\S+)/) +{ +print(DATE "PA".($1).",".($2).";CI".($4).";"); +} +close(DATE); + +} + + + +sub text + +{ +open(DATE,">>Layer.Text.hpgl"); +if(/\tText.(\S+)\s(\S+)\s(\S+)\s(\S+)\s"(\S+)"/) +{ +if($3==0){$di=";DI0,1;";}; +if($3==1){$di=";DI1,0;";}; +print(DATE "PA".$1.",".$2.$di."SI".($4/450).",".($4/675).";LB".$5."\e;"); +} +close(DATE); + +} + + + +sub linie + +{ +if(/\tLine.(\S+)\s(\S+)\s(\S+)\s(\S+)/) +{ +print (DATEI "PU".($1).",".($2).";PD".($3).",".($4).";PU;"); +} +} + + + +sub arc + +{ +if(/\tArc.(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)/) +{ +if($6==90){$sin=1;$cos=0;} +if($6==-90){$sin=-1;$cos=0;} +if($6==0){$sin=0;$cos=1;} +if($6==180){$sin=0;$cos=-1;} +if($6==-180){$sin=0;$cos=-1;} +if($6==270){$sin=-1;$cos=0;} +if($6==-270){$sin=1;$cos=0;} +print (DATEI "PA".($1-($3*$cos)).",".($2+($3*$sin)).";PD;AA".($1).",".($2).",".($7*(-1)).";PU;"); +} +} + + + +sub polygon + +{ +if(/\t\t.(\S+)\s(\S+).\s.(\S+)\s(\S+).\s.(\S+)\s(\S+).\s.(\S+)\s(\S)./) +{ +print (DATEI "PA".$1.",".$2.";RA".$5.",".$6.";"); +} +} + +# ist noch nicht eingebunden. +#sub polygon + +#{ +#s/\t\t./PU/; +#s/\s/,/; +#while(/\)\s\(/) +#{s/\)\s\(/\;PD/;} +#while(/\S\s\S/) +#{s/\s/,/;} +#s/\)/\;PU\;/; +#print (DATEI $_); +#} + + +open(DATE,">Layer.Via.hpgl"); +close(DATE); +open(DATE,">Layer.Text.hpgl"); +print(DATE "DT\e;"); +close(DATE); +open(DATE,">Layer.Pin.hpgl"); +close(DATE); +while(<>) +{ +if(/\tPin/){&pin} +if(/Layer/){&abschnitt;} +if(/Via/){&via;} +if(/\tArc/){&arc;} +if(/\tLine/){ &linie;} +if(/\t\t/){&polygon;} +if(/\tText\(/){&text;} +} +close(DATEI); + Index: apctools.zip =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: apctools.zip =================================================================== --- apctools.zip (nonexistent) +++ apctools.zip (revision 1033) Property changes on: apctools.zip ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: gerbertotk.c =================================================================== --- gerbertotk.c (nonexistent) +++ gerbertotk.c (revision 1033) @@ -0,0 +1,259 @@ +/* + * COPYRIGHT + * + * gerbertotk, simple Gerber file to tcl/tk program converter + * Copyright (C) 1996 Albert John FitzPatrick III + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Albert John FitzPatrick III/ 8803 Humming Bird Lane/ Quinton, VA 23141/ + * USA. + * ajf_nylorac@acm.org + * + */ + +/* WARNING: This is an alpha version. Use it with many grains of salt. */ + +static char Copyright[] = "Copyright (C) 1996 Albert John FitzPatrick III"; + +/* + * Example Usage: + * cat *.gbr | gerbertotk | wish + */ + +#include +#include + +typedef long GerberValue; + +typedef struct { + int gc_inComment; + GerberValue gc_d; + GerberValue gc_x1; + GerberValue gc_y1; + GerberValue gc_x2; + GerberValue gc_y2; + GerberValue gc_i; + GerberValue gc_j; + } GerberContext; + +GerberContext gc; + +#define gbMaxX 10000L +#define gbMaxY 10000L +#define tkScale 4L +#define tkX(x) (800L * (x) * tkScale / gbMaxX) +#define tkY(y) ((600L * (gbMaxY - (y)) * tkScale / gbMaxY)) + + +do_cmd(GerberContext *gc, int cmd, char *buffer) +{ + GerberValue value = atol(buffer); + + switch (cmd) { + case 'G': + switch (value) { + case 4L: + gc->gc_inComment = 1; + break; + } + break; + case 'X': + gc->gc_x2 = value; + break; + case 'Y': + gc->gc_y2 = value; + break; + case 'I': + gc->gc_i = value; + break; + case 'J': + gc->gc_j = value; + break; + case 'D': + switch (value) { + case 1L: + /* Move with light on. */ + printf(".f.c create line %ld %ld %ld %ld\n", + (long) tkX(gc->gc_x1), + (long) tkY(gc->gc_y1), + (long) tkX(gc->gc_x2), + (long) tkY(gc->gc_y2) + ); + gc->gc_x1 = gc->gc_x2; + gc->gc_y1 = gc->gc_y2; + break; + case 2L: + /* Move with light off. */ + gc->gc_x1 = gc->gc_x2; + gc->gc_y1 = gc->gc_y2; + break; + case 3L: + /* Move with light off. Flash light on. Turn light off. */ + printf(".f.c create line %ld %ld %ld %ld\n", + (long) tkX(gc->gc_x2), + (long) tkY(gc->gc_y2), + (long) tkX(gc->gc_x2), + (long) tkY(gc->gc_y2) + ); + break; + default: + gc->gc_d = value; + break; + } + break; + case 'M': + break; + case '*': + gc->gc_inComment = 0; + break; + case '\0': + /* FIXME: what if missing on first time? + fprintf(stderr, "Missing Gerber command character.\n"); + */ + break; + } +} + + +main(int argc, char *argv[]) +{ + int ch; + int cmd; + char buffer[1024]; + char *bp; + + if (argc != 1) { + fprintf(stderr, "%s: %s\n", + argv[0], + Copyright + ); + fprintf(stderr, "%s: Usage: %s\n", + argv[0], + argv[0] + ); + exit(1); + } + + bp = buffer; + cmd = '\0'; + gc.gc_inComment = 0; + gc.gc_d = 0L; + gc.gc_x1 = 0L; + gc.gc_y1 = 0L; + gc.gc_x2 = 0L; + gc.gc_y2 = 0L; + gc.gc_i = 0L; + gc.gc_j = 0L; + + printf("button .exit \\\n"); + printf("\t-command exit \\\n"); + printf("\t-text Exit\n"); + printf("frame .f\n"); + printf("canvas .f.c \\\n"); + printf("\t-width 800 \\\n"); + printf("\t-height 600 \\\n"); + printf("\t-scrollregion { 0 0 10000 10000 } \\\n"); + printf("\t-xscroll { .f.h set } \\\n"); + printf("\t-yscroll { .f.v set }\n"); + printf("scrollbar .f.v \\\n"); + printf("\t-orient vertical \\\n"); + printf("\t-command { .f.c yview }\n"); + printf("scrollbar .f.h \\\n"); + printf("\t-orient horizontal \\\n"); + printf("\t-command { .f.c xview }\n"); + + printf("\n"); + printf("pack .exit .f \\\n"); + printf("\t-side top \\\n"); + printf("\t-expand yes \\\n"); + printf("\t-fill both\n"); + printf("pack .f.v \\\n"); + printf("\t-side right \\\n"); + printf("\t-fill y\n"); + printf("pack .f.h \\\n"); + printf("\t-side bottom \\\n"); + printf("\t-fill x\n"); + printf("pack .f.c \\\n"); + printf("\t-side left\n"); + + printf("\n"); + + while ((ch = getchar()) != EOF) { + if (gc.gc_inComment && ch != '*') + continue; + + switch (ch) { + case 'D': + case 'G': + case 'X': + case 'Y': + case 'I': + case 'J': + case 'M': + do_cmd(&gc, cmd, buffer); + cmd = ch; + bp = buffer; + break; + case '*': + /* FIXME: Handle other EOB characters. */ + if (gc.gc_inComment) + do_cmd(&gc, ch, buffer); + else + do_cmd(&gc, cmd, buffer); + cmd = '\0'; + bp = buffer; + break; + case '\r': + /* FIXME: only after EOB. */ + cmd = '\0'; + bp = buffer; + break; + case '\012': + /* FIXME: only after EOB. */ + cmd = '\0'; + bp = buffer; + break; + case '+': + case '-': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + *bp++ = (char) ch; + *bp = '\0'; + break; + default: + do_cmd(&gc, cmd, buffer); + cmd = '\0'; + bp = buffer; + if (! gc.gc_inComment) + fprintf(stderr, "Unknown Gerber command '%c' (%d).\n", + (char) ch, + ch + ); + break; + } + } + + exit(0); +} Property changes on: gerbertotk.c ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: gnet-pcbfwd.scm =================================================================== --- gnet-pcbfwd.scm (nonexistent) +++ gnet-pcbfwd.scm (revision 1033) @@ -0,0 +1,125 @@ +;;; gEDA - GPL Electronic Design Automation +;;; gnetlist - gEDA Netlist +;;; Copyright (C) 1998-2008 Ales Hvezda +;;; Copyright (C) 1998-2008 gEDA Contributors (see ChangeLog for details) +;;; +;;; 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +;; PCB forward annotation script + +(use-modules (ice-9 regex)) +(use-modules (ice-9 format)) + +;; This is a list of attributes which are propogated to the pcb +;; elements. Note that refdes, value, and footprint need not be +;; listed here. +(define pcbfwd:element-attrs + '("device" + "manufacturer" + "manufacturer_part_number" + "vendor" + "vendor_part_number" + )) + +(define (pcbfwd:quote-string s) + (string-append "\"" + (regexp-substitute/global #f "\"" s 'pre "\\\"" 'post) + "\"") + ) + +(define (pcbfwd:pinfmt pin) + (format #f "~a-~a" (car pin) (car (cdr pin))) + ) + +(define (pcbfwd:each-pin net pins port) + (if (not (null? pins)) + (let ((pin (car pins))) + (format port "Netlist(Add,~a,~a)~%" net (pcbfwd:pinfmt pin)) + (pcbfwd:each-pin net (cdr pins) port)))) + +(define (pcbfwd:each-net netnames port) + (if (not (null? netnames)) + (let ((netname (car netnames))) + (pcbfwd:each-pin netname (gnetlist:get-all-connections netname) port) + (pcbfwd:each-net (cdr netnames) port)))) + +(define (pcbfwd:each-attr refdes attrs port) + (if (not (null? attrs)) + (let ((attr (car attrs))) + (format port "ElementSetAttr(~a,~a,~a)~%" + (pcbfwd:quote-string refdes) + (pcbfwd:quote-string attr) + (pcbfwd:quote-string (gnetlist:get-package-attribute refdes attr))) + (pcbfwd:each-attr refdes (cdr attrs) port)))) + +;; write out the pins for a particular component +(define pcbfwd:component_pins + (lambda (port package pins) + (if (and (not (null? package)) (not (null? pins))) + (begin + (let ( + (pin (car pins)) + (label #f) + (pinnum #f) + ) + (display "ChangePinName(" port) + (display (pcbfwd:quote-string package) port) + (display ", " port) + + (set! pinnum (gnetlist:get-attribute-by-pinnumber package pin "pinnumber")) + + (display pinnum port) + (display ", " port) + + (set! label (gnetlist:get-attribute-by-pinnumber package pin "pinlabel")) + (if (string=? label "unknown") + (set! label pinnum) + ) + (display (pcbfwd:quote-string label) port) + (display ")\n" port) + ) + (pcbfwd:component_pins port package (cdr pins)) + ) + ) + ) + ) + +(define (pcbfwd:each-element elements port) + (if (not (null? elements)) + (let* ((refdes (car elements)) + (value (gnetlist:get-package-attribute refdes "value")) + (footprint (gnetlist:get-package-attribute refdes "footprint")) + ) + + (format port "ElementList(Need,~a,~a,~a)~%" + (pcbfwd:quote-string refdes) + (pcbfwd:quote-string footprint) + (pcbfwd:quote-string value)) + (pcbfwd:each-attr refdes pcbfwd:element-attrs port) + (pcbfwd:component_pins port refdes (gnetlist:get-pins refdes)) + + (pcbfwd:each-element (cdr elements) port)))) + +(define (pcbfwd output-filename) + (let ((port (open-output-file output-filename))) + (format port "Netlist(Freeze)\n") + (format port "Netlist(Clear)\n") + (pcbfwd:each-net (gnetlist:get-all-unique-nets "dummy") port) + (format port "Netlist(Sort)\n") + (format port "Netlist(Thaw)\n") + (format port "ElementList(Start)\n") + (pcbfwd:each-element packages port) + (format port "ElementList(Done)\n") + (close-output-port port))) Index: pcb2ncap.tgz =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: pcb2ncap.tgz =================================================================== --- pcb2ncap.tgz (nonexistent) +++ pcb2ncap.tgz (revision 1033) Property changes on: pcb2ncap.tgz ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tgo2pcb.tcl =================================================================== --- tgo2pcb.tcl (nonexistent) +++ tgo2pcb.tcl (revision 1033) @@ -0,0 +1,96 @@ +#! /usr/bin/tclsh +# +# tango to PCB netlist converter +# usage: tgo2pcb input > output +# +# Copyright 1998, Ingo Cyliax, Derivation Systems, Inc. +# Email: cyliax@derivation.com +# + +set nets() "" + +# +# read a tango netlist and extract the essentials we need, this +# has been tested with OrCad's tango netlister +# +proc rdtgo { file } { + set fd [open $file r] + set line "" + set args "" + set ln 0 + set lch "" + set net "" + set pin "" + set ref "" + global nets cnvt + while { 1 } { + set n [gets $fd line] + if { $n == -1 } { break } + incr ln 1 + + set ch [string index $line 0] + + if { $ch == "\["} { + set lch $ch + set ln 0 + } + if { $ch == "]"} { + set lch $ch + set ln 0 + } + if { $ch == "("} { + set lch $ch + set ln 0 + } + if { $ch == ")"} { + set lch $ch + set ln 0 + } + if { $ch != "(" && $lch == "(" && $ln == "1"} { + set net $line + } + if { $ch != "(" && $lch == "(" && $ln != "1"} { + set xx [split $line ,] + set pin [lindex $xx 1] + set ref [lindex $xx 0] + if { $cnvt($pin) != "" } { + set pin $cnvt($pin) + } + lappend nets($net) "$ref-$pin" + } + } + close $fd +} + +# +# write out a PCB netlist +# +proc wrpcb { } { + global nets + foreach i [array names nets] { + if { $nets($i) != "" } { + puts "$i $nets($i)" + } + } +} + +# +# pins 1-99 convert to 1-99, all input pins are converted in this array +# +set pin 1 +for { set i 1 } { $i <= 99 } { incr i } { + set cnvt($i) $pin + incr pin +} + +# +# read the input file and convert to internal netlist +# +rdtgo [lindex $argv 0] + +# +# convert and write to output +# +wrpcb + +exit Property changes on: tgo2pcb.tcl ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property