comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Q: A good way to interrupt and kill procedures?
items: Re: Q: A good way to interrupt and kill procedures?

Q: A good way to interrupt and kill procedures?
type: item
description: I am looking for a sensible way to set up a time-consuming program so it can be interrupted. The time-consuming tasks are image manipulations for astronomical data reduction. They are run with a widget. Ideally, I would like to have a 'kill process' button whose events could be recognized while the data reduction is in progress. Any suggestions? Nancy Levenson Department of Astronomy UC Berkeley levenson@astro.berkeley.edu
creator: Nancy Levenson
date: 1998-05-21T07:00:00-00:00

Re: Q: A good way to interrupt and kill procedures?
type: item
description: Nancy Levenson wrote: > > I am looking for a sensible way to set up a time-consuming program so > it can be interrupted. > > The time-consuming tasks are image manipulations for astronomical data > reduction. They are run with a widget. Ideally, I would like to have > a 'kill process' button whose events could be recognized while the > data reduction is in progress. > > Any suggestions? > > Nancy Levenson > Department of Astronomy > UC Berkeley > levenson@astro.berkeley.edu If your calculation is encoded in some form of loop to which you have access, such that, at any given iteration through the loop, you can figure out what percent complete the calculation is, then you can use the showProg object class (based on a D. Fanning idea) I posted previously here for the purpose of cancelling *and* giving your user an idea of how much time remains. Note that the process can only be cancelled every PERCENT%, which you can choose, and that it is your responsibility to determine when the calculation is PERCENT% complete, for updating the progress bar. An example using showProg, testbar.pro, is also attached. Good Luck, JD *************BEGIN showprog__define.pro********************************* ;+ ; NAME: showProg ; ; PURPOSE: Display a progress bar, and allow user cancellation. ; ; CATEGORY: Objects. Progress indication. ; ; CALLING SEQUENCE: ; Creating a new progress bar: ; bar=obj_new('showProg',OVER=ov,SIZE=sz,MESSAGE=msg, ; TITLE=ttl,CANCEL=cncl) ; Updating the progress bar: ; ret=bar->Update() ; Closing the progress bar. Used only for special cases, such as after ; incorrectly estimating the percent completion. ShowProg usually ; closes at 100% completion or cancel button hit: ; bar->Done ; ; INPUTS: ; PERCENT: The percentage increments that will be supplied ; (defaults to 5 -- for 20 intervals.) The user is responsible ; for updating (with showProg->Update) after each PERCENT% of ; the calculation is complete. ; OVER: The widget_id of a widget for positioning the showPr…
creator: J.D. Smith
date: 1998-05-22T07:00:00-00:00