EDA365电子论坛网

标题: axlUIPopupDefine问题请教下版主 [打印本页]

作者: yneda    时间: 2013-11-5 16:09
标题: axlUIPopupDefine问题请教下版主
本帖最后由 yneda 于 2013-11-5 16:16 编辑

版主你好!
有个问题请教下,我想做这样一个操作,运行skill后,进入到框选状态,框选完后对框选后的目标进行处理,处理完后,再进入到下次框选状态,直到右键cancel后,结束退出。如下代码,不知道如何能实现,谢谢!


procedure( test()
    let((mypopup dbid_symbol)
         if(axlOKToProceed() then
            axlClearSelSet()
            axlSetFindFilter(?enabled '("NOALL" "SYMBOLS") ?onButtons '("SYMBOLS"))
            
             mypopup = axlUIPopupDefine(nil list(list("Done" 'axlFinishEnterFun) list("Cancel" 'axlCancelEnterFun))
             axlUIPopupSet(mypopup)

               
             dbid_symbol = axlSingleSelectBox()
               
              if(dbid_symbol then
                   fun1() ;运行完后,如再这里调用test()则会进入死循环,除非框选为nil,否则中止不了。
               else
                   fun2() ;如果框选目标为nil,再调用test()和上面的情况差不多。
                  )
          else
           axlUIConfirm("Finish current command first.")
          )


);end let

);end procedure
作者: deargds    时间: 2013-11-6 13:16
参考
  1. procedure( test()
  2. let((mypopup dbid_symbol)
  3.         if(axlOKToProceed() then
  4.                 axlClearSelSet()
  5.                 axlSetFindFilter(?enabled '("NOALL" "SYMBOLS") ?onButtons '("SYMBOLS"))
  6.                 mypopup = axlUIPopupDefine(nil list(list("Done" 'test_done) list("Cancel" 'test_cancel)))
  7.                 axlUIPopupSet(mypopup)
  8.                 stop = t
  9.                 while(stop
  10.                         axlClearSelSet()
  11.                         dbid_symbol = axlGetSelSet(axlSingleSelectBox())
  12.                         if(dbid_symbol then
  13.                                 axlHighlightObject(dbid_symbol t)
  14.                                 println(dbid_symbol~>name)
  15.                         else
  16.                                 println(dbid_symbol~>name)
  17.                         )
  18.                 )
  19.                 axlUIPopupSet(nil)
  20.         else
  21.                 axlUIConfirm("Finish current command first.")
  22.         )
  23. );end let
  24. );end procedure

  25. procedure( test_done()
  26. let(()
  27.         stop = nil
  28.         axlFinishEnterFun()
  29. )
  30. )

  31. procedure( test_cancel()
  32. let(()
  33.         stop = nil
  34.         axlCancelEnterFun()
  35. )
  36. )
复制代码

作者: yneda    时间: 2013-11-6 14:30
谢谢版主指点,非常给力,我测试了下,好的很。谢谢!
针对这,还有一个问题请教下,如果注册一个命令来运行test这个命令没问题,但如果直接调用test()这个函数却有问题,不能中止,不知道是什么原因。

调用方法一(没问题):
;;
axlCmdRegister( "test" 'test)

;;点击check button来掉调用

( "Field_check"
       axlShell("test")
)


调用方法二(不能中止):
;;


;;点击check button来掉调用

( "Field_check"
       test()
)

;;
procedure( test()
......
)

作者: deargds    时间: 2013-11-6 16:16
yneda 发表于 2013-11-6 14:30
谢谢版主指点,非常给力,我测试了下,好的很。谢谢!
针对这,还有一个问题请教下,如果注册一个命令来运 ...

需要右键菜单执行Done,或Cancel时才会中止,中止条件为
stop = nil,确认是否满足。
作者: bruce777    时间: 2017-5-23 14:29
收下学习了,谢谢楼主
作者: liuyidao    时间: 2022-2-11 14:14
yneda 发表于 2013-11-6 14:30
谢谢版主指点,非常给力,我测试了下,好的很。谢谢!
针对这,还有一个问题请教下,如果注册一个命令来运 ...

楼主这个问题解决了吗

作者: mofise007    时间: 2022-2-11 15:06
11111111111
作者: liuyidao    时间: 2022-2-14 17:09
yneda 发表于 2013-11-6 14:30
谢谢版主指点,非常给力,我测试了下,好的很。谢谢!
针对这,还有一个问题请教下,如果注册一个命令来运 ...

我也有这样的问题,第一次点按钮,启动函数,没有右键菜单,再点一次按钮就有了。解决方法是首先把allegro的模式即applicaiton mode设置为None
  1. if( axlVersion('version)>=15.7 then
  2.    axlShell("noappmode")
  3. )
复制代码
解决方法参考的是cadence官方论坛
问题的网址是:https://community.cadence.com/cadence_technology_forums/pcb-design/f/pcb-editor-skill/15999/axluipopupdefine-axluipopupset/70397#70397
#1

The example you give can run successfully without any problem just in the Application mode "NONE" of Allegro 16.3.
And in other three Application Modes (Genaral Edit/ Placement Edit/ Etch Edit) the PopupMenu won't display when we run the command "showElement " the first time.
But after we select anything on the board, we can see the PopupMenu displayed again.
Can you tell me how to display the PopupMenu when we run the command "showElement " the first time ??
Thanks a lot !
#2
for Allegro version higher than 15.7, we usually "force" allegro into Application mode "NONE"
(if allegroVersion>15.7 then
    axlShell("noappmode")
)
#3
After we force allegro into Application mode "NONE",it work very well.
Thank you for your suggestion!





作者: 白胡子    时间: 2022-7-19 18:51
liuyidao 发表于 2022-2-14 17:09
我也有这样的问题,第一次点按钮,启动函数,没有右键菜单,再点一次按钮就有了。解决方法是首先把allegr ...

解决了,太棒了,谢谢分享





欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2