• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. triggering the done procedure for enterPoints()

Stats

  • Locked Locked
  • Replies 10
  • Subscribers 143
  • Views 17225
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

triggering the done procedure for enterPoints()

jaleco
jaleco over 11 years ago
I am using an enterPoints function that does not seem to recognize use of the Enter key, or a double click (typical done trigger for enterPath) as triggers for its done procedure.  How does one trigger the done procedure for enterPoints?  The esc key is recognized as a cancel function.  The form contains a cancel button, but no done button.
  • Cancel
  • jaleco
    jaleco over 11 years ago
    PS - I can use the ?wantPoints parameter, but was looking for something in the user interface to trigger the done procedure...
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    Well, first thing to check is that the bindkeys for Enter and double click left mouse are set, but assuming they are, I suspect it's probably because you're not using a ?doneProc with enterPoints and have "Repeat Commands" set in the Options->Editor form.

    If Repeat Commands is enabled, then the enterPoints() function does not return after you've hit the return key or double-clicked - instead, it goes back to the "first" prompt again and asks again. Since the expected use model with an enterFunction is to use the ?doneProc callback to do the action, this makes sense - as it allows you to repeatedly do the same thing over and over again.

    You can observe this by doing:

    procedure(MyDoneProc(win ok points)  printf("FINISHED: %L %L\n" ok points))
    enterPoints(?prompts '("first" "next") ?doneProc "MyDoneProc")

    You should see the "FINISHED" message when you hit return or double click. Is that happening? Also, the prompt will go back to "first" rather than "next". Then also try turning off Repeat Commands and see what happens.

    Kind Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jaleco
    jaleco over 11 years ago

    Andrew,

    very sorry for the embarrassing long time that has passed while this issue got buried on my end.  My problem with the ?doneProc turned out to be a dumb code typo.  However, I am still looking into how to manipulate the ?wantPoints and ?points parameters if possible.

    Due to the time that has passed since looking at this, I will create a new post if necessary.

    Thank you again.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    I'm not sure what you're trying to do - the ?wantPoints and ?points are fairly clear in the documentation, so I'm not sure what your issue is.

    No problem with continuing through this topic thread, because it's related (and you're the same person!)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jaleco
    jaleco over 11 years ago

    Hi Andrew,

    I am trying to use a form field to pass a value to ?wantPoints, and to make this dynamic such that if the field value is changed, that ?wantPoints would be updated, but this does not seem to be possible.  Once I have begun the enterPoints() function, ?wantPoints is fixed. So the solution to this is to de-couple the form from enterPoints(), using a button to launch enterPoints() once the form field values have been defined (user has a chance to change them).  If you know of a better way, please share.

    I also got a solution for deleting duplicate points in the points list within the ?addPointsProc, using (surprise) deletePoint(), where I had been trying to manipulate the points list and re-assign it to the form.  Reassigning the points list was not working for me.  The code below works as the callback for ?addPointProc to delete duplicate points:

    procedure(CCSdelPt(win ptList)
     println(ptList)
     ptList=reverse(ptList)
     when(member(car(ptList) cdr(ptList))
      deletePoint()
      ); when
    ); procedure CCSdelPt

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

     I think you'd probably need to use changeEnterFun() to do that (the first thing). But I've not tried...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jaleco
    jaleco over 11 years ago

    Andrew,

    you were right, I was able to reset ?wantPoints using changeEnterFun().

    Could you offer any advice about the ?delPointProc portion of enterPoints()?  I don't see how to actually delete, or undo a point while enterPoints is collecting keyboard/mouse entries....I've tried testing with the Escape and Delete keys, and the bindkey for "undo".  None seem to trigger the ?delPointProc...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    Hit backspace - this is the key normally used to delete a point already entered - and that would delete the last point and trigger the delPointProc.

    It corresponds to the deletePoint() function.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 7 years ago in reply to Andrew Beckett

    Hello Andrew,

    I'm getting a loop of events as you mentioned. It will ask for points and run the MyDoneProc and then it will go back to the enterPoints function on loop.

    You also mentioned this:

    Andrew Beckett said:
    Then also try turning off Repeat Commands and see what happens.

    I don't really know how to do it. But the script I'm writing should be for usable by different numbers of user which I'm guessing might or might not have the "Repeat Commands" turned off.

    If I pre-established the number of points with the ?wantPoints enterPoints procedure will terminate and my script will continue.

    Do you know what I'm doing wrong or a solution to this problem?

    Best Regards,

    Ines Martins

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to FormerMember

    Hi Ines,

    You could use envGetVal("layout" "modalCommands") to get the current value of the "repeat commands" setting, and then envSetVal("layout" "modalCommands" 'boolean nil) to turn it off. Potentially you could restore the value afterwards...

    Note that same setting exists for schematic too too (i.e. envGetVal("schematic" "modalCommands") ).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information