Index: param_all.sh =================================================================== --- param_all.sh (revision 32400) +++ param_all.sh (nonexistent) @@ -1,105 +0,0 @@ -#!/bin/sh - -# Generate and render parametric footprints with variations of parameters -# for testing - -fp="$1" -shift 1 -args="$@" - -$fp --help | awk -F "[: \t]+" -v fp=$fp -v "args=$args" ' -BEGIN { order = 0 } - -/#@@param/ { PARAMS[$2]++ } - -/#@@param/ { ORDER[order++] = $2 } -/#@@dim/ { TYPE[$2] = "dim" } - -/#@@enum/ { - TYPE[$2] = "enum" - if (ENUM[$2] == "") - ENUM[$2] = $3 - else - ENUM[$2] = ENUM[$2] "," $3 -} - -function build(param, value, PV,p,s,cmd,fn) -{ - for(p in ARG) - PV[p] = ARG[p] - - if (param != "") - PV[param] = value - - for(o = 0; o < order; o++) { - p = ORDER[o] - if ((p == "") || !(p in PV)) - continue - if (s == "") - s = p "=" PV[p] - else - s = s "," p "=" PV[p] - } - - - fn = s - gsub("[^A-Za-z0-9-]", "_", fn) - fn = fp "_" fn ".lht" - system(fp " " q s q ">" fn) - - close(cmd) - cmd="pcb-rnd --hid batch" - print "LoadFrom(Layout, " fn ")" | cmd - print "autocrop" | cmd - print "export(png, --dpi, 1200)" | cmd - close(cmd) -} - -function permute(param ,n,v,E) -{ - if (TYPE[param] == "enum") { - v = split(ENUM[param], E, ",") - for(n = 1; n <= v; n++) { - build(param, E[n]) - } - } - if (TYPE[param] == "dim") { - if (param in ARG) { - build(param, ARG[param]) - build(param, ARG[param]*2) - build(param, ARG[param]*4) - } - else { - if ((param ~ "clearance") || (param ~ "mask") || (param ~ "paste")) { - # skip - } - else if ((param ~ "drill") || (param ~ "thickness")) { - build(param, "0.2mm") - build(param, "0.4mm") - build(param, "0.8mm") - } - else { - build(param, "2mm") - build(param, "4mm") - build(param, "8mm") - } - } - } -} - -END { - v = split(args, A, ",[ \t]*") - for(n = 1; n <= v; n++) { - split(A[n], B, "[=]") - ARG[B[1]] = B[2] - } - for(p in PARAMS) - permute(p) -} - -' - - - - - Property changes on: param_all.sh ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: font2c.sh =================================================================== --- font2c.sh (revision 32400) +++ font2c.sh (nonexistent) @@ -1,96 +0,0 @@ -#!/bin/sh -# font2c - convert a pcb font to simplified embedded font structs for pcb-rnd -# Copyright (C) 2016 Tibor 'Igor2' Palinkas -# -# 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. -# -# http://repo.hu/projects/pcb-rnd - -awk ' - -BEGIN { - minx = 100000 - miny = 100000 - maxx = 0 - maxy = 0 - print "/* This file is autogenerated by font2c.sh - DO NOT EDIT */" - print "" - print "/* Internal copy of the default font; used when no font file is found */" - print "" -} - -function bump(x, y) -{ - if (x < minx) minx = x - if (y < miny) miny = y - if (x > maxx) maxx = x - if (y > maxy) maxy = y -} - -/Symbol[(]/ { - sym=substr($0, 9, 1) - ADV[sym]=int(substr($0, 11, length($0))) - NLINE[sym] = 0 -} - -/SymbolLine[(]/ { - sub("[ \t]*SymbolLine[(]", "", $0) - X1[sym, NLINE[sym]] = int($1) - Y1[sym, NLINE[sym]] = int($2) - X2[sym, NLINE[sym]] = int($3) - Y2[sym, NLINE[sym]] = int($4) - TH[sym, NLINE[sym]] = int($5) - bump(int($1), int($2)) - bump(int($3), int($4)) - NLINE[sym]++ -} - -END { - for(n = 0; n < 128; n++) { - c = sprintf("%c", n) - if (c in ADV) { - if ((n > 32) && !(c ~ "[{}()]")) - annot = " /* " c " */" - else - annot = "" - print "static embf_line_t embf_line_" n "[] = {" annot - for(l = 0; l < NLINE[c]; l++) - print " {" X1[c, l] ", " Y1[c, l] ",\t\t" X2[c, l] ", " Y2[c, l] ",\t\t" TH[c, l] "}" ((l < NLINE[c]-1) ? "," : "") - if (NLINE[c] == 0) - print " {0,0,0,0}" - print "};" - }; - } - - print "/***************************************************************/" - print "static int embf_minx = " minx ";" - print "static int embf_miny = " miny ";" - print "static int embf_maxx = " maxx ";" - print "static int embf_maxy = " maxy ";" - - print "static embf_font_t embf_font[] = {" - for(n = 0; n < 128; n++) { - c = sprintf("%c", n) - comma = ((n < 127) ? "," : "") - if (c in ADV) { - print " {" ADV[c] ", embf_line_" n ", " NLINE[c] "}" comma - } - else { - print " {0, NULL, 0}" comma - } - } - print "};" -} -' Property changes on: font2c.sh ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: pcb-rtrip =================================================================== --- pcb-rtrip (revision 32400) +++ pcb-rtrip (nonexistent) @@ -1,122 +0,0 @@ -#!/bin/sh -# pcb-rtrip - load-save-load round trip tester -# Copyright (C) 2016 Tibor 'Igor2' Palinkas -# -# 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. -# -# http://repo.hu/projects/pcb-rnd - -pcb_rtrip() -{ - rm -f "$fn.new.pcb" - - if test ! -z "$remtgt" - then - rm -f "$fn.trgt.$ext" - fi - -echo ' -SaveTo(LayoutAs, '$fn'.orig.pcb, pcb) -LoadFrom(Layout, '$fn'.orig.pcb) -SaveTo(LayoutAs, '$fn'.trgt.'$ext', '$fmt') -LoadFrom(Layout, '$fn'.trgt.'$ext', '$fmt') -SaveTo(LayoutAs, '$fn'.new.pcb, pcb) -' | $valg $pcb_rnd_bin --gui batch "$fn" - - if test -f "$fn.orig.pcb" -a -f "$fn.new.pcb" - then - diff -u "$fn.orig.pcb" "$fn.new.pcb" - else - if test ! -f "$fn.orig.pcb" - then - echo "Failed to load $fn" - else - echo "Failed to load $fn.trgt.$ext" - fi - fi -} - -set_ext() -{ - case "$fmt" - in - lihata) ext="lht";; - pcb) ext="pcb";; - *) ext="$fmt";; - esac -} - -help() -{ - echo "pcb-rtrip - load-save-load round trip tester" - echo "" - echo "Load a board, save it (*.orig.pcb), load it, save it in the target" - echo "format (*.trgt.*), load it again and save it (*.new.pcb). Calculate" - echo "the diff between *.orig.pcb and *.new.pcb; if load-save-load round trip" - echo "of a target format is lossles, the diff is empty." - echo "" - echo "Invocation: $0 [-f fmt] [input.pcb]" - echo "Switches:" - echo " -f fmt format (e.g. lihata)" - echo " -r remove target before overwrite" - echo " -b bin run bin instead of \"pcb-rnd\"" - echo " -V wrap the binary in valgrind" - echo "" -} - - -# defaults -fmt="lihata" -fn="" -remtgt="" -if test -z "$pcb_rnd_bin" -then - pcb_rnd_bin="pcb-rnd" -fi -valg="" - -while test $# -gt 0 -do - case "$1" - in - --help) help "$0"; exit 0;; - -f) fmt=$2; shift 1;; - -b) pcb_rnd_bin=$2; shift 1;; - -V) valg="valgrind -v";; - -r) remtgt=1;; - *) - if test -z "$fn" - then - fn="$1" - else - echo "unknown switch $1; try --help" >&2 - exit 1 - fi - ;; - -*) echo "unknown switch $1; try --help" >&2; exit 1;; - esac - shift 1 -done - -if test -z "$fn" -then - echo "no fn" - exit 1 - fn="pcb-rtrip.pcb" - cat >$fn -fi - -set_ext -pcb_rtrip Property changes on: pcb-rtrip ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property