IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2010-08-30 08:14:07 (13 years 6 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | 337f13a0df4fdcf621e5d9137bf7b1655bd7e993 |
Message: | Sheet names now link to the sheet's PDF. - scripts/normalizeschps: by default, don't change the linewidth - scripts/schhist2web: cache historical Postscript files in directories ps_* - scripts/schps2pdf: new script to convert eeschema Postscript to PDF - scripts/schhist2web: link the file name in the title to the curent PDF of the respective sheet - scripts/Makefile: changed lazy wildcard thum* to thumb_* and diff* to diff_* - scripts/Makefile: upload also pdf_* |
Files: |
scripts/Makefile (1 diff) scripts/normalizeschps (2 diffs) scripts/schhist2web (3 diffs) scripts/schps2pdf (1 diff) |
Change Details
scripts/Makefile | ||
---|---|---|
1 | 1 | SHELL = /bin/bash |
2 | 2 | |
3 | UPLOAD = {index.html,unchanged.png,thum*,diff*} | |
3 | UPLOAD = {index.html,unchanged.png,thumb_*,diff_*,pdf_*} | |
4 | 4 | DEST = werner@host:/home/httpd/almesberger/misc/ben/ |
5 | 5 | RSYNC = rsync -a --progress |
6 | 6 |
scripts/normalizeschps | ||
---|---|---|
12 | 12 | # |
13 | 13 | |
14 | 14 | |
15 | LINEWIDTH=120 | |
16 | ||
17 | ||
18 | 15 | usage() |
19 | 16 | { |
20 | 17 | cat <<EOF 1>&2 |
21 | 18 | usage: $0 [options] [in.ps [out.ps]] |
22 | 19 | |
23 | -w points Postscript line width (default: $LINEWIDTH) | |
20 | -w points Postscript line width (default: use the original) | |
24 | 21 | EOF |
25 | 22 | exit 1 |
26 | 23 | } |
27 | 24 | |
28 | 25 | |
26 | width= | |
29 | 27 | while true; do |
30 | 28 | case "$1" in |
31 | 29 | -w) [ -z "$2" ] && usage |
32 | LINEWIDTH="$2" | |
30 | width="$2" | |
33 | 31 | shift 2;; |
34 | 32 | -*) |
35 | 33 | usage;; |
... | ... | |
45 | 43 | sed ' |
46 | 44 | 1c%!PS-Adobe-3.0\ |
47 | 45 | currentdict /DidNormalize known not { \ |
48 | /setlinewidth { '$LINEWIDTH' 2 copy lt { exch } if pop \ | |
49 | setlinewidth } bind def \ | |
46 | '"`[ -z \"$width\" ] || | |
47 | echo \"/setlinewidth { $width 2 copy lt { exch } if pop \ | |
48 | setlinewidth } bind def \"`"' \ | |
50 | 49 | /rectfill { rectstroke } bind def \ |
51 | 50 | /DidNormalize true def \ |
52 | 51 | } if \ |
scripts/schhist2web | ||
---|---|---|
193 | 193 | tmp=`pwd`/_schhist2web |
194 | 194 | trap "rm -rf \"$cache/ppm_$n\" \"$cache/fat_$n\" \"$tmp\"" 0 |
195 | 195 | if [ ! -d "$cache/ppm_$n" ]; then |
196 | rm -rf "$cache/ppm_$n" "$cache/fat_$n" | |
197 | mkdir "$cache/ppm_$n" "$cache/fat_$n" | |
196 | rm -rf "$cache/ppm_$n" "$cache/fat_$n" "$cache/ps_$n" | |
197 | mkdir "$cache/ppm_$n" "$cache/fat_$n" "$cache/ps_$n" | |
198 | 198 | # |
199 | 199 | # potential optimization here: remember Postscript files from previous |
200 | 200 | # run (or their md5sum) and check if they have changed. If not, skip |
... | ... | |
204 | 204 | gitsch2ps $sanitize "$dir" "$schname" $n "$tmp" || exit |
205 | 205 | for m in "$tmp"/*.ps; do |
206 | 206 | ppm="$cache/ppm_$n/`basename "$m" .ps`.ppm" |
207 | normalizeschps "$m" | schps2ppm - "$ppm" || exit | |
207 | normalizeschps -w 120 "$m" | schps2ppm - "$ppm" || exit | |
208 | 208 | ppm="$cache/fat_$n/`basename "$m" .ps`.ppm" |
209 | 209 | normalizeschps -w 500 "$m" | schps2ppm - "$ppm" || exit |
210 | ps="$cache/ps_$n/`basename "$m"`" | |
211 | normalizeschps "$m" "$ps" || exit | |
210 | 212 | done |
211 | 213 | rm -rf "$tmp" |
212 | 214 | fi |
... | ... | |
257 | 259 | <TR bgcolor="$FNAME_COLOR"> |
258 | 260 | EOF |
259 | 261 | while read m; do |
260 | echo "<TD><B>$m</B>" | |
262 | mkdir -p "$out/pdf_$head" | |
263 | schps2pdf -o "$out/pdf_$head/$m.pdf" "$cache/ps_$head/$m.ps" || exit | |
264 | echo "<TD><A href="pdf_$head/$m.pdf"><B>$m</B></A>" | |
261 | 265 | done < <(ls -1 "$out/names") |
262 | 266 | } >"$index" |
263 | 267 |
scripts/schps2pdf | ||
---|---|---|
1 | #!/bin/bash | |
2 | # | |
3 | # schps2pdf - Generate PDF files from Eeschema Postscript | |
4 | # | |
5 | # Written 2010 by Werner Almesberger | |
6 | # Copyright 2010 Werner Almesberger | |
7 | # | |
8 | # This program is free software; you can redistribute it and/or modify | |
9 | # it under the terms of the GNU General Public License as published by | |
10 | # the Free Software Foundation; either version 2 of the License, or | |
11 | # (at your option) any later version. | |
12 | # | |
13 | ||
14 | ||
15 | usage() | |
16 | { | |
17 | cat <<EOF 1>&2 | |
18 | usage: $0 [options] [-o file.pdf] [file.ps ...] | |
19 | ||
20 | -t prefix make a table of content. Remove prefix from file names. | |
21 | EOF | |
22 | exit 1 | |
23 | } | |
24 | ||
25 | ||
26 | toc=false | |
27 | out=- | |
28 | while true; do | |
29 | case "$1" in | |
30 | -o) [ -z "$2" ] && usage | |
31 | out=$2 | |
32 | shift 2;; | |
33 | -t) [ -z "$2" ] && usage | |
34 | toc=true | |
35 | prefix="$1" | |
36 | shift 2;; | |
37 | -*) | |
38 | usage;; | |
39 | *) | |
40 | break;; | |
41 | esac | |
42 | done | |
43 | ||
44 | in=${1:--} | |
45 | shift | |
46 | ||
47 | cat "$in" | | |
48 | eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=\""$out\"" -f \ | |
49 | `for n in "$in" "$@"; do \ | |
50 | name=\`basename "$n" .ps\` \ | |
51 | echo "<($toc && echo '[ /Title (${name#$prefix}) /OUT pdfmark'; | |
52 | cat \"$n\";)"; done` |