casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotMSAction.h
Go to the documentation of this file.
1 //# PlotMSAction.h: Actions on plotms that can be triggered.
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 PLOTMSACTION_H_
28 #define PLOTMSACTION_H_
29 
32 
33 namespace casa {
34 
35 //# Forward declarations
36 class PlotMSApp;
37 class PlotMSPlot;
38 class Client;
39 class BackgroundThread;
40 
41 // ABSTRACT CLASSES //
42 
43 // Class that implements actions that operate on PlotMS. Actions get their
44 // type from the Type enum and their parameters (if needed) from mappings from
45 // Strings to values. Current parameter value types are: PlotMSPlot*, bool,
46 // casacore::String, int, and vector<PMS::Axis>.
47 class PlotMSAction {
48 public:
49  // Static //
50  // Enum for implemented actions.
51  enum Type {
52  // Selection actions //
53 
54  // Flag the selected regions. Operates on all visible canvases AT THE
55  // TIME of the call to doAction().
56  // No required parameters.
58 
59  // Unflag the selected regions. Operates on all visible canvases AT
60  // THE TIME of the call to doAction().
61  // No required parameters.
63 
64  // Locate on the selected regions. Operates on all visible canvases
65  // AT THE TIME of the call to doAction().
66  // No required parameters.
68 
69  // Get metadata of points in the selected regions. Operates on all
70  // visible canvases AT THE TIME of the call to doAction().
71  // No required parameters.
73 
74  // Clear the selected regions. Operates on all visible canvases AT
75  // THE TIME of the call to doAction().
76  // No required parameters.
78 
79 
80  // Iteration actions //
81 
82  // Go to the first page of iteration.
83  // No required parameters.
84  // NOT IMPLEMENTED.
86 
87  // Go to the previous page of iteration.
88  // No required parameters.
89  // NOT IMPLEMENTED.
91 
92  // Go to the next page of iteration.
93  // No required parameters.
94  // NOT IMPLEMENTED.
96 
97  // Go to the last page of iteration.
98  // No required parameters.
99  // NOT IMPLEMENTED.
101 
102 
103  // Tool actions //
104 
105  // Turns on/off the mark regions tool. Operates on all canvases of all
106  // plots AT THE TIME of the call to doAction(). Only one of the mark
107  // regions, zoom, pan, and annotate tools can be turned on at one time.
108  // Required parameters: P_ON_OFF.
110 
111  // Turns on/off the subtract regions tool.
112  // works like MARK REGIONS, but where user drags, all regions within are deleted.
113  // (note: CAS-1971 DSW)
115 
116  // Turns on/off the zoom tool. Operates on all canvases of all plots
117  // AT THE TIME of the call to doAction(). Only one of the mark
118  // regions, zoom, pan, and annotate tools can be turned on at one time.
119  // Required parameters: P_ON_OFF.
121 
122  // Turns on/off the pan tool. Operates on all canvases of all plots AT
123  // THE TIME of the call to doAction(). Only one of the mark regions,
124  // zoom, pan, and annotate tools can be turned on at one time.
125  // Required parameters: P_ON_OFF.
127 
128  // Turns on/off the annotator tool's different modes. Operates on all
129  // canvases of all plots AT THE TIME of the call to doAction(). Only
130  // one of the mark regions, zoom, pan, and annotate tools can be turned
131  // on at one time.
132  // Required parameters: P_ON_OFF.
133  // <group>
136  // </group>
137 
138  // Turns on/off the per-panel flagging tool.
140 
141  // Turns on/off the tracker tool hover function. Operates on all
142  // canvases of all plots AT THE TIME of the call to doAction().
143  // Required parameters: P_ON_OFF.
145 
146  // Turns on/off the tracker tool display function. Operates on all
147  // canvases of all plots AT THE TIME of the call to doAction().
148  // Required parameters: P_ON_OFF.
150 
151 
152  // casacore::Stack actions //
153 
154  // Goes back in the zoom/pan stack. Operates on all visible canvases
155  // AT THE TIME of the call to doAction().
156  // No required parameters.
158 
159  // Goes to the base of the zoom/pan stack. Operates on all visible
160  // canvases AT THE TIME of the call to doAction().
161  // No required parameters.
163 
164  // Goes forward in the zoom/pan stack. Operates on all visible
165  // canvases AT THE TIME of the call to doAction().
166  // No required parameters.
168 
169 
170  // Cache actions //
171 
172  // Loads axes into the cache. Operates on a single PlotMSPlot.
173  // Required parameters: P_PLOT, P_AXES.
175 
176  // Releases axes from the cache. Operates on a single PlotMSPlot.
177  // Required parameters: P_PLOT, P_AXES.
178  // NOT IMPLEMENTED.
180 
181 
182  // Plot actions //
183 
184  // Display casacore::MS summary info for a specific file.
185  // Required parameters: P_PLOT.
187 
188  //Show the summary dialog for the plot that allows the user
189  //to set up parameters for MS_SUMMARY
191 
192  // Updates any set parameters, which updates the plots.
193  // No required parameters.
195 
196  // Exports a single PlotMSPlot to a file. If format isn't given, it is
197  // set using the file name. If DPI, width, or height aren't set or are
198  // < 0, the default is used.
199  // Required parameters: P_PLOT, P_FILE.
200  // Optional parameters: P_FORMAT, P_HIGHRES, P_DPI, P_WIDTH, P_HEIGHT.
202 
203  //Show a dialog that allows the client to set up export parameters.
205 
206 
207  // Plotter actions //
208 
209  // Holds/releases drawing for all canvases in the PlotMSPlotter.
210  // Required parameters: P_ON_OFF.
212 
213  // Clears all plots and canvases from the PlotMSPlotter.
214  // No required parameters.
216 
217  // Quits PlotMS.
218  // No required parameters.
220 
221  //Open an ms or cal table for plotting.
223  };
224 
225  // Non-Static //
226 
227  // Constructor.
229  std::vector<PlotMSPlot*> postThreadObject = std::vector<PlotMSPlot*>());
230 
231  // Destructor.
232  virtual ~PlotMSAction();
233 
234  // Performs the action, using the given PlotMSApp, and returns true for
235  // success or false or failure.
236  bool doAction(PlotMSApp* plotms);
237 
238  void setUseThreading( bool useThread );
239 
240  virtual bool doActionWithResponse(PlotMSApp* plotms, casacore::Record &retval);
241 
242  // Returns the result of doAction(), if applicable. Usually this is used
243  // to return the error/reason why the action failed.
244  const casacore::String& doActionResult() const;
245 
246 protected:
248  virtual bool loadParameters();
249  virtual bool doActionSpecific( PlotMSApp* plotms ) = 0;
250  void setUpClientCommunication( BackgroundThread* thread, int index );
251  bool initiateWork( BackgroundThread* thread );
253  // Action type.
255 
256  // Result of doAction, if applicable.
259 
260  std::vector<PlotMSPlot*> postThreadObject;
262 private:
263  // Returns true if the action is valid or not. Invalid actions should not
264  // be executed.
265  bool isValid();
266 
267 
268  PlotMSAction( const PlotMSAction& other );
269 
270 };
271 
272 }
273 
274 #endif /* PLOTMSACTION_H_ */
Selection actions //.
Definition: PlotMSAction.h:57
virtual ~PlotMSAction()
Destructor.
Go to the next page of iteration.
Definition: PlotMSAction.h:95
Clear the selected regions.
Definition: PlotMSAction.h:77
virtual bool loadParameters()
bool isValid()
Returns true if the action is valid or not.
Type itsType_
Action type.
Definition: PlotMSAction.h:254
Turns on/off the annotator tool&#39;s different modes.
Definition: PlotMSAction.h:134
Clears all plots and canvases from the PlotMSPlotter.
Definition: PlotMSAction.h:215
ABSTRACT CLASSES //.
Definition: PlotMSAction.h:47
Turns on/off the tracker tool display function.
Definition: PlotMSAction.h:149
Turns on/off the subtract regions tool.
Definition: PlotMSAction.h:114
Iteration actions //.
Definition: PlotMSAction.h:85
Exports a single PlotMSPlot to a file.
Definition: PlotMSAction.h:201
Show the summary dialog for the plot that allows the user to set up parameters for MS_SUMMARY...
Definition: PlotMSAction.h:190
ThreadController * threadController
Definition: PlotMSAction.h:258
virtual bool doActionWithResponse(PlotMSApp *plotms, casacore::Record &retval)
Controller class for plotms.
Definition: PlotMS.h:55
void setUpClientCommunication(BackgroundThread *thread, int index)
Show a dialog that allows the client to set up export parameters.
Definition: PlotMSAction.h:204
Goes forward in the zoom/pan stack.
Definition: PlotMSAction.h:167
Turns on/off the pan tool.
Definition: PlotMSAction.h:126
Turns on/off the per-panel flagging tool.
Definition: PlotMSAction.h:139
Type
Static // Enum for implemented actions.
Definition: PlotMSAction.h:51
Locate on the selected regions.
Definition: PlotMSAction.h:67
Releases axes from the cache.
Definition: PlotMSAction.h:179
A hierarchical collection of named fields of various types.
Definition: Record.h:180
PMSPTMethod * postThreadMethod
Definition: PlotMSAction.h:261
virtual bool doActionSpecific(PlotMSApp *plotms)=0
Abstraction for the interface between the client (possibly a GUI) and the model (plot engine) that is...
Definition: Client.h:45
Goes to the base of the zoom/pan stack.
Definition: PlotMSAction.h:162
Updates any set parameters, which updates the plots.
Definition: PlotMSAction.h:194
bool doAction(PlotMSApp *plotms)
Performs the action, using the given PlotMSApp, and returns true for success or false or failure...
Turns on/off the zoom tool.
Definition: PlotMSAction.h:120
std::vector< PlotMSPlot * > postThreadObject
Definition: PlotMSAction.h:260
bool initiateWork(BackgroundThread *thread)
void PMSPTMethod(PMSPTObject, bool)
Get metadata of points in the selected regions.
Definition: PlotMSAction.h:72
Unflag the selected regions.
Definition: PlotMSAction.h:62
Go to the previous page of iteration.
Definition: PlotMSAction.h:90
casacore::String itsDoActionResult_
Result of doAction, if applicable.
Definition: PlotMSAction.h:257
PlotMSAction(Client *client, PMSPTMethod postThreadMethod=NULL, std::vector< PlotMSPlot * > postThreadObject=std::vector< PlotMSPlot * >())
Non-Static //.
Turns on/off the tracker tool hover function.
Definition: PlotMSAction.h:144
casacore::Stack actions //
Definition: PlotMSAction.h:157
Open an ms or cal table for plotting.
Definition: PlotMSAction.h:222
void setUseThreading(bool useThread)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
const casacore::String & doActionResult() const
Returns the result of doAction(), if applicable.
Manages a thread to do a background operation and communicates back to its controller with regard to ...
Go to the last page of iteration.
Definition: PlotMSAction.h:100