收藏 分销(赏)

SCRIPT训练二.doc

上传人:仙人****88 文档编号:11890685 上传时间:2025-08-18 格式:DOC 页数:20 大小:78.50KB 下载积分:10 金币
下载 相关 举报
SCRIPT训练二.doc_第1页
第1页 / 共20页
SCRIPT训练二.doc_第2页
第2页 / 共20页


点击查看更多>>
资源描述
START SCRIPT #!/bin/csh -f # # start_script # # set path = (~ /id/scripts /manager/utilities /bin /usr/bin /com) onintr - alias a alias a SOT 'echo \#\%\@ "\!:*"; set SYNC = $<' a SIN 'echo \#\@\% "\!:2*"; set \!:1 = $<' a CMD 'echo \@\#\% "\!:*"; set STATUS = $< ; set ERRNO = $< ; if ($STATUS \!= OK && $STATUS \!= BAD) set STATUS = $ERRNO; if ($STATUS \!= OK) exit 9' a GMD 'echo \@\#\% "\!:*"; set STATUS = $< ; set ERRNO = $< ; if ($STATUS \!= OK && $STATUS \!= BAD) set STATUS = $ERRNO; if ($STATUS \!= OK) exit 9' a SYS 'echo \@\%\# "\!:*"; set SYNC = $<' a FOT 'echo "\!:2*" > /id/workfile/\!:1' a FIN 'set \!:2 = `cat /id/workfile/\!:1`' a SCR 'source /id/scripts/\!:1; if ($status \!= 0) exit $status' a GRP 'echo \%\#\@ "\!:*"; set STATUS = $<; set ERRNO = $<;if ($STATUS \!= OK) exit 9' a SUS 'echo \%\@\# zzz; set STATUS = $<; set ERRNO = $<' a VON 'a CMD '\''echo \@\#\% '\"\\\!:\*\"\; ' set STATUS = $<; set ERRNO = $<;if ($STATUS != OK) exit 9'\' a VOF 'a CMD '\''echo \@\#\% '\"\\\!:\*\"\; ' set STATUS = $< ;set ERRNO = $<'\' a CON 'echo \%\%\@ ; set SYNC = $<' a COF 'echo \%\%\# ; set SYNC = $<' a PUP 'echo \@\@\% ; set SYNC = $<' a PDN 'echo \@\@\# ; set SYNC = $<' a GOF 'echo \%\#\# ; set SYNC = $<' a GON 'echo \%\#\% ; set SYNC = $<' a ANS 'echo \#\@\# "\!:*"; set SYNC = $<' a MIN 'echo \@\@\@ "\!:2*"; set STATUS = $< ; set \!:1 = $< ; if ($STATUS \!= OK) exit 9' a FIX 'echo \#\#\# "\!:*"; set STATUS = $< ; set DUMMY = $<;if ($STATUS \!= OK && $STATUS \!= BAD) set STATUS = $ERRNO; if ($STATUS \!= OK) exit 9' a UOF 'echo \#\@\@ ; set SYNC = $<' a UON 'echo \%\@\@ ; set SYNC = $<' a LIS 'echo \%\%\% "\!:*"; set STATUS = $< ; set DUMMY = $<;if ($STATUS \!= OK) exit 9' # set a = $< ; set ERRNO = $< if ($a != OK) then set ERRNO = $< endif # if ($#argv < 1) then SOT Not enough arguments for start_script exit 1 endif # if ($#argv >= 2) then set SCR_KEY="$argv[2-]" else set SCR_KEY="" endif # source $1 exit $status # LINE MODE General This is a DRAFT (and should BE considered as such) of the line mode commands in Image 5000. In any case of A problem, please invoke the process in line mode and get the help for the command (using HELPLN,command and/or SHODEF,command). LINE MODE HELP command description HELPLN Line mode help. Syntax: - HELPLN : Display of this help - HELPLN, ALL : Display of process commands and their description. - HELPLN, command : Display of a process command and its description. SCREEN Switch to screen mode (Not available on dumb terminals). BYEBYE Quit the process. Syntax: - BYEBYE : Quit no log - BYEBYE, file : Quit and save the process log file under the specified name. SETDEF Set Parameters current defaults. Syntax: - SETDEF, command, parameter-number, parameter-value : This command assigns parameter value to the parameter whose number is specified, for the specified command. SHODEF Show all parameter names and defaults for a specified command. Syntax: - SHODEF, command CLEARF Clear fields to system defaults. Syntax: - CLEARF, command : Set all command parameters to system default. - CLEARF, ALL : Set all parameter of all process commands to System defaults. STUNIT Set working units of the process. Syntax: - STUNIT, INCH : Set units to inches. - STUNIT, MM : Set units to mm. <RETURN> List all process commands and system commands. xxxxxx Invoke a process command. Syntax: xxxxxx [,parameters] -n : Invoke process command,using current defaults of the unspecified parameters. xxxxxx [,parameters] : Invoke process command,prompting for anyunspecified parameter. IMAGE-5000 SCRIPT commands A. IMAGE specific commands ANS <ans1> <ans2>...<ansn> - answer CMD namexx,parameters - process command COF - check off CON - check on [D] FIN file var - input from file FIX file - print to fixed area FOT file multi-word-string - output to file GMD namexx,parameters * - graphics command GOF - graphics off GON - graphics on [D] GRP graphic-script-name - execute graphic script LIS [control] input-file output-file header - list input MIN var file title - menu input PDN - priority down PUP - priority up SCR script-name - execute nested script SIN var multi-word-string - input from terminal SOT multi-word-string - output to terminal SUS - suspend script SYS name,parameters - system command UOF - Undo off UON - Undo on [D] VOF * - verify off VON * - verify on [D] Note 1: The '*' is unpubliced variable. Note 2: The [D] is default value. Note 3: multi-word-string may be one or more words. Note 4: graphic-script-name is identical to the name entered at the end of the specific graphic script definition, and NOT include "g_" prefix as added by the system. For example, graphic script "grp_1" appear as file "/id/scripts/g_grp_1". A.1. Process command parameters - Parameters are separated by comma sign (,). - Empty value is a blank delimited by comma (par1, ,par3,...) - Undefined value is an empty string delimited by comma (par1,,par3,...) - Long command line may be divided into several lines, each of them (but the last line) terminated with a backslash (\). - Parameter list is terminated and may be divided by semicolon (;),where each semicolon is preceded by a backslash (\). List example 1: f1:6\; (layer's f1 to f6) List example 2: comp\;solder\;grd\; (layer's comp, solder and grd) Example from Input Design (idsn) process: CMD STARTI,pcb2,f1:2\;,DISK,gap,1,gap5,04/10/88,gap, ,GERBER,NO,1024,1,\ 2,1,ASCII,*,5.3,INCREMENTAL,LEADING,INCHES,1.0000,0.0000,0.0000 A.2. SYStem commands description SYS actv,xxxx -nmy_name -ascript_name - activate a process (xxxx) with name (my_name) and start its script (script_name) SYS sets - set screen (put all processes windows to "normal" window position) SYS quit,xxxx - terminate all xxxx (e.g. idsn) processes SYS misc,xxxx [activation list] - activate a miscellaneous process B. General c-shell commands B.1. Definitions $var : String variable value @ num : Numeric variable value $#list : Number of elements in list $list[*] : All of list elements $list[i] : i'th element of list (i = 1,2,3...) ${var}nfpr : concatenate "nfpr" to variable value Important note : for list indexing (e.g. $layers[2]), you must use the -------------- following commands: SIN layers Please enter layers names - getting layers list from user OR FIN file1 layers from a file set layers = ($layers) - set index list B.2. Numeric operators || && - lowest precedent |, ^, & == != =~ !~ < <= > >= << >> + - * % / ! ~ () - highest precedent B.3. Regular commands - set pcb = "img_r_pcb101" - string variable @ num = 5 - numeric variable - sleep x - sleep x seconds B.4. Control commands - exit (status code) - status code: 0 - O.K. exit 1,9 - reserved other - error exit 1:Not enough arguments for start_script 9:Run-time error for start_script - goto label - "label:" must appears in script - if ($var != "solder") then ... endif - if ($ans == "Y" || $ans == "y") then ... else ... endif - if ($ans == "Y" || $ans == "y") then ... else if ($ans == "N" || $ans == "n") then ... else ... endif - only one endif required - while ($c > 0) . . . end - foreach name ($list) . . (using $name) . end - switch ($mode) case s: ... breaksw case l: ... breaksw case r: case R: ... breaksw default: - all other cases ... breaksw endsw B.5. File status if (-e filename) then ... if (! -e filename) then ... Where : -e = exist -r = read permission -w = write permission -x = execute permission -z = zero size -f = file -d = directory Note: filename must include full path name of the specific file. For example: /id/scripts/init_input - script file name /id/pcbs/h-121/pcbhdr - pcb header file name /id/pcbs/h-121/l1/vector - pcb vector file name /id/panels/h-121/drill/drill - panel drill file name /id/tmp/sc_file - temporary file name (Used by script commands FOT / FIN) C. Script debug session /bin/csh -f /scd script-name - regular debug session /bin/csh -fv /scd script-name - detailed debug session For example: debug lb_input script in regular debug session: /bin/csh -f /scd lb_input C.1. Debug session commands executing -The following commands are executed the same as in regular script activation: SIN, SOT, FIN, FOT and SCR. -CMD, SYS, GRP and SUS commands are only displayed with their parameters. No activation is taken place. -All general c-shell commands are executed in the regular manner. C.2. Detailed debug session In this session each IMAGE specific script command is printed twice: first as it is written in the script and then as it is executed by the running process, after the proper interpretation. Regular c script commands are printed only once. For example, in the following sequence each command marked with (*) appear as it is written in the script, while those marked with (+) are after interpretation, as they are executed: * SIN PCB1 Please enter pcb name + Please enter pcb name : h-121 (h-121 - user input) * CMD COPPCB,$PCB1, + CMD COPPCB,h-121, Important note: In IMAGE-5000 version 1.0 activate script debug session ------------ by using the following commands: /bin/csh -f /ie/all/debug_start_script script-name - regular /bin/csh -fv /ie/all/debug_start_script script-name - detailed D. General example D.1. sc_gnrl script: run from selection process # # I M A G E - 5 0 0 0 G l o b a l S c r i p t # # Activating input design process with lb_input script # SYS actv,idsn -nlb_input -alb_input D.2. lb_input script: run by input design process # # I M A G E - 5 0 0 0 S c r i p t # # Script File 'lb_input', Created From Log File 'lb_input' # SIN PCB1 Please input the pcb name: SIN WRKF Please input the workfile name: SIN LAYLIST Please enter layers names set LAYLIST = ($LAYLIST) # # Build layers list according to I-5000 script rules # set LAYERS = "" foreach LAYER ($LAYLIST) set LAYERS = ${LAYERS}$LAYER\\\; end CMD STARTI,$PCB1,$LAYERS,DISK,$WRKF,1,gap5,04/10/88,sc, ,GERBER,NO,1024,1,\ $#LAYLIST,1,ASCII,*,5.3,INCREMENTAL,LEADING,INCHES,1.0000,0.0000,0.0000 FOT sc_file $PCB1 SIN ans Do you want to exit this process ([N]/Y) ? if ($ans == 'Y' || $ans == 'y') then CMD byebye endif # # Activate edit pcb process with gap_grp1 script # SYS actv,epcb -ngap_epcb -agap_grp1 D.3. gap_grp1 script: run by edit pcb process # # I M A G E - 5 0 0 0 S c r i p t # # Script File 'gap_grp1', Created From Log File 'gap_epcb' # SIN xx Do you want to end design-input process ([N]/Y) ? if ($xx == 'Y' || $xx == 'y') then SYS quit,idsn endif FIN sc_file PCB1 CMD COPPCB,$PCB1 CMD CCCREG,1.0000,2.0000,16.0000,12.0000 SOT Current pcb : $PCB1 SIN layers Enter the layers that you wish to edit: foreach ly ($layers) CMD GDISPL,$ly, , , # # Activate Graphic script 'grp_1' in the current displayed layer # GRP grp_1 end foreach ly ($layers) CMD ALNFPR,$ly,${ly}nfpr,YES end IMAGE_OUT Usage : image_out [-p][-a][-l][-s][-g|G][-f file[; file]] OTYPE ONAME [-e|-E ELEMENT] [-V] [-I] Where OTYPE is PCB, PANEL, APERTURE, SYMBOL, WHEEL, SYSTEM, CONFIG, QUEUES or AOIMSTRS ONAME is the object name (for all OTYPES except for SYSTEM and QUEUES) ELEMENT is the element name (usually from Image 5000 Database Description) and the options are : -p - print : print the object -a - allow : remove any limitations on the object files' permissions -l - list : list all files to stderr before printing -f files : match only specified file names (files may be wild names and lists) -e element : print only the specified element from the file -E element : Display element with full path name -s - summary : to print object-level summary of pcbs (apertures and symbols) and panels (symbols) -g - grand total : summary for all pcbs or panels (also pcbs in panels) -G - Grand total : Sum up all unused apertures in the PCBs -V - Version : print version info -I - Ignore : Do not exit in case of 1000 errors. Current status : CONFIG gives an element of a config file with -e or a full listing for -p. SYSTEM Files are apername, pnltypes and text. checks apername against the apertures in the directory. ONAME may be a list of names in the format 'name1; name*-pf; xxx'. ELEMENT defines a specific path to search. For vector, flash and extra files, and for the number of images on panel the element 'count' gives results. wild elements are supported for layer names and for names in extra file. For more OTYPE-element-specific information type image_out -h CAUTION Always use names in quotes if you use wild cards. EXAMPLES : image_out pcb 'atp*' -E 'layer:*.extra:*' image_out panel 1298aas -e layer:ps.layerhdr.copper_area image_out pcb atp1 -p -f pcbhdr FLOAT_EXPR2 Usage : float_expr2 exp1 [...] [-V] Use '_' instead of '-' (ONLY IN THE '-' OPERATION !!!!). Put each expression in separate quotes. - The following are the binary arithmetic operations : + - add _ - subtract * - multiply / - divide ^ - power @ - remainder - The following are binary logical operations : < - less than > - greater than 1 = true = - equal to 0 = false - Math functions (all unary) : % - round d - floor u - ceiling s - sine (degrees) S - sine (radians) c - cosine (degrees) C - cosine (radians) t - tangent(degrees) T - tangent(radians) rs- arcsin (degrees) rS- arcsin (radians) rc- arccos (degrees) rC- arccos (radians) rt- arctan (degrees) rT- arctan (radians) P - pi (3.14159..) E - natural log base a - absolute value l - log base 10 q - square root M - conv. mm > mil m - conv. microns > mil I - conv. inch > mm i - conv. mil > mm Example : float_expr2 's
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服