2 # By Braddock Gaskill (braddock@braddock.com), August 2004. This
3 # software is hereby declared to be in the public domain by Braddock
6 if [ -z "$FNAME" ]; then
11 This script will read a gschem schematic and attempt to
12 extract the relative positions of the components in the schematic,
13 and generate corresponding MOVE instructions for Eagle. You will
14 likely have to adjust XOFFSET, YOFFSET, XSCAL, and YSCALE at the
15 top of the script to obtain usable positions.
17 By Braddock Gaskill (braddock@braddock.com), August 2004
30 mkdir
-m 0700 -p $tmpdir
32 if test $rc -ne 0 ; then
35 $0: ERROR -- Failed to create $tmpdir with 0700 permissions. mkdir returned $rc.
37 Make sure that $tmpdir does not already exist and that you have permissions to
44 grep -B1 refdes
= "$FNAME" |
sed 's/=/ /' | cut
-d" " -f2,3 |
grep -v '^--' >${tmpf}
48 # the directory on the client to backup
49 X
=`echo $REPLY | cut -d' ' -f1`
50 Y
=`echo $REPLY | cut -d' ' -f2`
53 X
=`echo "scale=5; ($X - $XOFFSET) / $XSCALE" |bc`
54 Y
=`echo "scale=5; ($Y - $YOFFSET) / $YSCALE" |bc`
55 echo "MOVE '$PART' ($X $Y);"