PlotMSAxisWidget.qo.h

Go to the documentation of this file.
00001 //# PlotMSAxisWidget.qo.h: Widget for choosing a single axis.
00002 //# Copyright (C) 2009
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 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: $
00027 #ifndef PLOTMSAXISWIDGET_QO_H_
00028 #define PLOTMSAXISWIDGET_QO_H_
00029 
00030 #include <plotms/Gui/PlotMSAxisWidget.ui.h>
00031 
00032 #include <casaqt/QtUtilities/QtEditingWidget.qo.h>
00033 #include <plotms/PlotMS/PlotMSConstants.h>
00034 #include <casaqt/QtUtilities/QtUtilities.h>
00035 
00036 namespace casa {
00037 
00038 //# Forward declarations.
00039 class PlotRangeWidget;
00040 
00041 
00042 // Widget for choosing a single axis.
00043 class PlotMSAxisWidget : public QtEditingWidget, Ui::AxisWidget {
00044     Q_OBJECT
00045     
00046 public:
00047     // Constructor which takes optional parent widget.
00048     PlotMSAxisWidget(PMS::Axis defaultAxis, int attachAxes,
00049             QWidget* parent = NULL);
00050     
00051     // Destructor.
00052     ~PlotMSAxisWidget();
00053     
00054     // Returns the labels used in the widget.
00055     // <group>
00056     QLabel* dataLabel() { return AxisWidget::dataLabel; }
00057     QLabel* attachLabel() { return AxisWidget::attachLabel; }
00058     QLabel* rangeLabel() { return AxisWidget::rangeLabel; }
00059     QLabel* axisLabel(){
00060         return AxisWidget::axisLabel;
00061     }
00062     // </group>
00063     
00064     // Gets the current set values in the widget.
00065     // <group>
00066     PMS::Axis axis() const;
00067     PMS::DataColumn data() const;
00068     PlotAxis attachAxis() const;
00069     bool matchesData(const PlotMSAxisWidget* other ) const;
00070     bool rangeCustom() const;
00071     prange_t range() const;
00072     // </group>
00073 
00074     // set default custom range according to chosen MS
00075     void setRange(bool isDate, double from, double to);
00076     
00077     // Sets the displayed value to the given.
00078     void setValue(PMS::Axis axis, PMS::DataColumn data, PlotAxis attachAxis,
00079             bool rangeCustom, prange_t range);
00080     
00081     // Sets the "in cache" checkbox to the given.
00082     void setInCache(bool inCache);
00083     void insertLabelDefaults( QMap<QLabel*,QString>& map );
00084 
00085     //Returns an identifier for this axis data.
00086     QString getIdentifier() const;
00087 
00088 signals:
00089         void axisIdentifierChanged(PlotMSAxisWidget*);
00090         void axisChanged();
00091 
00092 private:
00093     void initPlotAxis(int attachAxis);
00094     void setAttachAxis(PlotAxis attachAxis );
00095 
00096     // Widget for the range.
00097     PlotRangeWidget* itsRangeWidget_;
00098 
00099     
00100 private slots:
00101     // Slot for when the axis value changed.
00102     void axisChanged(const QString& value);
00103     void axisDataChanged();
00104 
00105 };
00106 
00107 }
00108 
00109 #endif /* PLOTMSAXISWIDGET_QO_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1