Subversion Repositories wimsdev

Rev

Rev 20 | Go to most recent revision | 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 ',' ' '`
33
 
34
mkdir -p $outdir
35
for c in $complist; do
3871 kbelabas 36
 rm -f $outdir/$c-h.gif $outdir/$c-v.gif $outdir/${c}R-h.gif $outdir/${c}R-v.gif
20 reyssat 37
 export comp_$c
38
 draw=`sh -c "echo \"\\$comp_$c\""`
39
 $flydraw <<@
40
$header
41
$draw
42
output $outdir/$c-h.gif
43
@
44
 case $c in
45
  acsrc|meter)
46
   ln -s $c-h.gif $outdir/$c-v.gif
47
   ln -s $c-h.gif $outdir/${c}R-h.gif
48
   ln -s $c-h.gif $outdir/${c}R-v.gif
49
   ;;
50
  cap|lamp|res|term2|wire)
51
   $flydraw <<@
52
$header
53
affine 0,-1,1,0,0,0
54
$draw
55
output $outdir/$c-v.gif
56
@
57
   ln -s $c-h.gif $outdir/${c}R-h.gif
58
   ln -s $c-v.gif $outdir/${c}R-v.gif
59
   ;;
60
  *)
61
   $flydraw <<@
62
$header
63
affine 0,-1,1,0,0,0
64
$draw
65
output $outdir/$c-v.gif
66
@
67
   $flydraw <<@
68
$header
69
affine -1,0,0,-1,0,0
70
$draw
71
output $outdir/${c}R-h.gif
72
@
73
   $flydraw <<@
74
$header
75
affine 0,1,-1,0,0,0
76
$draw
77
output $outdir/${c}R-v.gif
78
@
79
  ;;
80
 esac
81
done
82