Genesis脚本---自动输出Gberber274格式资料 脚本

Genesis脚本—自动输出Gberber274格式资料 脚本

# !/bin/csh 
set GUI_CMD = $GENESIS_DIR/tmp/gui_cmd.$$
set GUI_RESP = $GENESIS_DIR/tmp/gui_resp.$$
alias DO_INFO 'COM info,out_file=$IFILE,write_mode=replace,units=inch,args= \!:* ; source $IFILE; rm $IFILE'

alias GUI_OUT "echo \!:* >> $GUI_CMD"
alias GUI_EXE "$GENESIS_DIR/e$GENESIS_VER/all/gui $GUI_CMD > $GUI_RESP; source $GUI_RESP; \rm $GUI_CMD"
alias MATH 'echo "scale=6; \!*;" |  bc'
alias COMPARE 'echo "scale=2; if (\!*) 1;" |  bc'  #bc命令可以设置结果的位数,通过 scale。但是scale只对除法、取余、乘幂有效。

####### GUI Color ######
set black  = 000000
set green  = 007764
set gold   = 997506
set blue   = 000099
set red    = 990000
set pink   = 995099
set white  = 999999
set sky    = 006899
set yellow = 999900
set wall   = 727799
set soft   = 568889
set gentle = 158371
set light_blue = 688590

set cur_date = `date '+%Y%m%d'`		#当前时间
set start_time = `date '+%T' `		#开始时间
set outputPath = "D:/genesis/output/"${JOB}		#输出路径
set logFile = "D:/genesis/logs/tzOutput.log"	#日志输出路径
#如果存在outputPath   递归删除outputPath
if ( -e $outputPath ) then
	\rm -rf $outputPath
endif
#如果存在logFile,则创建一个空的logFile文件
if ( -e $logFile ) then
	\touch $logFile
endif

set source_step_name = ( )
DO_INFO -t matrix -e $JOB/matrix -d COL
set i = 1
#默认的step
set def_step = "panel-500"
#   $#:计算gCOLstep_name中的词数
#   $?:判断变量是否存在,若存在(被set过)则为1,否则为0
#   $$:表示执行此script的进程号
#   $<:重定向符号,既从终端读入一行
while($i <= $#gCOLstep_name)
  if ($gCOLstep_name[$i] == $def_step) then
		set source_step_name = ($source_step_name $def_step)	
  endif
@ i++
end

###说明还没有找到默认的Step
if ( $#source_step_name == 0 ) then
	set i = 1
	set def_step = "panel"
	while($i <= $#gCOLstep_name)
	  if ($gCOLstep_name[$i] == $def_step) then
		set source_step_name = ($source_step_name $def_step)	
	  endif
	@ i++
	end
endif

set i = 1
while($i <= $#gCOLstep_name)
  if ($gCOLstep_name[$i] != $def_step) then
		set source_step_name = ($source_step_name $gCOLstep_name[$i])	
  endif
@ i++
end


set Single_Layers=()
DO_INFO -t matrix -e $JOB/matrix -d ROW
set i=1
while ($i <= $#gROWname)
   #if ($gROWcontext[$i] == board && ($gROWlayer_type[$i] == signal || $gROWlayer_type[$i] == power_ground || $gROWlayer_type[$i] == mixed)) then
       set Single_Layers=($Single_Layers $gROWname[$i]) 
   #endif   
@ i++
end

GUI_OUT      WIN 100 100
GUI_OUT      BG 409983
GUI_OUT      FG 000000
GUI_OUT      FONT tbr18
GUI_OUT      BW 0.5
GUI_OUT      LABEL "Output Gerber274x(V2.0)"
GUI_OUT      FONT tbr14
GUI_OUT      FORM  
GUI_OUT      ENDFORM  
GUI_OUT      FORM
GUI_OUT      LABEL Please select output step
GUI_OUT      OPTION  selStp 
             foreach each_step ($source_step_name) 
GUI_OUT         	$each_step
			 end	
GUI_OUT      end
GUI_OUT      ENDFORM  
  
GUI_OUT     LABEL Please select output layers
GUI_OUT     LIST selLays 12 m 1
			set w=1
			while ( $w <= $#Single_Layers )
GUI_OUT       	$Single_Layers[$w]
			@ w++
			end
GUI_OUT     END
GUI_OUT      RADIO exit_y_n "Exit?" H 1 990000 
GUI_OUT      No
GUI_OUT      Yes
GUI_OUT      END
GUI_OUT      CLABEL Continue
GUI_OUT      END
GUI_EXE

if($exit_y_n == 2)then
  exit (0)
endif

#PAUSE $selLays





set stepSr0 = ()
set all_srStp = ()
set step_panel = $source_step_name[$selStp]
DO_INFO -t step -e $JOB/$step_panel -m script -d SR -p step
if ( $#gSRstep == 0) then
	set stepSr0 = ($stepSr0 $step_panel)
endif
foreach tmpStp ($gSRstep)
	set IsContarins = 0
	foreach tmp2Stp ($all_srStp)
		if ( $tmpStp == $tmp2Stp ) then
			set IsContarins = 1
		endif 
	end
	
	if ( $IsContarins == 0 ) then
		set all_srStp=($all_srStp $tmpStp)
	endif
end

set i = 1
while ( $i <= $#all_srStp )
	set son_step = $all_srStp[$i]
	DO_INFO -t step -e $JOB/$son_step -m script -d SR -p step
	foreach tmpStp ($gSRstep)
		set IsContarins = 0
		foreach tmp2Stp ($all_srStp)
			if ( $tmpStp == $tmp2Stp ) then
				set IsContarins = 1
			endif 
		end
		
		if ( $IsContarins == 0 ) then
			set all_srStp=($all_srStp $tmpStp)
		endif
	end
	
	if  ( $#gSRstep == 0 ) then
		set IsContarins = 0
		foreach each_step ($stepSr0)
			if ( $each_step == $son_step ) then
				set IsContarins = 1
			endif
		end
		
		if ( $IsContarins == 0 ) then
			set stepSr0 = ($stepSr0 $son_step) 
		endif 
	endif
@ i++	
end

foreach do_step ( $stepSr0 )
	COM open_entity,job=$JOB,type=step,name=$do_step,iconic=no
	AUX set_group,group=$COMANS
	COM units,type=inch
	COM clear_layers 
	COM affected_layer,mode=all,affected=no
	foreach each_lay ($selLays)
		COM filter_reset,filter_name=popup
		COM affected_layer,name=$each_lay,mode=single,affected=yes
		COM filter_set,filter_name=popup,update_popup=no,feat_types=surface
		COM filter_area_strt
		COM filter_area_end,layer=,filter_name=popup,operation=select,area_type=none,inside_area=no,intersect_area=no
		set selCount = $COMANS
		if ( $selCount > 0 ) then
			COM filter_area_strt
			COM filter_area_end,layer=,filter_name=popup,operation=unselect,area_type=none,inside_area=no,intersect_area=no
			COM sel_contourize,accuracy=0.25,break_to_islands=yes,clean_hole_size=3,clean_hole_mode=x_and_y	
		endif 
		COM affected_layer,name=$each_lay,mode=single,affected=no
	end
	COM editor_page_close
end

foreach each_lay ($selLays)

	COM output_layer_reset
	COM output_layer_set,layer=$each_lay,angle=0,mirror=no,x_scale=1,y_scale=1,comp=0,polarity=positive,setupfile=,setupfiletmp=,line_units=inch,gscl_file=,step_scale=no
	COM output,job=$JOB,step=$step_panel,format=Gerber274x,dir_path=$outputPath,prefix=,suffix=,break_sr=no,break_symbols=no,break_arc=no,scale_mode=all,surface_mode=contour,min_brush=1,units=inch,coordinates=absolute,zeroes=none,nf1=2,nf2=6,x_anchor=0,y_anchor=0,wheel=,x_offset=0,y_offset=0,line_units=inch,override_online=yes,film_size_cross_scan=0,film_size_along_scan=0,ds_model=RG6500
end








exit (0)

###### input & compare
VOF
COM create_entity,job=$JOB,is_fw=no,type=step,name=org,fw_type=form
VON
COM open_entity,job=$JOB,type=step,name=$step_panel,iconic=no
AUX set_group,group=$COMANS
COM units,type=inch
COM clear_layers 
COM affected_layer,mode=all,affected=no
COM input_manual_reset
set errorLays = ""
foreach each_lay ($selLays)
	COM input_manual_set,path=$outputPath"/"${each_lay},job=$JOB,step=org,format=Gerber274x,data_type=ascii,units=inch,coordinates=absolute,zeroes=leading,nf1=2,nf2=6,decimal=no,separator=*,tool_units=inch,layer=$each_lay,wheel=,wheel_template=,nf_comp=0,multiplier=1,text_line_width=0.0024,signed_coords=no,break_sr=yes,drill_only=no,merge_by_rule=no,threshold=200,resolution=3
	COM input_manual,script_path=
	COM compare_layers,layer1=$each_lay,job2=$JOB,step2=org,layer2=$each_lay,layer2_ext=,tol=1,area=global,consider_sr=yes,ignore_attr=,map_layer=map_compare,map_layer_res=200
	set compResult = $COMANS
	set cur_time = `date '+%T' `
	if ( $compResult != 0 ) then
		set errorLays = ${errorLays}${each_lay}
		echo "$JOB	CompareFail	$each_lay		$cur_date		$start_time 		$cur_time" >> $logFile
	else
		echo "$JOB	CompareSuccess	$each_lay		$cur_date		$start_time 		$cur_time" >> $logFile
	endif 
	
end

set tmpLen  = ` echo $errorLays | wc -c `
if ( $tmpLen > 1 ) then
	GUI_OUT      WIN 100 100
	GUI_OUT      FG 999999
	GUI_OUT      BG 990000
	GUI_OUT      FONT tbr18
	GUI_OUT      BW 0.5
	GUI_OUT      LABEL @D:/genesis/sys/scripts/CompareFail.xbm
	GUI_OUT      BG 409983
	GUI_OUT      FG 000000
	GUI_OUT      CLABEL Continue
	GUI_OUT      END
	GUI_EXE
else
	GUI_OUT      WIN 100 100
	GUI_OUT      FG 999999
	GUI_OUT      BG 007764
	GUI_OUT      FONT tbr18
	GUI_OUT      BW 0.5
	GUI_OUT      LABEL @D:/genesis/sys/scripts/CompareSuccess.xbm
	GUI_OUT      BG 409983
	GUI_OUT      FG 000000
	GUI_OUT      CLABEL Continue
	GUI_OUT      END
	GUI_EXE	
endif





  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Genesis自动标注脚本是一种用于快速、高效地对数据进行标注的工具。它基于Genesis平台,通过预设的算法和规则,可以自动为大量数据进行标注,提高标注的速度和准确度。 首先,Genesis自动标注脚本通过机器学习算法进行训练,从而可以自动识别和标注数据中的特定模式和属性。它利用预先定义的规则和分类器,对原始数据进行自动分类和标记。例如,在图像识别任务中,它可以自动检测和标注图像中的物体,或者在自然语言处理任务中,可以自动识别和标注文本中的实体和关键词。 其次,Genesis自动标注脚本还可以根据用户提供的标注样本进行有监督学习,从而提高标注的准确度。用户可以通过提供一部分已标注好的数据给Genesis,让它学习和推断如何对其他未标注数据进行标注。这种方式可以减少人工标注的工作量,同时确保标注结果的一致性和准确性。 此外,Genesis自动标注脚本具有一定的可调整性和灵活性。用户可以根据自己的需求进行脚本的设置和调整,以适应不同的数据类型和标注任务。用户可以定义自己的规则和分类器,也可以选择使用Genesis提供的默认设置。这使得Genesis脚本适用于各种不同领域和应用场景的数据标注。 总之,Genesis自动标注脚本是一种强大的工具,可以帮助用户快速、高效地进行数据标注。它通过利用机器学习算法和规则,实现了对数据的自动分类和标注,减少了人工标注的工作量,并提高了标注结果的准确性和一致性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值