Rev 3871 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | #! /bin/sh |
2 | # |
||
3 | # Generate component symbol images for drag-and-drop uses. |
||
4 | # |
||
5 | # For the time being the only available size factor is 20. |
||
6 | |||
7 | cd `dirname $0` |
||
8 | home=`pwd` |
||
9 | whome=../../../.. |
||
10 | |||
11 | flydraw=$whome/other/bin/flydraw |
||
12 | datafile=compdata |
||
13 | outdir=$whome/public_html/gifs/symbols/20 |
||
14 | |||
15 | header="new 41,41 |
||
16 | xrange -1,1.05 |
||
17 | yrange -1.05,1 |
||
18 | trange 0,1 |
||
19 | fill 0,0,white |
||
20 | transparent white |
||
21 | linewidth 1 |
||
22 | " |
||
23 | |||
24 | if [ ! -s $datafile.for_sh ] || [ $datafile -nt $datafile.for_sh ] || [ mksymbols -nt $datafile ]; then |
||
25 | awk 'BEGIN {b=0}; |
||
26 | /=/ {b=1}; |
||
27 | {if(match($0,/\\$/) || b==0) print; else {print $0"\""; b=0}};' $datafile |\ |
||
28 | sed 's/=/="/;s/\\//;s/_color_/black/g;s/\$slib_dotwidth/8/g;s/\$slib_textsize/large/g' >$datafile.for_sh |
||
29 | . ./$datafile.for_sh |
||
30 | fi |
||
31 | |||
32 | complist=`echo $comp_all | tr ',' ' '` |
||
9966 | bpr | 33 | ## doesnot work : copy the list in compdata in the corresponding line below |
34 | ##compnorotate=`echo $comp_norotate | tr ' ' '|'` |
||
20 | reyssat | 35 | |
9966 | bpr | 36 | |
20 | reyssat | 37 | mkdir -p $outdir |
38 | for c in $complist; do |
||
3871 | kbelabas | 39 | rm -f $outdir/$c-h.gif $outdir/$c-v.gif $outdir/${c}R-h.gif $outdir/${c}R-v.gif |
20 | reyssat | 40 | export comp_$c |
41 | draw=`sh -c "echo \"\\$comp_$c\""` |
||
42 | $flydraw <<@ |
||
43 | $header |
||
44 | $draw |
||
45 | output $outdir/$c-h.gif |
||
46 | @ |
||
47 | case $c in |
||
9966 | bpr | 48 | acsrc|ammeter|ammeterN|lamp|lampN|meter|motor|num|voltmeter|voltmeterN) |
20 | reyssat | 49 | ln -s $c-h.gif $outdir/$c-v.gif |
50 | ln -s $c-h.gif $outdir/${c}R-h.gif |
||
51 | ln -s $c-h.gif $outdir/${c}R-v.gif |
||
52 | ;; |
||
53 | cap|lamp|res|term2|wire) |
||
54 | $flydraw <<@ |
||
55 | $header |
||
56 | affine 0,-1,1,0,0,0 |
||
57 | $draw |
||
58 | output $outdir/$c-v.gif |
||
59 | @ |
||
60 | ln -s $c-h.gif $outdir/${c}R-h.gif |
||
61 | ln -s $c-v.gif $outdir/${c}R-v.gif |
||
62 | ;; |
||
63 | *) |
||
64 | $flydraw <<@ |
||
65 | $header |
||
66 | affine 0,-1,1,0,0,0 |
||
67 | $draw |
||
68 | output $outdir/$c-v.gif |
||
69 | @ |
||
70 | $flydraw <<@ |
||
71 | $header |
||
72 | affine -1,0,0,-1,0,0 |
||
73 | $draw |
||
74 | output $outdir/${c}R-h.gif |
||
75 | @ |
||
76 | $flydraw <<@ |
||
77 | $header |
||
78 | affine 0,1,-1,0,0,0 |
||
79 | $draw |
||
80 | output $outdir/${c}R-v.gif |
||
81 | @ |
||
82 | ;; |
||
83 | esac |
||
84 | done |
||
85 |