学写封边脚本----片段,大家看看
###########################################################################add sypad
foreach i (`echo $gROWrow`)
if ( $gROWcontext[$i] == board && $gROWlayer_type[$i] != drill && $gROWlayer_type[$i] != rout ) then
COM affected_layer,name=$gROWname[$i],mode=single,affected=yes
COM add_pad,attributes=no,x=$syp1x,y=$syp1y,symbol=sypad,polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$syp2x,y=$syp2y,symbol=sypad,polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$syp3x,y=$syp3y,symbol=sypad,polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$syp4x,y=$syp4y,symbol=sypad,polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$syp5x,y=$syp5y,symbol=sypad,polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM affected_layer,mode=all,affected=no
COM clear_layers
endif
end
#################################################################################add fn
foreach i (`echo $gROWrow`)
if ( $gROWcontext[$i] == board && $gROWlayer_type[$i] != drill && $gROWlayer_type[$i] != rout ) then
switch ($gROWside[$i])
case top:
set mirr = no
set fnx = `echo "scale=10;$gSR_LIMITSxmin" | bc`
set fny = `echo "scale=10;$gSR_LIMITSymin -0.25" | bc`
breaksw
case bottom:
set mirr = yes
set fnx = `echo "scale=10;$gSR_LIMITSxmin + 1.6" | bc`
set fny = `echo "scale=10;$gSR_LIMITSymin -0.25" | bc`
breaksw
endsw
set filename = `echo F/Njob $gROWname[$i] $usename '8888' | tr '[a-z]' '[A-Z]'`
COM affected_layer,name=$gROWname[$i],mode=single,affected=yes
COM add_text,attributes=no,type=string,x=$fnx,y=$fny,\
text=$filename ,x_size=0.07,y_size=0.1,w_factor=0.8333333135,\
polarity=positive,angle=0,mirror=$mirr,fontname=standard,bar_type=UPC39,\
bar_char_set=full_ascii,bar_checksum=no,bar_background=yes,bar_add_string=yes,\
bar_add_string_pos=top,bar_width=0.008,bar_height=0.2,ver=1
COM affected_layer,mode=all,affected=no
COM clear_layers
endif
end
#################################################################################fillcu
foreach i ($gROWrow)
if ( $gROWlayer_type[$i] == signal && $gROWcontext[$i] == board ) then
set fillculayer = $gROWname[$i]
COM affected_layer,mode=all,affected=no
COM clear_layers
COM affected_layer,name=$fillculayer,mode=single,affected=yes
COM sr_fill,polarity=positive,step_margin_x=-0.393,step_margin_y=-0.393,\
step_max_dist_x=10,step_max_dist_y=10,sr_margin_x=0.1181,sr_margin_y=0.1181,\
sr_max_dist_x=0,sr_max_dist_y=0,nest_sr=yes,consider_feat=yes,\
feat_margin=0.01,consider_drill=no,drill_margin=0,consider_rout=no,\
dest=affected_layers,layer=,attributes=no
endif
end
COM affected_layer,mode=all,affected=no
COM clear_layers
我这里有澳宝的人写的封边程序2000多行,目前我还不行学习中
好东西
用WHILE语句功能要强大些
我好像有点看不明白呀,哈哈
是抄的吧,本人现在也正在学习脚本,以上的代码应为从云鹏为新达写的脚本中剪缉出来的,甚至连替换变量的名字都没变,而且SP系列变量的定义部分也没有复制过来。
怎么下不了啊,哪位大佬告诉我怎么下载?
XZHH426@163.COM
抄的?
那个地方你看不明白偶说给你听啊!鄙视你的为人,说偶抄的哪个!
以下是这个脚本的前半部分,该不会说这也是你写的吧
###########################################################gui
set GUI_CMD = G:/tmp/gui_cmd.$$
set GUI_RESP = G:/tmp/gui_resp.$$
set IFILE = G:/tmp/do_info.$$
alias GUI_OUT 'echo \!:* >> $GUI_CMD'
alias GUI_EXE 'G:/genesis/e91/all/gui $GUI_CMD > $GUI_RESP; source $GUI_RESP; rm $GUI_CMD; rm $GUI_RESP'
GUI_OUT WIN 200 200
GUI_OUT TEXT usename 5 Name
GUI_OUT RADIO st SurfaceTechnics H 1 000099
GUI_OUT NotHals
GUI_OUT Hals
GUI_OUT END
GUI_OUT LABEL 'Pls input the size'
GUI_OUT FORM
GUI_OUT TEXT px 10 PX:
GUI_OUT TEXT py 10 PY:
GUI_OUT LABEL ' Unit:INCH'
GUI_OUT ENDFORM
GUI_OUT RADIO quit Quit H 1 990000
GUI_OUT Continue
GUI_OUT Quit
GUI_OUT END
GUI_EXE
##########################################################################panle
COM sr_auto,step=pcb,num_mode=multiple,xmin=0,ymin=0,width=$px,\
height=$py,panel_margin=0,step_margin=0.0787401575,gold_plate=no,\
gold_side=right,orientation=horizontal,evaluate=no,active_margins=yes,\
top_active=0.511811,bottom_active=0.511811,left_active=0.511811,\
right_active=0.511811,step_xy_margin=no,step_margin_x=0.0787401575,\
step_margin_y=0.0787401575
COM set_attribute,type=step,job=$job,name1=$step,name2=,name3=,\
attribute=.pnl_class,value=,units=inch
COM set_attribute,type=step,job=$job,name1=$step,name2=,name3=,\
attribute=.pnl_pcb,value=pcb,units=inch
###########################################################################info
COM info,out_file=G:/tmp/wlayer,write_mode=replace,\
args=-t layer -e $JOB/$STEP/drl-2 -d exists
source G:/tmp/wlayer
COM info,out_file=G:/tmp/wstep,write_mode=replace,\
args=-t step -e $JOB/$step
source G:/tmp/wstep
COM info,out_file=G:/tmp/wdrl,write_mode=replace,\
args=-t layer -e $JOB/pcb/drl
source G:/tmp/wdrl
COM info,out_file=G:/tmp/wmatrix,write_mode=replace,\
args=-t matrix -e $JOB/matrix
source G:/tmp/wmatrix
#########################################################################add drill
COM affected_layer,mode=all,affected=no
COM clear_layers
COM affected_layer,name=drl,mode=single,affected=yes
set t=-1
set addyks = `echo "scale=10;$gSR_LIMITSymin" | bc`
foreach i (`echo $gTOOLdrill_size`)
@ t ++
set addx = `echo "scale=10;$gSR_LIMITSxmax + 0.196850" | bc`
set addy = `echo "scale=10;$addyks + $i/1000 + 0.078" | bc`
set addyks = $addy
COM add_pad,attributes=no,x=$addx,y=$addy,symbol=r10,\
polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
end
set wky = `echo "scale=10;$gSR_LIMITSymax + 0.11811" | bc`
set syp1x = `echo "scale=10;$gSR_LIMITSxmax + 0.236220" | bc`
set syp1y = `echo "scale=10;$gSR_LIMITSymax + 0.236220" | bc`
set syp2x = `echo "scale=10;$gSR_LIMITSxmax + 0.236220" | bc`
set syp2y = `echo "scale=10;$gSR_LIMITSymax + 0.000000" | bc`
set syp3x = `echo "scale=10;$gSR_LIMITSxmax + 0.236220" | bc`
set syp3y = `echo "scale=10;$gSR_LIMITSymin - 0.236220" | bc`
set syp4x = `echo "scale=10;$gSR_LIMITSxmin - 0.236220" | bc`
set syp4y = `echo "scale=10;$gSR_LIMITSymin - 0.236220" | bc`
set syp5x = `echo "scale=10;$gSR_LIMITSxmin - 0.236220" | bc`
set syp5y = `echo "scale=10;$gSR_LIMITSymax + 0.236220" | bc`
COM add_text,attributes=no,type=canned_text,x=$gSR_LIMITSxmin,y=$wky,\
text=$job,x_size=0.227,y_size=0.265,w_factor=2.624671936,polarity=positive,\
angle=0,mirror=no,fontname=canned_67,bar_type=UPC39,bar_char_set=full_ascii,\
bar_checksum=no,bar_background=no,bar_add_string=no,bar_add_string_pos=top,\
bar_width=0.008,bar_height=0.175,ver=1
COM add_pad,attributes=no,x=$syp1x,y=$syp1y,symbol=r15,\
polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$syp2x,y=$syp2y,symbol=r25,\
polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$syp3x,y=$syp3y,symbol=r35,\
polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$syp4x,y=$syp4y,symbol=r45,\
polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$syp5x,y=$syp5y,symbol=r55,\
polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
switch ($st)
case 1:
breaksw
case 2:
set pxgk1x = `echo "scale=10;$gSR_LIMITSxmin/2 + $gSR_LIMITSxmax/2" | bc`
set pxgk1y = `echo "scale=10;$gSR_LIMITSymax + 0.23622" | bc`
set pxgk2x = `echo "scale=10;$gSR_LIMITSxmin - 0.23622" | bc`
set pxgk2y = `echo "scale=10;$gSR_LIMITSymin/2 + $gSR_LIMITSymax/2" | bc`
COM add_pad,attributes=no,x=$pxgk1x,y=$pxgk1y,symbol=r40,\
polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
COM add_pad,attributes=no,x=$pxgk2x,y=$pxgk2y,symbol=r60,\
polarity=positive,angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
breaksw
endsw
#####if end
COM affected_layer,mode=all,affected=no
COM clear_layers
第一个部分,以下几句
set GUI_CMD = G:/tmp/gui_cmd.$$
set GUI_RESP = G:/tmp/gui_resp.$$
set IFILE = G:/tmp/do_info.$$
alias GUI_OUT 'echo \!:* >> $GUI_CMD'
alias GUI_EXE 'G:/genesis/e91/all/gui $GUI_CMD > $GUI_RESP; source $GUI_RESP; rm $GUI_CMD; rm $GUI_RESP'
这是教材里面的东西啊!使用gui之前设定好,方便些。
如果这样也算抄?那些东西不都是从书上抄来的?
本来SHELL编程就是这么些命令,炒来炒去有什么意思,相互学习,相互讨论,才会进步啊!