casa
5.7.0-16
|
Abstract class to control a threaded operation from the GUI. More...
#include <PlotMSThread.qo.h>
Signals | |
void | finishedOperation (PlotMSThread *thread) |
This signal MUST be emitted after start() has been called, and when the operation has finished. More... | |
void | updateProgress (unsigned int value, const QString &statusStr) |
void | initProgress (const QString &operationName) |
void | finalizeProgress () |
Public Member Functions | |
PlotMSThread (QtProgressWidget *progress, PMSPTMethod postThreadMethod=NULL, PMSPTObject postThreadObject=NULL) | |
Constructor which takes the progress widget to use, and an optional post-thread method that should be called when the thread is finished. More... | |
virtual | ~PlotMSThread () |
Destructor. More... | |
virtual void | startOperation ()=0 |
ABSTRACT METHODS //. More... | |
virtual void | finished () |
IMPLEMENTED METHODS //. More... | |
virtual void | initializeProgress (const casacore::String &operationName) |
Overridden from BackgroundThread in order to update the progress widget on the GUI thread. More... | |
virtual void | setProgress (unsigned int progress, const casacore::String &status) |
virtual void | finishProgress () |
int | getId () |
virtual QString | getName () const =0 |
virtual bool | isCacheThread () const |
Public Member Functions inherited from casa::ThreadController | |
ThreadController (ProgressMonitor *progress, PMSPTMethod postThreadMethod=NULL, PMSPTObject postThreadObject=NULL) | |
Constructor which takes the progress widget to use, and an optional post-thread method that should be called when the thread is finished. More... | |
virtual | ~ThreadController () |
virtual void | setError (const casacore::String &errorMessage) |
virtual void | setStatus (const casacore::String &status) |
Allows the cache to set the status. More... | |
virtual void | setProgress (unsigned int progress) |
Allows the cache to set the progress. More... | |
virtual void | setAllowedOperations (bool background, bool pauseResume, bool cancel) |
Work classes can specify whether they support background operation, pause/resume, and cancelling. More... | |
virtual bool | wasCanceled () const |
Callback for classes doing the work to check whether they should cancel what they are doing or not. More... | |
void | setWorkThread (BackgroundThread *workThread) |
virtual void | background () |
For when the user requests "background" for the thread. More... | |
virtual void | pause () |
For when the user requests "pause" for the thread. More... | |
virtual void | resume () |
For when the user requests "resume" for the thread. More... | |
virtual void | cancel () |
For when the user requests "cancel" for the thread. More... | |
virtual void | postThreadMethod () |
Executes the post-thread method as needed. More... | |
bool | getResult () const |
Returns the result of the background operation. More... | |
casacore::String | getError () const |
Returns any error from the background operation. More... | |
bool | isErrorWarning () const |
casacore::String | getErrorTitle () const |
PlotMSPlot * | getPlot () |
Protected Slots | |
void | cancelThread () |
For when the user requests "cancel" for the thread. More... | |
Protected Member Functions | |
virtual void | threadFinished () |
Allows subclasses to override and do any clean-up they need to once the background thread has completed. More... | |
void | signalFinishedOperation (PlotMSThread *thread) |
Signal that clean-up and thread work is done. More... | |
Protected Member Functions inherited from casa::ThreadController | |
void | startThread () |
Starts the thread. More... | |
Protected Member Functions inherited from casa::ThreadCommunication | |
ThreadCommunication () | |
virtual | ~ThreadCommunication () |
Private Slots | |
void | backgroundThread () |
For when the user requests "background" for the thread. More... | |
void | pauseThread () |
For when the user requests "pause" for the thread. More... | |
void | resumeThread () |
For when the user requests "resume" for the thread. More... | |
Private Attributes | |
int | id |
Additional Inherited Members | |
Protected Attributes inherited from casa::ThreadController | |
volatile bool | wasCanceled_ |
Flag for whether thread was canceled or not. More... | |
casacore::String | error |
Holds error messages. More... | |
casacore::String | errorTitle |
bool | errorWarning |
ProgressMonitor * | itsProgressWidget_ |
Progress widget. More... | |
PMSPTMethod * | itsPostThreadMethod_ |
Method/Object to run when thread is finished. More... | |
PMSPTObject | itsPostThreadObject_ |
Abstract class to control a threaded operation from the GUI.
Classes that want to run PlotMSThreads should: 1) Provide a QtProgressWidget in the main (GUI) thread. 2) Connect the finishedOperation() signal to a slot as needed. 3) Call startOperation() to start the thread. 4) Call the post-thread method after completion, if there is one.
Definition at line 44 of file PlotMSThread.qo.h.
casa::PlotMSThread::PlotMSThread | ( | QtProgressWidget * | progress, |
PMSPTMethod | postThreadMethod = NULL , |
||
PMSPTObject | postThreadObject = NULL |
||
) |
Constructor which takes the progress widget to use, and an optional post-thread method that should be called when the thread is finished.
|
virtual |
Destructor.
|
privateslot |
For when the user requests "background" for the thread.
|
protectedslot |
For when the user requests "cancel" for the thread.
|
signal |
|
virtual |
IMPLEMENTED METHODS //.
Reimplemented from casa::ThreadController.
|
signal |
This signal MUST be emitted after start() has been called, and when the operation has finished.
The thread parameter points to the thread that has just completed.
|
virtual |
Reimplemented from casa::ThreadController.
int casa::PlotMSThread::getId | ( | ) |
|
pure virtual |
Implemented in casa::PlotMSCacheThread, casa::PlotMSDrawThread, and casa::PlotMSExportThread.
|
virtual |
Overridden from BackgroundThread in order to update the progress widget on the GUI thread.
Reimplemented from casa::ThreadController.
|
signal |
|
virtual |
Reimplemented in casa::PlotMSCacheThread.
|
privateslot |
For when the user requests "pause" for the thread.
|
privateslot |
For when the user requests "resume" for the thread.
|
virtual |
Reimplemented from casa::ThreadController.
|
protected |
Signal that clean-up and thread work is done.
|
pure virtual |
ABSTRACT METHODS //.
Abstract method which does the operation. IMPORTANT: subclasses MUST emit the finished() signal when finished.
Implemented in casa::PlotMSCacheThread, casa::PlotMSDrawThread, and casa::PlotMSExportThread.
|
inlineprotectedvirtual |
Allows subclasses to override and do any clean-up they need to once the background thread has completed.
Reimplemented in casa::PlotMSCacheThread, and casa::PlotMSExportThread.
Definition at line 90 of file PlotMSThread.qo.h.
|
signal |
|
private |
Definition at line 109 of file PlotMSThread.qo.h.