• 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. hiDisplayProgressBox callback function and more

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 143
  • Views 15164
  • 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

hiDisplayProgressBox callback function and more

ToMWUT
ToMWUT over 15 years ago

I've got a question concerning hiDisplayProgressBox function. I have a code which creates the progress box, where I use the ?callback argument with the function name:

hiDisplayProgressBox(?name 'pb ?banner nazwa ?text opis ?callback ''inscheme(gui_package->cancel()'' ?totalSteps liczba_krokow ?autoClose auto_close)

Now the problem is that callback function isn't called either I press the „Cancel” button on the progress box nor the progress indicator reaches 100%. Even when I put into the callback name of the function that doesn't exists nothing happens, no error or anything... Where is the problem?

I thought that when I'll be able to solve this problem with your help I've got other questions. First of all according to the manual the progress box callback function is called when I press cancel button or when the progress indicator reaches 100%. My question now is if it is possible to call some function only when I press cancel button? The reason why I would like to do this, is that I call a function which creates progress box everywhere in my code when I'm expecting that some long operations might occur – it is quite obvious. And now after pressing this cancel button I would like to call a procedure which would stop all the actions. Is it even possible in SKILL to write such a procedure? I mean procedure that wouldn't kill Cadence and just stop all SKILL actions?

Thanks ToM

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    Hi ToM,

    I think the problem is that you have made a typo in your callback. It should be inScheme() not inscheme(). Also, if you do an importSkillVar(gui_package) at the top of your SKILL++ code you don't need to do the inScheme() at all. The trouble is that errors in the callback function are swallowed (with errset) so you're not seeing the error. I managed to have a callback invoked from both the cancel button and completion of the progress bar when I tried it.

    Since SKILL is single threaded, there's no concept of being able to stop SKILL actions. Assuming that your application allows some interaction with the GUI whilst it's running, then the way to do this is probably to set some kind of semaphore to indicate that the action has been cancelled, and have lengthy SKILL code periodically check this semaphore and then exit what it is doing. 

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ToMWUT
    ToMWUT over 15 years ago

    And is there any way just to call procedure in ?callback of the hiDisplayProgressBox function only when user clicks „cancel” button and not when the progress indicator reaches 100%? It would be very useful for me.

    Thanks ToM

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

    ToM,

    I don't believe so, but you can always use hiGetProgress() in a conditional statement within your callback, to detect whether it's at 100% or not (you may want hiGetProgressTotalSteps() too), and then selectively perform some action or not.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ToMWUT
    ToMWUT over 15 years ago

      That is a very good idea Andrew, but the problem is that because of a bug in Cadence to properly close the progressBox you have to call hiCancelProgressBox(pb) when hiGetProgressTotalSteps(pb)==hiGetProgress(pb)  condition is true. And the same function would be called if I press cancel button where I cannot rely on the condition mentioned by you because it will also be true for standard close of the box, when it hits 100%, because of the bug. Is there any way to overcome this issue?

     

    ToM

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ToMWUT
    ToMWUT over 15 years ago

     Any ideas? :)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago
    ToM,

    I'm in the US in meetings all day; I need to do some quick experiments before I can answer.

    Regards,

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

    ToM,

    Having looked at this, the only way I can see is to keep track of whether you have reached 100% yourself. In other words,  do something like this:

      when(MYpb MYpb->MYprogress=progressNum)
      hiSetProgress(MYpb progressNum++)

    where MYpb is the variable containing the progress bar. I'm storing the progress number as a property on the progress bar itself, and then in the callback I can check MYpb->MYprogress to see where it got to.

    It's a little unfortunate the hiGetProgress() within the callback returns -1 - this would have been the easiest  approach to detect. Or if hiIsProgressBoxCancelled() distinguished between auto-completed and cancelled. But unfortunately it doesn't...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ToMWUT
    ToMWUT over 15 years ago

     Yes Andrew, all this is a little bit tricky... but I did it your way and it seems to work fine. Thanks.

    ToM

    • 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