Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1025347
  • 博文数量: 159
  • 博客积分: 4079
  • 博客等级: 上校
  • 技术积分: 2373
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-24 13:35
个人简介

诚实守信!

文章分类

全部博文(159)

文章存档

2015年(2)

2014年(18)

2013年(9)

2012年(57)

2011年(31)

2009年(42)

分类: IT业界

2014-12-10 21:57:01

支持Symbol, Pin, Net。
axlCmdRegister("savehilight" '_LCSaveHilight ?cmdType "general")
axlCmdRegister("sethilight" '_LCSetHilight ?cmdType "general")
;###########################################################
;#                   save highlighted                      #
;###########################################################
defun( _LCSaveHilight ( )
prog( ( , newfile, filep, vis)
unless( isDir( "~/pcbenv/usersetting") createDir( "~/pcbenv/usersetting"))
    filename = strcat( "~/pcbenv/usersetting/highlight.col")
    newfile = t
if( isFile( filename) then
if( axlUIYesNo( "Highlight setting file exists. Overwrite?") then
            newfile = t
else
            newfile = nil
);end-if
);end-if
if( newfile then
        filep = outfile( filename)
;s
fprintf( filep "#NET\n")
foreach( net axlDBGet() -> nets
if( axlIsHighlighted( net) then
fprintf( filep "\"%s\" %d\n", net -> name, axlIsHighlighted( net))
);end-if
);end-foreach
;symbols
fprintf( filep "#COMPONENT\n")
foreach( symbol axlDBGetDesign() -> symbols
if( axlIsHighlighted( symbol) && symbol -> refdes then
fprintf( filep "\"%s\" %d\n", symbol -> refdes, axlIsHighlighted( symbol))
);end-if
);end-foreach
;pins
fprintf( filep "#PIN\n")
        vis = axlVisibleGet()
axlVisibleDesign( t)
axlClearSelSet()
axlSetFindFilter( ?enabled list( "NOALL", "PINS")
?onButtons list( "NOALL", "PINS") )
foreach( pin axlGetSelSet( axlAddSelectAll())
if( axlIsHighlighted( pin) && pin -> component then
fprintf( filep "\"%s\" %d\n", strcat( pin -> component -> name, ".", pin ->number),
axlIsHighlighted( pin) )
);end-if
);end-foreach
axlClearSelSet()
axlVisibleSet( vis)
close( filep)
axlMsgPut( "Save highlighted completed.")
);end-if
);end-prog
);end-defun
;###########################################################
;#                      set highlight                      #
;###########################################################
defun( _LCSetHilight ( )
prog( ( filename, filep, s, name, , origin_color, vis)
    filename = strcat( "~/pcbenv/usersetting/highlight.col")
if( isFile( filename) then
;dehilight all
axlDehighlightObject( axlDBGetDesign() -> nets, t)
axlDehighlightObject( axlDBGetDesign() -> symbols, t)
        vis = axlVisibleGet()
axlVisibleDesign( t)
axlClearSelSet()
axlSetFindFilter( ?enabled list( "NOALL", "PINS")
?onButtons list( "NOALL", "PINS") )
axlDehighlightObject( axlGetSelSet( axlAddSelectAll()), t)
axlVisibleSet( vis)
;save highlight Color
        origin_color = axlDBControl( 'highlightColor)
        filep = infile( filename)
gets( s filep)
;hilight net
gets(s filep)
while( s && ( car( parseString( s)) != "#COMPONENT")
            name = car( parseString( s "\""))
            color = atoi( cadr( parseString( s "\"")))
axlDBControl( 'highlightColor color)
axlHighlightObject( axlSelectByName( "NET", name) t)
gets(s filep)
);end-while
;hilight component
gets(s filep)
while( s && ( car( parseString( s)) != "#PIN")
            name = car( parseString( s "\""))
            color = atoi( cadr( parseString( s "\"")))
axlDBControl( 'highlightColor color)
axlHighlightObject( axlSelectByName( "REFDES", name) t)
gets(s filep)
);end-while
;hilight pin
gets(s filep)
while( s
            name = car( parseString( s "\""))
            color = atoi( cadr( parseString( s "\"")))
axlDBControl( 'highlightColor color)
axlHighlightObject( axlSelectByName( "PIN", name) t)
gets(s filep)
);end-while
;revert highlight Color
axlDBControl( 'highlightColor origin_color)
axlClearSelSet()
close( filep)
axlMsgPut( "Read highlight completed.")
else
axlMsgPut( "E- Highlight can not load.")
);end-if
);end-prog
);end-

阅读(8088) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~