PlotMSPlotTab.qo.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef PLOTMSPLOTTAB_QO_H_
00028 #define PLOTMSPLOTTAB_QO_H_
00029
00030 #include <plotms/GuiTabs/PlotMSPlotTab.ui.h>
00031 #include <plotms/GuiTabs/PlotMSTab.qo.h>
00032 #include <plotms/PlotMS/PlotMSConstants.h>
00033 #include <plotms/Plots/PlotMSPlotManager.h>
00034
00035 namespace casa {
00036
00037
00038 class PlotMSAxesTab;
00039 class PlotMSCacheTab;
00040 class PlotMSCalibrationTab;
00041 class PlotMSCanvasTab;
00042 class PlotMSDataTab;
00043 class PlotMSDisplayTab;
00044 class PlotMSIterateTab;
00045 class PlotMSExportTab;
00046 class PlotMSTransformationsTab;
00047 class PlotMSPlotTab;
00048
00049
00050
00051
00052 class PlotMSPlotSubtab : public PlotMSTab {
00053 Q_OBJECT
00054
00055 public:
00056
00057 PlotMSPlotSubtab(PlotMSPlotTab* plotTab, PlotMSPlotter* parent);
00058
00059
00060 virtual ~PlotMSPlotSubtab();
00061
00062
00063
00064
00065
00066 virtual void getValue(PlotMSPlotParameters& params) const = 0;
00067 virtual void setValue(const PlotMSPlotParameters& params) = 0;
00068
00069
00070
00071
00072 virtual void update(const PlotMSPlot& plot) = 0;
00073
00074
00075
00076
00077 virtual void parametersHaveChanged(const PlotMSWatchedParameters& params,
00078 int updateFlag) { (void)params,(void)updateFlag; }
00079
00080
00081
00082 signals:
00083
00084
00085 void changed();
00086
00087 protected:
00088
00089 PlotMSPlotTab* itsPlotTab_;
00090
00091
00092
00093 PlotMSPlotParameters currentlySetParameters() const;
00094 };
00095
00096
00097
00098
00099
00100 class PlotMSPlotTab : public PlotMSTab, Ui::PlotTab
00101 {
00102 Q_OBJECT
00103
00104
00105 friend class PlotMSPlot;
00106 friend class PlotMSPlotter;
00107
00108 public:
00109
00110 PlotMSPlotTab(PlotMSPlotter* parent, int plotIndex = -1);
00111
00112
00113 ~PlotMSPlotTab();
00114
00115
00116
00117 QString tabName() const { return "Plot"; }
00118
00119
00120
00121 QList<QToolButton*> toolButtons() const;
00122
00123
00124
00125
00126 void parametersHaveChanged(const PlotMSWatchedParameters& params,
00127 int updateFlag);
00128
00129
00130 void plotsChanged(const PlotMSPlotManager& manager, int index=-1, bool show = true);
00131
00132
00133 PlotMSDataTab* getData();
00134 String getFileName() const;
00135
00136 String getAveragingSummary() const;
00137
00138
00139 PlotMSPlot* currentPlot() const;
00140
00141
00142
00143 PlotMSPlotParameters currentlySetParameters() const;
00144
00145
00146
00147 vector<PMS::Axis> selectedLoadAxes() const {
00148 return selectedLoadOrReleaseAxes(true);
00149 }
00150
00151
00152 vector<PMS::Axis> selectedReleaseAxes() const {
00153 return selectedLoadOrReleaseAxes(false);
00154 }
00155
00156
00157
00158 bool setGridSize( int rowCount, int colCount );
00159
00160
00161 void getLocation( Int& rowIndex, Int& colIndex );
00162
00163
00164 void removePlot();
00165
00166
00167
00168 bool isPlottable() const;
00169
00170
00171
00172
00173 void completePlotting( bool success );
00174
00175
00176 void clearData();
00177
00178 bool managesPlot( PlotMSPlot* plot ) const;
00179
00180 public slots:
00181
00182
00183 bool plot( bool forceReload);
00184
00185
00186 protected:
00187
00188 void clearSubtabs();
00189
00190
00191 void clearAfter(int index);
00192
00193
00194 void addSubtab(PlotMSPlotSubtab* tab);
00195
00196
00197 void insertSubtab(int index, PlotMSPlotSubtab* tab);
00198
00199
00200
00201
00202 PlotMSAxesTab* addAxesSubtab();
00203 PlotMSAxesTab* insertAxesSubtab(int index);
00204
00205 void insertAxes(int index);
00206 PlotMSCacheTab* addCacheSubtab();
00207 PlotMSCacheTab* insertCacheSubtab(int index);
00208 void insertCache(int index);
00209 PlotMSCalibrationTab* addCalibrationSubtab();
00210 PlotMSCalibrationTab* insertCalibrationSubtab(int index);
00211 void insertCalibration(int index);
00212 PlotMSCanvasTab* addCanvasSubtab();
00213 PlotMSCanvasTab* insertCanvasSubtab(int index);
00214 void insertCanvas(int index);
00215 PlotMSDataTab* addDataSubtab();
00216 PlotMSDataTab* insertDataSubtab(int index);
00217 void insertData(int index);
00218 PlotMSDisplayTab* addDisplaySubtab();
00219 PlotMSDisplayTab* insertDisplaySubtab(int index);
00220 void insertDisplay(int index);
00221 PlotMSIterateTab* addIterateSubtab();
00222 PlotMSIterateTab* insertIterateSubtab(int index);
00223 void insertIterate(int index);
00224
00225 PlotMSTransformationsTab* addTransformationsSubtab();
00226 PlotMSTransformationsTab* insertTransformationsSubtab(int index);
00227 void insertTransformations(int index);
00228
00229
00230
00231
00232 template <class T>
00233 T* subtab() {
00234 T* t;
00235 foreach(PlotMSPlotSubtab* tab, itsSubtabs_)
00236 if((t = dynamic_cast<T*>(tab)) != NULL) return t;
00237 return NULL;
00238 }
00239
00240 private:
00241
00242 PlotMSDataTab* findOrCreateDataTab();
00243 PlotMSIterateTab* findIterateTab() const;
00244 PlotMSDisplayTab* findDisplayTab();
00245 PlotMSAxesTab* findAxesTab();
00246
00247
00248 QList<PlotMSPlotSubtab*> itsSubtabs_;
00249
00250
00251
00252 PlotMSPlotManager& itsPlotManager_;
00253
00254
00255 PlotMSPlot* itsCurrentPlot_;
00256
00257
00258 PlotMSPlotParameters* itsCurrentParameters_;
00259
00260
00261
00262 bool itsUpdateFlag_;
00263 bool closing;
00264 int plotIndex;
00265
00266 int forceReloadCounter_;
00267
00268
00269 void setupForPlot();
00270
00271
00272
00273 vector<PMS::Axis> selectedLoadOrReleaseAxes(bool load) const;
00274
00275 private slots:
00276
00277
00278
00279 void tabChanged();
00280
00281
00282 void changeAxisIdentifier( int index, QString id );
00283
00284
00285 void removeAxisIdentifier( int index );
00286
00287
00288
00289 };
00290
00291 }
00292
00293 #endif