Rev 5736 | Rev 15582 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
!if $wims_read_parm!=slib_header
!goto proc
!endif
slib_author=Gang, XIAO
slib_example=5/br2out,,,acsrc,diode,cap,res,chas\
5/br2out,,,acsrc,diode,cap,res,chas,html
!exit
:proc
!reset slib_option
!distribute items $wims_read_parm into slib_type,slib_sf,slib_Color
slib_c=!char 1 of $slib_type
!if $slib_c isin 123456789
slib_prefix=data/circuits
!else
slib_prefix=
!endif
slib_out=
!default slib_Color=black
slib_comp=!item 4 to -1 of $wims_read_parm
!if html isitemof $slib_comp
slib_option=html
slib_comp=!replace internal ,html by in $slib_comp
slib_comp=!replace internal , html by in $slib_comp
!endif
!bound slib_sf between integer 5 and 100 default 20
slib_rec=$slib_prefix/$slib_type.data
slib_wiring=!record 4 of $slib_rec
slib_dots=!record 5 of $slib_rec
slib_test=!record 3 of $slib_rec
!if $slib_test=
!exit
!endif
slib_range=!record 2 of $slib_rec
slib_lwid=1
!if $slib_sf>20
!advance slib_lwid
!if $slib_sf>30
!advance slib_lwid
!endif
!endif
slib_dwid=$[floor(4+$slib_sf/4)]
slib_textsize=medium
!if $slib_sf>15
!if $slib_sf>20
slib_textsize=huge
!else
slib_textsize=large
!endif
!else
!if $slib_sf<12
!if $slib_sf<5
slib_textsize=tiny
!else
slib_textsize=small
!endif
!endif
!endif
slib_wiring=!replace internal _dot_ by $slib_dwid in $slib_wiring
!if $slib_comp!=
!read slib/circuits/drawcomp $slib_type,$slib_dwid,$slib_Color,$slib_textsize,$slib_comp
!endif
slib_out=!replace internal _color_ by $slib_Color in \
new $[$slib_sf*$(slib_range[1])],$[$slib_sf*$(slib_range[2])]\
xrange 0,$(slib_range[1])\
yrange 0,$(slib_range[2])\
transparent white\
linewidth $[rint(0.8*$slib_dwid)]\
points _color_,$slib_dots\
linewidth $slib_lwid\
$slib_wiring\
$slib_out
!if url isitemof $slib_option or html isitemof $slib_option
!insdraw $slib_out
slib_out=$ins_url
!if html iswordof $slib_option
slib_out=<img src="$ins_url" alt=""/>
!else
slib_out=$slib_out,$insdraw_size
!endif
!endif