casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotMSAxisWidget.qo.h
Go to the documentation of this file.
1 //# PlotMSAxisWidget.qo.h: Widget for choosing a single axis.
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 PLOTMSAXISWIDGET_QO_H_
28 #define PLOTMSAXISWIDGET_QO_H_
29 
30 #include <plotms/Gui/PlotMSAxisWidget.ui.h>
31 
35 
36 namespace casa {
37 
38 //# Forward declarations.
39 class PlotRangeWidget;
40 
41 
42 // Widget for choosing a single axis.
43 class PlotMSAxisWidget : public QtEditingWidget, Ui::AxisWidget {
44  Q_OBJECT
45 
46 public:
47  // Constructor which takes optional parent widget.
48  PlotMSAxisWidget(PMS::Axis defaultAxis, int attachAxes,
49  QWidget* parent = NULL);
50 
51  // Destructor.
53 
54  // Returns the labels used in the widget.
55  // <group>
56  QLabel* axisLabel() { return AxisWidget::axisLabel;}
57  QLabel* dataLabel() { return AxisWidget::dataLabel; }
58  QLabel* interpLabel() { return AxisWidget::interpLabel; }
59  QLabel* refFrameLabel() { return AxisWidget::refFrameLabel; }
60  QLabel* attachLabel() { return AxisWidget::attachLabel; }
61  QLabel* rangeLabel() { return AxisWidget::rangeLabel; }
62 
63  // </group>
64 
65  // Gets the current set values in the widget.
66  // <group>
67  PMS::Axis axis() const;
68  PMS::DataColumn data() const;
69  PMS::InterpMethod interpMethod() const;
70  PMS::CoordSystem refFrame() const;
71  PlotAxis attachAxis() const;
72  bool matchesData(const PlotMSAxisWidget* other ) const;
73  bool rangeCustom() const;
74  prange_t range() const;
75  // </group>
76 
77  // set default custom range according to chosen MS
78  void setRange(bool isDate, double from, double to);
79 
80  // Sets the displayed value to the given.
81  void setValue(PMS::Axis axis, PMS::DataColumn data, PlotAxis attachAxis,
82  bool rangeCustom, prange_t range);
83 
84  // Sets the displayed direction parameters values to the given
85  void setDirParams(PMS::InterpMethod interp, PMS::CoordSystem refFrame);
86 
87  // Sets the "in cache" checkbox to the given.
88  void setInCache(bool inCache);
89  void insertLabelDefaults( QMap<QLabel*,QString>& map );
90 
91  //Returns an identifier for this axis data.
92  QString getIdentifier() const;
93 
94 signals:
96  void axisChanged();
97 
98 private:
99  void initPlotAxis(int attachAxis);
101 
102  // Widget for the range.
104 
105 private slots:
106  // Slot for when the axis value changed.
107  void axisChanged(const QString& value);
108  void axisDataChanged();
109  void axisInterpChanged();
110  void axisRefFrameChanged();
111 
112 };
113 
114 }
115 
116 #endif /* PLOTMSAXISWIDGET_QO_H_ */
bool matchesData(const PlotMSAxisWidget *other) const
void setDirParams(PMS::InterpMethod interp, PMS::CoordSystem refFrame)
Sets the displayed direction parameters values to the given.
Widget for selecting a plot axis range.
PMS::Axis axis() const
Gets the current set values in the widget.
void initPlotAxis(int attachAxis)
void setAttachAxis(PlotAxis attachAxis)
QLabel * axisLabel()
Returns the labels used in the widget.
void insertLabelDefaults(QMap< QLabel *, QString > &map)
PlotAxis attachAxis() const
PMS::InterpMethod interpMethod() const
void axisIdentifierChanged(PlotMSAxisWidget *)
PlotRangeWidget * itsRangeWidget_
Widget for the range.
PMS::DataColumn data() const
prange_t range() const
PlotMSAxisWidget(PMS::Axis defaultAxis, int attachAxes, QWidget *parent=NULL)
Constructor which takes optional parent widget.
PlotAxis
Enum for the four plot axes.
Definition: PlotOptions.h:62
void setValue(PMS::Axis axis, PMS::DataColumn data, PlotAxis attachAxis, bool rangeCustom, prange_t range)
Sets the displayed value to the given.
~PlotMSAxisWidget()
Destructor.
std::pair< double, double > prange_t
Typedef for range, which is two doubles (min and max).
Definition: PlotOptions.h:41
bool rangeCustom() const
QString getIdentifier() const
Returns an identifier for this axis data.
void setInCache(bool inCache)
Sets the &quot;in cache&quot; checkbox to the given.
A simple parent for editing widgets.
void setRange(bool isDate, double from, double to)
set default custom range according to chosen MS
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
PMS::CoordSystem refFrame() const
Widget for choosing a single axis.