#227 Add a stop button

Enhancement
closed-fixed
8
2016-04-30
2010-11-08
David Benn
No

Add a stop button to the toolbar or status pane.

I have already done most of the work towards this but didn't quite get it working. Nico also has also done a nice stop button for us, and Bikeman reminded me about the need for being able to interrupt DC DFT etc, so I should revisit this.

Discussion

  • Sara Beck

    Sara Beck - 2011-01-06

    Also related to tracker 2866594.

     
  • David Benn

    David Benn - 2011-05-21

    Doug Welch reported a long-running DC DFT scan recently, reminding me about the need to implement this.

     
  • David Benn

    David Benn - 2011-05-21
    • priority: 8 --> 9
     
  • David Benn

    David Benn - 2011-05-21

    The GUI event dispatch thread can send a StopRequestMessage to which any object can listen, e.g. a period analysis plugin. The listener can set a flag which is checked frequently and which results in an exception being thrown, e.g. StoppedException. The key thing is that the flag is set by a different thread from the one that checks it. This paves the way for a race condition, so R/W access to that flag will need to be synchronised; consider using a newer style Java lock.

     
  • David Benn

    David Benn - 2011-05-27

    Initial implementation in http://vstar.svn.sourceforge.net/viewvc/vstar?view=revision&revision=757

    This works for period analysis with no additional overhead by calling the Mediator function stopCurrentTask() I had put in place months ago.

    For other tasks such as file and database I/O, I suspect that the StopRequestMessage will need to be listened to by concrete observation readers, and in response to the stop button click, a flag set by the event dispatch thread in instances of those classes, and an exception thrown upon detection of that flag by the SwingWorker thread in which the I/O is taking place. The latter will catch the exception in the task's doInBackground() method, ending the operation. That's the theory anyway. :)

     
  • David Benn

    David Benn - 2011-06-24

    This works for all AbstractObservationRetriever subclasses now, at least insofar as the interrupted flag can be checked regularly, true for file I/O.

    What's missing is being able to interrupt database connections and reads. Need to add as many checks for interrupted flag as possible. Database reads could also be broken up to increase the granularity of checks after initial database connection.

     
  • David Benn

    David Benn - 2012-07-08
    • priority: 9 --> 8
     
  • David Benn

    David Benn - 2016-04-30
    • status: open --> closed-fixed
     
  • David Benn

    David Benn - 2016-04-30

    This now also works for load from AID as of 2.17.0 since web service calls are used.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks