|
deargds
rexMatchp为正则匹配检查,参考以下代码,测试通过
大大有点问题!!
以下是我测试用的RPT,他会把一些其余的东西也打印出来!!
(---------------------------------------------------------------------)
( )
( Dangling Line, Via and Antenna Report )
( )
( Drawing : 1.brd )
( Software Version : 16.3p006 )
( Date/Time : Thu Aug 08 19:01:01 2013 )
( )
(---------------------------------------------------------------------)
Report methodology:
- Dangling lines have at least one end not connected.
- Dangling vias have one or no connection
- Plus are not a testvia or a thieving via.
- Antenna vias do not have connections on their start and end layers.
- Plus they are not a thieving vias.
- Optionally, VOLTAGE nets, testvias and through vias can be suppressed with
the environment variable report_antennavia.
- Section may be suppressed by variable report_noantennavia.
- In all cases output is suppressed if an object has the OK_DANGLE
property or is not part of the current partition.
<< Dangling Vias >>
Net Padstack Location
--------------------------------------------------------------
GND VIA020D010 (2075.00 1710.00)
<< Antenna Vias >>
Net Padstack Location
--------------------------------------------------------------
GND VIA020D010 (2075.00 1710.00)
<< Summary >>
Total dangling lines: 0
Total dangling vias: 1
Total antenna vias: 1
以下是我的代码,我需要抓dline和dvia两种数据!!
试用了你的代码,发现多出了一些东西!!
麻烦再指点一下!!- defun(x_get_dline_list nil
- let((dlineport temp_dline dlinelist dvialist next_line)
- prog( nil
- ; deleteFile("x_temp_dlines.txt")
- axlShell("reports 'Dangling Lines Report' nographic write x_temp_dlines.txt")
- when((isFile("x_temp_dlines.txt") == nil)
- return(nil)
- )
- (dlineport = infile("x_temp_dlines.txt"))
- (dlinelist = nil)
- (dvialist = nil)
- temp_dline = nil
- when(dlineport
- while( gets(next_line dlineport)
- if(index(next_line "Antenna Vias") == nil then
-
- ; VCC BOTTOM 294.35 *(2225.00 1825.00) to (2480.00 1770.00)
- ;[ A-Z0-9]+[ ]+[A-Z0-9]+[ ]+[0-9.]+[ ]+[*(][-0-9.]+ [-0-9]+[) to (]+[-0-9.]+ [-0-9.]+).$
- ; when( rexMatchp("^[ A-Z0-9]+[ ]+[A-Z0-9]+[ ]+[0-9.]+[ ]+[*(][-0-9.]+ [-0-9]+[) to (]+[-0-9.]+ [-0-9.]+).$ " next_line )
- when( rexMatchp("\\([A-Za-z]*\\)[ ]+\\([A-Za-z]*\\)[ ]+\\([-?0-9.]*\\)[ *(]+\\([-?0-9.]*\\)[ ]+\\([-?0-9.]*\\)[) to*(]+\\([-?0-9.]*\\)[ ]+\\([-?0-9.]*\\)" next_line )
- temp_dline = buildString( parseString(next_line) " ")
- rexCompile("(")
- temp_dline = rexReplace(temp_dline "" 1)
- rexCompile(")")
- temp_dline = rexReplace(temp_dline "" 1)
- dlinelist = cons( temp_dline dlinelist )
- );end when
-
- ; GND VIA020D010 (2075.00 1710.00)
- when( rexMatchp("^[ A-Z0-9_<>*]+[ ]+[A-Z0-9_]+[ ]+([-0-9.]+ [-0-9.]+).$" next_line )
- temp_dline = buildString( parseString(next_line) " ")
- rexCompile("(")
- temp_dline = rexReplace(temp_dline "" 1)
- rexCompile(")")
- temp_dline = rexReplace(temp_dline "" 1)
- dvialist = cons( temp_dline dvialist )
- );end when
-
-
-
- else close(dlineport)
- );end when
- ; printf("%L \n" dvialist)
-
- )
-
- ; printf("%L \n" dlinelist)
- printf("%L \n" dvialist)
- close(dlineport)
- )
-
- ; deleteFile("x_temp_dlines.txt")
- return(list(dlinelist dvialist))
- ; return(list(dlinelist dvialist))
- )
- )
- )
-
- axlCmdRegister("zz1" 'x_get_dline_list ?cmdType "general")
复制代码 |
|