casa
$Rev:20696$
|
00001 //# PlotMSParameters.h: Parameter classes for plotms. 00002 //# Copyright (C) 2008 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# 00025 //# $Id: $ 00026 #ifndef PLOTMSPARAMETERS_H_ 00027 #define PLOTMSPARAMETERS_H_ 00028 00029 #include <plotms/PlotMS/PlotMSConstants.h> 00030 #include <plotms/PlotMS/PlotMSWatchedParameters.h> 00031 00032 #include <casa/namespace.h> 00033 00034 namespace casa { 00035 00036 // Subclass of PlotMSWatchedParameters that hold parameters for the whole 00037 // plotter. These parameters include: 00038 // * log file name 00039 // * log events flag 00040 // * log minimum priority filter 00041 // * whether to clear any selections when axes are changed or not 00042 // * width and height for the cached image 00043 class PlotMSParameters : public PlotMSWatchedParameters { 00044 public: 00045 // Static // 00046 00047 // Update flags. 00048 // <group> 00049 static const int UPDATE_LOG; 00050 static const int UPDATE_PLOTMS_OPTIONS; 00051 // </group> 00052 00053 // Gets/Sets the file chooser history limit. (See QtFileDialog.) Static 00054 // parameter. 00055 // <group> 00056 static int chooserHistoryLimit(); 00057 static void setChooserListoryLimit(int histLimit); 00058 // </group> 00059 00060 00061 // Non-Static // 00062 00063 // Constructor, with default values for parameters. 00064 PlotMSParameters(const String& logFilename = PMS::DEFAULT_LOG_FILENAME, 00065 int logEvents = PMS::DEFAULT_LOG_EVENTS, 00066 LogMessage::Priority logPriority = PMS::DEFAULT_LOG_PRIORITY, 00067 bool clearSelections = PMS::DEFAULT_CLEAR_SELECTIONS, 00068 int cachedImageWidth = PMS::DEFAULT_CACHED_IMAGE_WIDTH, 00069 int cachedImageHeight = PMS::DEFAULT_CACHED_IMAGE_HEIGHT); 00070 00071 // Copy constructor. See operator=(). 00072 PlotMSParameters(const PlotMSParameters& copy); 00073 00074 // Destructor. 00075 ~PlotMSParameters(); 00076 00077 00078 // Gets/Sets the log sink location/filename. 00079 // <group> 00080 String logFilename() const; 00081 void setLogFilename(const String& filename); 00082 // </group> 00083 00084 // Returns the current log events. 00085 int logEvents() const; 00086 00087 // Returns the current log minimum priority. 00088 LogMessage::Priority logPriority() const; 00089 00090 // Sets the current log filter. 00091 void setLogFilter(int logEvents, LogMessage::Priority priority); 00092 00093 // Gets/Sets whether any selections are cleared when plot axes are changed 00094 // or not. 00095 // <group> 00096 bool clearSelectionsOnAxesChange() const; 00097 void setClearSelectionsOnAxesChange(bool flag); 00098 // </group> 00099 00100 // Gets/Sets the cached image size. See 00101 // PlotCanvas::cachedAxesStackImageSize(). 00102 // <group> 00103 pair<int, int> cachedImageSize() const; 00104 void setCachedImageSize(int width, int height); 00105 // </group> 00106 00107 // Sets the cached image size to the current screen resolution. 00108 void setCachedImageSizeToResolution(); 00109 00110 // Copy operator. 00111 PlotMSParameters& operator=(const PlotMSParameters& copy); 00112 00113 00114 // Implements PlotMSWatchedParameters::equals(). Will return false if the 00115 // other parameters are not of type PlotMSParameters. 00116 bool equals(const PlotMSWatchedParameters& other, int updateFlags) const; 00117 00118 private: 00119 // Log filename. 00120 String itsLogFilename_; 00121 00122 // Log events flag. 00123 int itsLogEvents_; 00124 00125 // Log minimum priority. 00126 LogMessage::Priority itsLogPriority_; 00127 00128 // Clear selections on axes change flag. 00129 bool itsClearSelectionsOnAxesChange_; 00130 00131 // Cached image sizes. 00132 int itsCachedImageWidth_, itsCachedImageHeight_; 00133 }; 00134 00135 } 00136 00137 #endif /* PLOTMSPARAMETERS_H_ */