casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotMSDataCollapsible.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2009
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 //# $Id: $
26 #ifndef PLOTMSDATACOLLAPSIBLE_QO_H
27 #define PLOTMSDATACOLLAPSIBLE_QO_H
28 
29 #include <QWidget>
30 #include <casa/BasicSL/String.h>
31 #include <plotms/GuiTabs/PlotMSDataCollapsible.ui.h>
33 #include <plotms/PlotMS/PlotMS.h>
34 
35 class QLineEdit;
36 
37 namespace casa {
38 
39 class PlotMSPlotTab;
40 class PlotMSDataTab;
41 class PlotMSPlotter;
42 
48 class PlotMSDataCollapsible : public QWidget{
49  Q_OBJECT
50 
51 public:
52  PlotMSDataCollapsible(PlotMSPlotter* plotter, QWidget* parent, int plotIndex = -1);
54 
55  //Return the plot tab.
57 
58  //Set the numbers of rows and cols that the page can currently
59  //support.
60  void setGridSize( int rowCount, int colCount );
61 
62  //Return the row and column location for this plot.
63  void getLocation( int& rowIndex, int& colIndex );
64 
65  //Plot parameters have changed.
67  int updateFlag);
68 
69  //Return the minimum size for the plot properties.
70  virtual QSize minimumSizeHint() const;
71 
72  //Return the size.
73  virtual QSize sizeHint() const;
74 
75  //Reset the height based on the positive or negative amount of new space that
76  //is available.
77  void resetHeight( int diff );
78 
79  //The plots being displayed have changed.
80  void plotsChanged(const PlotMSPlotManager& manager, int index);
81 
82  //Returns the plot
84 
85  //Force (or not) the plots to update their displays.
86  bool plot( bool forceReload );
87 
88  //Returns whether or not the plot is displayed by this Collapsible.
89  bool managesPlot(PlotMSPlot* plot ) const;
90 
91  std::vector<PMS::Axis> getSelectedLoadAxes() const;
92  std::vector<PMS::Axis> getSelectedReleaseAxes() const;
93 
94  //Returns whether this plot will be plotted, i.e.,
95  //its gridRow and gridCol are nonnegative AND there is an empty location
96  //for the plot, either at its preferred gridRow and gridCol or at an empty
97  //location somewhere else.
98  bool isPlottable() const;
99 
100  //Change to a compact display
101  void minimizeDisplay();
102  //Change to an expanded display
103  void maximizeDisplay();
104 
105  //Returns whether or not the display is compact (minimized) or expanded.
106  bool isMinimized() const;
107 
108  //This was put in to support overplotting. When two plots are sharing the
109  //same canvas, we don't want to trigger a redraw until all the plots sharing
110  //the same canvas are done updating their data in background threads.
111  void completePlotting( bool success );
112  void clearData();
113 
114  //Return the ms that was loaded or an empty string.
115  casacore::String getFile() const;
116 
117 signals:
119 
120 private slots:
121  void closePlot();
122  void openCloseDisplay();
123  void showContextMenu( const QPoint& location );
124 
125 private:
126 
127 
128  QAction minimizeAction;
129  QAction maximizeAction;
130  QAction closeAction;
132  const int PMS_SIZE_EXPANDED;
133  const int PMS_SIZE_WIDTH;
135 
136  QLineEdit* nameLabel;
138  Ui::PlotMSDataCollapsibleClass ui;
139 };
140 }
141 
142 #endif // PLOTMSDATACOLLAPSIBLE_QO_H
PlotMSDataTab * getSingleData()
Return the plot tab.
casacore::String getFile() const
Return the ms that was loaded or an empty string.
void setGridSize(int rowCount, int colCount)
Set the numbers of rows and cols that the page can currently support.
bool managesPlot(PlotMSPlot *plot) const
Returns whether or not the plot is displayed by this Collapsible.
bool plot(bool forceReload)
Force (or not) the plots to update their displays.
void resetHeight(int diff)
Reset the height based on the positive or negative amount of new space that is available.
void minimizeDisplay()
Change to a compact display.
Subclass of PlotMSTab that handles picking casacore::MS filename, selection, and averaging parameters...
Ui::PlotMSDataCollapsibleClass ui
PlotMSPlot * getPlot()
Returns the plot.
bool isPlottable() const
Returns whether this plot will be plotted, i.e., its gridRow and gridCol are nonnegative AND there is...
virtual QSize minimumSizeHint() const
Return the minimum size for the plot properties.
Abstract class for parameters that may be watched by one or more interested classes.
bool isMinimized() const
Returns whether or not the display is compact (minimized) or expanded.
PlotMSDataCollapsible(PlotMSPlotter *plotter, QWidget *parent, int plotIndex=-1)
void completePlotting(bool success)
This was put in to support overplotting.
void getLocation(int &rowIndex, int &colIndex)
Return the row and column location for this plot.
Class for a single &quot;plot&quot; concept.
Definition: PlotMSPlot.h:57
void close(PlotMSDataCollapsible *)
virtual QSize sizeHint() const
Return the size.
std::vector< PMS::Axis > getSelectedReleaseAxes() const
Represents a single plot&#39;s properties that can be shown maximized or minimized; handles whether a plo...
void plotsChanged(const PlotMSPlotManager &manager, int index)
The plots being displayed have changed.
void showContextMenu(const QPoint &location)
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
String: the storage and methods of handling collections of characters.
Definition: String.h:223
High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS...
void parametersHaveChanged(const PlotMSWatchedParameters &params, int updateFlag)
Plot parameters have changed.
void maximizeDisplay()
Change to an expanded display.
Class which manages PlotMSPlots for plotms.
Subclass of PlotMSTab that manages PlotMSPlots in the GUI.
std::vector< PMS::Axis > getSelectedLoadAxes() const