casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotMSDrawThread.qo.h
Go to the documentation of this file.
1 //# PlotMSDrawThread.qo.h: Subclass of PlotMSThread for drawing.
2 //# Copyright (C) 2009
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: $
27 #ifndef PLOTMSDRAWTHREAD_QO_H_
28 #define PLOTMSDRAWTHREAD_QO_H_
29 
32 #include <vector>
33 #include <QMutex>
34 
35 namespace casa {
36 
37 //# Forward Declarations
38 class PlotMSPlotter;
39 class QtProgressWidget;
40 
41 // Subclass of PlotMSThread that handles following the progress of canvas
42 // drawing.
44  Q_OBJECT
45 
46 public:
47  // Constructor which takes the plotter, and optional post-thread method
48  // parameters.
51  PMSPTObject postThreadObject = NULL);
52 
53  // Destructor.
55 
56 
57  // Updates the internal list of canvases based upon the parent
58  // PlotMSPlotter.
59  void updatePlotterCanvases();
60 
61  // Implements PlotMSThread::startOperation().
62  virtual void startOperation();
63 
64  bool isDrawing() const;
65 
66  // Implements PlotOperationWatcher::operationChanged().
67  void operationChanged(const PlotOperation& operation);
68 
69  virtual QString getName() const;
70 
71 protected:
72 
73 
74  void cancel();
75 
76 private:
77  PlotMSDrawThread( const PlotMSDrawThread& other );
80 
81  // Operations.
82  std::vector<PlotOperationPtr> itsOperations_;
83 
84  // casacore::Mutex for accessing operations.
86 
87  // Flag for if thread is currently running or not.
88  bool isRunning_;
89 
90  // Flag indicating that one or more operations tried to call
91  // operationChanged() while the operations mutex was locked.
93 
94 
95 };
96 
97 }
98 
99 #endif /* PLOTMSDRAWTHREAD_QO_H_ */
virtual void postThreadMethod()
Executes the post-thread method as needed.
virtual void startOperation()
Implements PlotMSThread::startOperation().
Simple object to synchronize operation progress information across threads.
Definition: PlotOperation.h:68
PlotMSDrawThread operator=(const PlotMSDrawThread &other)
void cancel()
For when the user requests &quot;cancel&quot; for the thread.
bool itsOperationFlag_
Flag indicating that one or more operations tried to call operationChanged() while the operations mut...
void * PMSPTObject
Typedefs for using post-thread methods.
void updatePlotterCanvases()
Updates the internal list of canvases based upon the parent PlotMSPlotter.
virtual QString getName() const
void operationChanged(const PlotOperation &operation)
Implements PlotOperationWatcher::operationChanged().
Abstract interface for any object that wants to watch a PlotOperation object for changes.
bool isDrawing() const
std::vector< PlotOperationPtr > itsOperations_
Operations.
QMutex itsOperationsMutex_
casacore::Mutex for accessing operations.
Subclass of PlotMSThread that handles following the progress of canvas drawing.
Abstract class to control a threaded operation from the GUI.
void PMSPTMethod(PMSPTObject, bool)
bool isRunning_
Flag for if thread is currently running or not.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of but is it too vague to be useful Since the interface is meant to be a simple plotter
Definition: PlotData.h:48
GUI for displaying progress information.
High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS...
~PlotMSDrawThread()
Destructor.
PlotMSDrawThread(PlotMSPlotter *plotter, QtProgressWidget *progress, PMSPTMethod postThreadMethod=NULL, PMSPTObject postThreadObject=NULL)
Constructor which takes the plotter, and optional post-thread method parameters.