casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions | Static Private Attributes | List of all members
casa::PlotMSLabelFormat Class Reference

Class for generating labels based upon axes, units, etc. More...

#include <PlotMSLabelFormat.h>

Public Member Functions

 PlotMSLabelFormat (const casacore::String &format="")
 Non-Static //. More...
 
 PlotMSLabelFormat (const PlotMSLabelFormat &copy)
 Copy constructor. More...
 
 ~PlotMSLabelFormat ()
 Destructor. More...
 
casacore::String getLabel (PMS::Axis axis, bool refValueSet=false, double refValue=0, PMS::DataColumn data=PMS::DATA, bool polnRatio=false) const
 Generates a label, using the given single axis and reference value. More...
 
casacore::String getLabel (std::vector< PMS::Axis > axes, std::vector< bool > refValueSets, std::vector< double > refValues, std::vector< PMS::DataColumn > datas, bool polnRatio=false) const
 
casacore::String getLabel (PMS::Axis xAxis, std::vector< PMS::Axis > yAxes, bool xRefValueSet=false, double xRefValue=0, std::vector< bool > yRefValueSets=std::vector< bool >(1, false), std::vector< double > yRefValues=std::vector< double >(1, 0.0), PMS::DataColumn xData=PMS::DATA, std::vector< PMS::DataColumn > yData=std::vector< PMS::DataColumn >(1, PMS::DATA), bool polnRatio=false) const
 Generates a label, using the given double axes and reference values. More...
 
bool operator== (const PlotMSLabelFormat &other) const
 Equality operators. More...
 
bool operator!= (const PlotMSLabelFormat &other) const
 
PlotMSLabelFormatoperator= (const PlotMSLabelFormat &copy)
 Copy operator. More...
 

Static Public Member Functions

static const casacore::StringTAGSEPARATOR ()
 Static //. More...
 
static const casacore::StringTAG_AXIS ()
 Tag for axes, both the single case and the double case. More...
 
static const casacore::StringTAG_XAXIS ()
 
static const casacore::StringTAG_YAXIS ()
 
static const casacore::StringTAG_UNIT ()
 Tag for axes units, both the single case and the double case. More...
 
static const casacore::StringTAG_XUNIT ()
 
static const casacore::StringTAG_YUNIT ()
 
static const casacore::StringTAG_IF_UNIT ()
 Tags for if/endif for axes units. More...
 
static const casacore::StringTAG_IF_XUNIT ()
 
static const casacore::StringTAG_IF_YUNIT ()
 
static const casacore::StringTAG_ENDIF_UNIT ()
 
static const casacore::StringTAG_ENDIF_XUNIT ()
 
static const casacore::StringTAG_ENDIF_YUNIT ()
 
static const casacore::StringTAG_REFVALUE ()
 Tags for axis reference values, both the single case and the double case. More...
 
static const casacore::StringTAG_XREFVALUE ()
 
static const casacore::StringTAG_YREFVALUE ()
 
static const casacore::StringTAG_IF_REFVALUE ()
 Tags for if/endif for axis reference values. More...
 
static const casacore::StringTAG_IF_XREFVALUE ()
 
static const casacore::StringTAG_IF_YREFVALUE ()
 
static const casacore::StringTAG_ENDIF_REFVALUE ()
 
static const casacore::StringTAG_ENDIF_XREFVALUE ()
 
static const casacore::StringTAG_ENDIF_YREFVALUE ()
 
static casacore::String TAG (const casacore::String &tag)
 Convenience method to surround the given tag with the separator. More...
 

Public Attributes

casacore::String format
 Format. More...
 

Static Private Member Functions

static casacore::String getLabel (const casacore::String &format, PMS::Axis axis, PMS::Axis xAxis, std::vector< PMS::Axis > yAxes, bool refValueSet, double refValue, bool xRefValueSet, double xRefValue, std::vector< bool > yRefValueSets, std::vector< double > yRefValues, PMS::DataColumn xData, const std::vector< PMS::DataColumn > &ydatas, bool polnRatio)
 Generates a label using the given format, single axis, and double axes. More...
 
static void addDataToTag (casacore::String &tag, PMS::Axis axis, PMS::DataColumn column)
 Adds the data label such as DATA, MODEL, CORRECTED, etc to the tag. More...
 
static void addPolnRatioToTag (casacore::String &tag, PMS::Axis axis)
 Adds "POLN Ratio" to tag for cal table ratio plots. More...
 
static bool nextToken (casacore::String &format, casacore::String &token, bool &tokenWasTag)
 Helper method for getLabel() which gets the next token in the format. More...
 

Static Private Attributes

static const casacore::String REFERENCE_DATE_FORMAT
 casacore::Format for when reference values are dates. More...
 

Detailed Description

Class for generating labels based upon axes, units, etc.

A format is a casacore::String that consists of tags and non-tags. Tags are special substrings differentiated by being surrounded by a separator; tags are replaced with given values when the label is built. For example: the %axis%% tag is replaced with the name of the Axis that is passed in when generating the String. Non-tags are copied exactly into the label. An example of a format is: "%%xaxis%% vs. %%yaxis%%", when passed in the axes TIME and AMP, would return the label "time vs. amp". Currently, labels can either be single axis (like for an axis label) or double axes (like for a plot title).

Definition at line 47 of file PlotMSLabelFormat.h.

Constructor & Destructor Documentation

casa::PlotMSLabelFormat::PlotMSLabelFormat ( const casacore::String format = "")

Non-Static //.

Constructor which takes an optional starting format.

casa::PlotMSLabelFormat::PlotMSLabelFormat ( const PlotMSLabelFormat copy)

Copy constructor.

See operator=().

casa::PlotMSLabelFormat::~PlotMSLabelFormat ( )

Destructor.

Member Function Documentation

static void casa::PlotMSLabelFormat::addDataToTag ( casacore::String tag,
PMS::Axis  axis,
PMS::DataColumn  column 
)
staticprivate

Adds the data label such as DATA, MODEL, CORRECTED, etc to the tag.

static void casa::PlotMSLabelFormat::addPolnRatioToTag ( casacore::String tag,
PMS::Axis  axis 
)
staticprivate

Adds "POLN Ratio" to tag for cal table ratio plots.

casacore::String casa::PlotMSLabelFormat::getLabel ( PMS::Axis  axis,
bool  refValueSet = false,
double  refValue = 0,
PMS::DataColumn  data = PMS::DATA,
bool  polnRatio = false 
) const

Generates a label, using the given single axis and reference value.

If any double axes tags are in the format, the given axis will be used for them.

casacore::String casa::PlotMSLabelFormat::getLabel ( std::vector< PMS::Axis >  axes,
std::vector< bool >  refValueSets,
std::vector< double >  refValues,
std::vector< PMS::DataColumn >  datas,
bool  polnRatio = false 
) const
casacore::String casa::PlotMSLabelFormat::getLabel ( PMS::Axis  xAxis,
std::vector< PMS::Axis >  yAxes,
bool  xRefValueSet = false,
double  xRefValue = 0,
std::vector< bool >  yRefValueSets = std::vector< bool >(1, false),
std::vector< double >  yRefValues = std::vector< double >(1, 0.0),
PMS::DataColumn  xData = PMS::DATA,
std::vector< PMS::DataColumn >  yData = std::vector< PMS::DataColumn >(1, PMS::DATA),
bool  polnRatio = false 
) const

Generates a label, using the given double axes and reference values.

If any single axes tags are in the format, the x axis will be used for it.

static casacore::String casa::PlotMSLabelFormat::getLabel ( const casacore::String format,
PMS::Axis  axis,
PMS::Axis  xAxis,
std::vector< PMS::Axis >  yAxes,
bool  refValueSet,
double  refValue,
bool  xRefValueSet,
double  xRefValue,
std::vector< bool >  yRefValueSets,
std::vector< double >  yRefValues,
PMS::DataColumn  xData,
const std::vector< PMS::DataColumn > &  ydatas,
bool  polnRatio 
)
staticprivate

Generates a label using the given format, single axis, and double axes.

static bool casa::PlotMSLabelFormat::nextToken ( casacore::String format,
casacore::String token,
bool &  tokenWasTag 
)
staticprivate

Helper method for getLabel() which gets the next token in the format.

Returns true if a token was returned; false if the end of the format was reached. The given format will be automatically shortened as tokens are taken out. The next token is put in the token parameter, and the tokenWasTag parameter is set to true if the token was a tag, false otherwise.

bool casa::PlotMSLabelFormat::operator!= ( const PlotMSLabelFormat other) const
inline

Definition at line 153 of file PlotMSLabelFormat.h.

References operator==().

PlotMSLabelFormat& casa::PlotMSLabelFormat::operator= ( const PlotMSLabelFormat copy)

Copy operator.

bool casa::PlotMSLabelFormat::operator== ( const PlotMSLabelFormat other) const

Equality operators.

Referenced by operator!=().

static casacore::String casa::PlotMSLabelFormat::TAG ( const casacore::String tag)
static

Convenience method to surround the given tag with the separator.

static const casacore::String& casa::PlotMSLabelFormat::TAG_AXIS ( )
static

Tag for axes, both the single case and the double case.

This tag is replaced with the axis name (see PMS::axis()) during generation.

static const casacore::String& casa::PlotMSLabelFormat::TAG_ENDIF_REFVALUE ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_ENDIF_UNIT ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_ENDIF_XREFVALUE ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_ENDIF_XUNIT ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_ENDIF_YREFVALUE ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_ENDIF_YUNIT ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_IF_REFVALUE ( )
static

Tags for if/endif for axis reference values.

Parts of the format that are surrounded with an IF at the beginning and ENDIF at the end are only copied to the label if the given axis has a reference value set. For example, "TAG_IF_REFVALUE(sample text)TAG_ENDIF_REFVALUE" would copy over "(sample text)" only if the given axis had a set reference value.

static const casacore::String& casa::PlotMSLabelFormat::TAG_IF_UNIT ( )
static

Tags for if/endif for axes units.

Parts of the format that are surrounded with an IF at the beginning and ENDIF at the end are only copied to the label if the given unit is NOT PMS::UNONE. For example, "TAG_IF_UNIT(sample text)TAG_ENDIF_UNIT" would copy over "(sample text)" only if the given unit was NOT PMS::UNONE.

static const casacore::String& casa::PlotMSLabelFormat::TAG_IF_XREFVALUE ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_IF_XUNIT ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_IF_YREFVALUE ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_IF_YUNIT ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_REFVALUE ( )
static

Tags for axis reference values, both the single case and the double case.

This tag is replaced with the reference value for the given axis, if there is one, during generation. Note: if the associated axis is a date, the value will be in date format.

static const casacore::String& casa::PlotMSLabelFormat::TAG_UNIT ( )
static

Tag for axes units, both the single case and the double case.

This tag is replaced with the axis unit name (see PMS::axisUnit()) during generation.

static const casacore::String& casa::PlotMSLabelFormat::TAG_XAXIS ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_XREFVALUE ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_XUNIT ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_YAXIS ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_YREFVALUE ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAG_YUNIT ( )
static
static const casacore::String& casa::PlotMSLabelFormat::TAGSEPARATOR ( )
static

Static //.

Separator that goes before and after tags.

Member Data Documentation

casacore::String casa::PlotMSLabelFormat::format

Format.

Definition at line 126 of file PlotMSLabelFormat.h.

const casacore::String casa::PlotMSLabelFormat::REFERENCE_DATE_FORMAT
staticprivate

casacore::Format for when reference values are dates.

Definition at line 183 of file PlotMSLabelFormat.h.


The documentation for this class was generated from the following file: