casa
5.7.0-16
|
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 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 |
PlotMSLabelFormat & | operator= (const PlotMSLabelFormat ©) |
Copy operator. More... | |
Static Public Member Functions | |
static const casacore::String & | TAGSEPARATOR () |
Static //. More... | |
static const casacore::String & | TAG_AXIS () |
Tag for axes, both the single case and the double case. More... | |
static const casacore::String & | TAG_XAXIS () |
static const casacore::String & | TAG_YAXIS () |
static const casacore::String & | TAG_UNIT () |
Tag for axes units, both the single case and the double case. More... | |
static const casacore::String & | TAG_XUNIT () |
static const casacore::String & | TAG_YUNIT () |
static const casacore::String & | TAG_IF_UNIT () |
Tags for if/endif for axes units. More... | |
static const casacore::String & | TAG_IF_XUNIT () |
static const casacore::String & | TAG_IF_YUNIT () |
static const casacore::String & | TAG_ENDIF_UNIT () |
static const casacore::String & | TAG_ENDIF_XUNIT () |
static const casacore::String & | TAG_ENDIF_YUNIT () |
static const casacore::String & | TAG_REFVALUE () |
Tags for axis reference values, both the single case and the double case. More... | |
static const casacore::String & | TAG_XREFVALUE () |
static const casacore::String & | TAG_YREFVALUE () |
static const casacore::String & | TAG_IF_REFVALUE () |
Tags for if/endif for axis reference values. More... | |
static const casacore::String & | TAG_IF_XREFVALUE () |
static const casacore::String & | TAG_IF_YREFVALUE () |
static const casacore::String & | TAG_ENDIF_REFVALUE () |
static const casacore::String & | TAG_ENDIF_XREFVALUE () |
static const casacore::String & | TAG_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... | |
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.
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.
|
staticprivate |
Adds the data label such as DATA, MODEL, CORRECTED, etc to the tag.
|
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.
|
staticprivate |
Generates a label using the given format, single axis, and double axes.
|
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.
|
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 |
Convenience method to surround the given tag with the separator.
|
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 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
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 |
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 |
|
static |
|
static |
|
static |
|
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 |
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 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Static //.
Separator that goes before and after tags.
casacore::String casa::PlotMSLabelFormat::format |
Format.
Definition at line 126 of file PlotMSLabelFormat.h.
|
staticprivate |
casacore::Format for when reference values are dates.
Definition at line 183 of file PlotMSLabelFormat.h.