Home > Community > Forums > PCB SKILL > Find Filter Issue

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Find Filter Issue 

Last post Tue, Apr 2 2013 12:04 AM by serpens. 9 replies.
Started by serpens 22 Mar 2013 05:31 AM. Topic has 9 replies and 1499 views
Page 1 of 1 (10 items)
Sort Posts:
  • Fri, Mar 22 2013 5:31 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Find Filter Issue Reply

    Hi,

    I have an issue with the axlGetFindFilter() command. I have a small SKILL script for Find & replace text in the DB. In the code below I was trying to get the initial Find Filter setings and backup them, before I change it to TEXT, how ever it only returned nil, so I'm not able to backup them.

    Second issue is that  axlSetFindFilter(...)  will not work when I execute my script when another command is actually running in the PCB editor (e.g. move). Is there any command whit which I can get the state of the PCB Editor, so I will be able to notice the user that another command is runnig and he need to close it first, before execute the script?

    Regards,

    Miro

    moFindFilterEnabled = axlGetFindFilter(nil) > this returns nil
    moFindFilterButtons = axlGetFindFilter(t) > this returns nil

     println( moFindFilterEnabled) - just for check
     println( moFindFilterEnabled) - just for check

    axlSetFindFilter( ?enabled list( "noall" "text" "invisible") ?onButtons list( "noall" "text"))
    axlAddSelectAll()
    moAllTexts = axlGetSelSet()

    REST OF THE CODE


    axlClearSelSet()

    axlSetFindFilter( ?enabled moFindFilterEnabled  ?onButtons moFindFilterButtons ) > sets only the TEXT as enabled and on

    • Post Points: 35
  • Fri, Mar 22 2013 8:50 PM

    • D912349
    • Top 150 Contributor
    • Joined on Sat, Nov 24 2012
    • Posts 47
    • Points 800
    Re: Find Filter Issue Reply

    Hi,

    I think axlGetFindFilter only works when fields are set by axlSetFindFlter, and active command is idle.

    regarding second issue, to check when a certain command is active by using axlOkToProceed.

    Regards,

    • Post Points: 5
  • Mon, Mar 25 2013 5:45 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 296
    • Points 4,710
    Re: Find Filter Issue Reply

    You should register your skill entry point as an Allegro command via axlCmdRegister. If you register it as an interactive command then the system will 'DONE' any other interactive command before calling your Skill code. 

    axlGetFindFilter returns a nil because no other Skill code has set the find filter. Commands like move, delete, etc. have their own find filter settings. These settings are not shared with the Skill environment.

    • Post Points: 20
  • Wed, Mar 27 2013 5:04 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Find Filter Issue Reply

    Thanks guys for reply. I will try it. When the code will be registered as the command, will it handle also the Find Filter settings? I want to make it clear that it don't mess with the last used filter in the Editor (in idle mode).

    • Post Points: 20
  • Wed, Mar 27 2013 6:48 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 296
    • Points 4,710
    Re: Find Filter Issue Reply

    axlGetFindFilteraxlSetFindFilter is provided tosupport a push/pop programming strategy.

    For example, your code enables the find filter to allow the user to control what objects they select. After they selected an object your code might need to find other objects using the find filter. In this case, this utility to find other objects would want to preserver the original find filter settings.

    With normal command level programming you don't need to restore the find filter. An exception is if you are writing a utility function that is used by other Skill code then it is good programming practive to restore the find filter if your utility function changes it.

    Cadence commands either have their own persistent find filter settings they set when the command starts or use fixed set of initial settings.

    If you are writing your own command level code, you should assume that the intiial find filter settings are undefined and you always need to set them to the values your command intially requires. 

    • Post Points: 20
  • Thu, Mar 28 2013 8:39 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Find Filter Issue Reply

    Hi fxffxf,

    Thanks again for quick reply. I've registered the function with the axlCmdRegister() and it works fine for closing the running command.

    But I still have issues with the Find Filter. I use the filter to get dbids of all texts in the DB for my SKILL code. If there is another way how to avoid using the filter to get the dbids of all texts in the whole design this will solve the problem too.

    If I understand it correctly, there is no way how to preserve the setting of the Find Filter for the Idle mode of PCB Editor?

    Now my SKILL code behave like this in relation to Find FIlter.

    - there are some setting (user selected before)
    - after executing my SKILL code, the code change the Find Filter settings to text only (enabled and on_button)
    - then when the code ends and return to the PCB Editor, the Find Filter settings remain set to text only available option
    - user need to execute some another command e.g. move, slide, etc., then done the command and after this the Find Filter enables all usually enabled options
    - how ever the on_button stay on text only

    Even the code work I would like to fix this behavior to make it more user friendly.

    If there is interest, attached is the SKILL code. After loading the code it is necessary to run it by typing mo_bfr to the command line.

    Miro

    • Post Points: 20
  • Thu, Mar 28 2013 9:29 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 296
    • Points 4,710
    Re: Find Filter Issue Reply

    You don't need to preserve the find filter for Idle mode. There is a mode that leaves the find filter editable which allows you type on the command line without restoring the Allegro idle mode after each Skill evaluation but if you start another Allegro interactive command it will switch the find filter back to that command's settings.

    I would have to believe that if Allegro commands work differently because of your find filter settings then it is a bug that should be reported to Cadence.

    • Post Points: 20
  • Thu, Mar 28 2013 12:12 PM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Find Filter Issue Reply

    I don't fully understand you in the next reply. The Find Filter settings for the standard commands works fine (they aren't affected by my SKILL code), only the settings for Idle mode are affected. Try to run my code and look like the Find Filter behave after you click on Execute button and then close the form.

    • Post Points: 5
  • Thu, Mar 28 2013 1:01 PM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Find Filter Issue Reply

    Hi, I've done a picture to better describe my problem.

    I start with the FF set to "All On" [1.], then when I run the code and hit "Execute" the FF changed to text only [2.] note that all another options are gray. After closing the form (code) the FF stays the same [3.], note the options are still grayed. In this point I would like to enhance the code that way it ends up like it is on [6.]. That means after closing the form window it should return to the last used FF settings (set before running the code).

    After closing the form window I must run another command e.g. "move" and it sets it's own FF [4.]. When the command is closed, the FF enable the grayed options, but stay set for text [5.].

    I know how to change the code to goes from [1.] to [2.] and then directly to [5.], but  I don't know how to make it run like [1.] to [2.] then to [6.]. Of course the setting on [1.] are just example, the settings may vary but in the end [1.] and [6.] must match.

    I hope this will bring a little light in to my problem.

    Regards,
    Miro


    • Post Points: 5
  • Tue, Apr 2 2013 12:04 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Find Filter Issue Reply
    I find my way, it's no the best but it works for now :). After register the command by axlCmdRegister() (thanks guys), I just simply add axlShell( "cancel") in the end of the code which restore the FF to the state I want.
    • Post Points: 5
Page 1 of 1 (10 items)
Sort Posts:
Started by serpens at 22 Mar 2013 05:31 AM. Topic has 9 replies.