CARMA C++
carma::monitor::MonitorPoint Class Referenceabstract

Abstract base class for a monitor point. More...

#include <carma/monitor/MonitorPoint.h>

Inheritance diagram for carma::monitor::MonitorPoint:
carma::monitor::MonitorComponent carma::monitor::MonitorPointBool carma::monitor::MonitorPointComplex carma::monitor::MonitorPointEnum carma::monitor::MonitorPointNumeric carma::monitor::MonitorPointSerialNo carma::monitor::MonitorPointString carma::monitor::MonitorPointByte carma::monitor::MonitorPointChar carma::monitor::MonitorPointInt carma::monitor::MonitorPointReal carma::monitor::MonitorPointShort carma::monitor::MonitorPointAbstime carma::monitor::MonitorPointDouble carma::monitor::MonitorPointFloat

Public Types

enum  BLANKING_FLAGGING {
  UNDETERMINED, OK, BLANKED, FLAGGED,
  BLANKED_FLAGGED, MAX_BLANKING_FLAGGING
}
 Blanking/flagging status of the data. More...
 
enum  MONITOR_POINT_TYPE { MONITOR, CONTROL }
 Monitor point type. More...
 
enum  VALIDITY {
  INVALID_NO_DATA, INVALID_NO_HW, INVALID_HW_BAD, VALID,
  VALID_NOT_CHECKED, VALID_GOOD, VALID_WARNING, VALID_ERROR,
  VALID_WARNING_LOW, VALID_WARNING_HIGH, VALID_ERROR_LOW, VALID_ERROR_HIGH,
  MAX_VALIDITY
}
 Validity states of the data value. More...
 
- Public Types inherited from carma::monitor::MonitorComponent
enum  ARCHIVE_PRIORITY {
  VITAL, USEFUL, NORMAL, DEBUG,
  VERBOSE, DEFAULT, DONTARCHIVE
}
 Archiving priority. More...
 

Public Member Functions

std::string archivePriorityToString () const
 Get a string for the archive priority for this monitor point. More...
 
void checkThreshold (const MonitorPointThreshold &threshold) const
 Method checks that threshold object corresponds to this monitor point - checks to see that threshold's tagID == this monitor point's tagID, and that value type of threshold == value type of this monitor point. More...
 
void clearComment ()
 Clear all comment attributes for the monitor point. More...
 
virtual std::string dumpSamples (bool includeAverage=true, bool includeValidity=true) const
 Create a string with sample and average values and validities. More...
 
bool errorHighDefaultIsSet () const
 Returns true if a default value was set for errorHigh for this monitor point. More...
 
bool errorLowDefaultIsSet () const
 Returns true if a default value was set for errorLow for this monitor point. More...
 
virtual void evaluateTolerance (const MonitorPointThreshold &threshold)
 Set the validity flags for the MonitorPoint using the threshold limits stored in the input MonitorPointThreshold object. More...
 
ARCHIVE_PRIORITY getArchivePriority () const
 Get the archive priority. More...
 
virtual std::string getAverageToString () const =0
 Abstract method that returns the average value as a string. More...
 
virtual VALIDITY getAveValidity () const
 Get the validity for the average. More...
 
BLANKING_FLAGGING getBlankingFlagging () const
 Get the blanking/flagging flag for the average. More...
 
std::string getComment () const
 Get a comment for the monitor point. More...
 
double getCommentTime () const
 Get time last comment was inserted. More...
 
std::string getCommentUser () const
 Get username that generated comment for the monitor point. More...
 
std::string getCoreValueAsString (int sampleIndex=0) const
 Get value as a string using the underlying basic type representation. More...
 
MonitorValue getErrorHighDefault () const
 Get the upper error default threshold. More...
 
MonitorValue getErrorLowDefault () const
 Get the upper error default threshold. More...
 
MonitorPointSample getMonitorPointSample (int sampleIndex) const
 Get the monitor point sample. More...
 
MonitorPointSample getMonitorPointSample0 () const
 
MONITOR_POINT_TYPE getMonitorPointType () const
 Get the type of the monitor point. More...
 
int getNumSamples () const
 Get the number of samples per frame. More...
 
int getNumValidSamples () const
 Get the number of valid samples per frame. More...
 
std::string getPaddedAverageString (int width) const
 Gets the average value as a string, padded to requested width. More...
 
std::string getPaddedAverageString () const
 Gets the average value as a string, padded to internal width. More...
 
std::string getPaddedValueString (int width, int sampleIndex) const
 Gets the data value as a string, padded to requested width. More...
 
std::string getPaddedValueString (int sampleIndex) const
 Gets the data value as a string, padded to internal width. More...
 
short getPrecision () const
 Get the number of digits to the right of the decimal point when translating the value to a string. More...
 
MonitorPointSample getSampleAverage () const
 
tagIDType getTagID () const
 Get the tagID (unique identifier of monitor point). More...
 
std::string getUnits () const
 Get the units string for the monitor point. More...
 
int getUpdateInterval () const
 Get the basic sampling update interval in frames. More...
 
VALIDITY getValidity (int sampleIndex) const
 Get the validity flag for a sample. More...
 
VALIDITY getValidity () const
 
virtual std::string getValueToString (int sampleIndex) const =0
 Abstract method that returns the data value as a string. More...
 
MonitorValueType getValuetype () const
 Get the datatype of the value. More...
 
MonitorValue getWarnHighDefault () const
 Get the upper warning default threshold. More...
 
MonitorValue getWarnLowDefault () const
 Get the lower warning default threshold. More...
 
virtual short getWidth () const
 Get the string length to use when interpreting the value to a string. More...
 
bool hasAllData () const
 See if all MPs in this component and below have data samples. More...
 
virtual ::std::string hierarchyToString (bool canonical=false, bool verbose=false, bool value=true, int sampleIndex=0, int indent=0, int levels=-1) const
 Dump this and all contained monitor components to a string. More...
 
virtual ::std::string hierarchyToStringAverage (bool canonical=false, bool verbose=false, bool value=true, int indent=0, int levels=-1) const
 Dump this and all contained monitor components to a string. More...
 
virtual void hierarchyToVector (::std::vector< ::std::string > &hierarchyList, bool canonical=false, bool verbose=false, int sampleIndex=0) const
 Dump this and all contained monitor component strings into a map hierarchy. More...
 
bool isAveValid () const
 Check to see if the average is valid. More...
 
virtual bool isMonitorPoint () const
 Identifies this component as a MonitorPoint or any derivative Should be over-ridden by the MonitorPoint class; others that don't derive from MP can use this default implementation. More...
 
bool isPersistent () const
 Returns the persistent state of the data. More...
 
bool isSnapshotAverage () const
 Returns state of snapshot averaging for this MP. More...
 
bool isTimeSeries () const
 Are multiple samples in a frame a time series or an array. More...
 
bool isValid (int sampleIndex) const
 Check if this monitor point validity is any of the valid states. More...
 
bool isValid () const
 
virtual std::string leafToString (bool verbose=false, bool value=true, int sampleIndex=0) const
 Dump all leaf nodes below this component to a string. More...
 
 MonitorPoint (const std::string &name, MonitorValueType valuetype, MONITOR_POINT_TYPE monitorPointType=MONITOR)
 Constructor, name is later used to lookup the tagID. More...
 
virtual std::string monitorPointTags (bool untagged=false) const
 Write list of monitor points and their tagIDs to a string, one monitor point per line. More...
 
std::string monitorPointTypeToString () const
 Get a string representation for the monitor point type of this monitor point. More...
 
virtual bool operator< (const MonitorPoint &rhs) const
 Compares monitor point for precedence to the one passed. More...
 
virtual bool operator== (const MonitorComponent &rhs) const
 Compares monitor point for equality to the monitor component passed. More...
 
virtual bool operator== (const MonitorPoint &rhs) const
 Compares monitor point for equality to the one passed. More...
 
void setAllValidity (VALIDITY validity, bool markMpAsModified=true) const
 Set the validity for all samples and the average. More...
 
void setArchivePriority (ARCHIVE_PRIORITY priority)
 Set the archive priority Priority may be used by archiver to control data volume.,. More...
 
void setAveValidity (VALIDITY validity) const
 Set the validity for the average. More...
 
void setBlankingFlagging (BLANKING_FLAGGING flag) const
 Set the blanking/flagging flag for the average. More...
 
void setComment (const std::string &text)
 Set a comment for the monitor point. More...
 
void setComment (const std::string &text, const std::string &user, double mjd)
 Set all comment attributes for the monitor point. More...
 
void setDefaultArchivePriority (ARCHIVE_PRIORITY priority)
 Set the default archive priority If the archive priority is set to DEFAULT, it is replaced with the new priority. More...
 
void setErrorHighDefault (const MonitorValue threshold)
 Set the upper error default threshold. More...
 
void setErrorLowDefault (const MonitorValue threshold)
 Set the upper error default threshold. More...
 
void setMonitorPointHeader (MonitorPointHeader header)
 Set the monitor point header. More...
 
void setNoData () const
 Recursively mark all data samples as INVALID_NO_DATA. More...
 
virtual void setNumSamples (int nSamples) const
 Set the number of samples per frame. More...
 
void setPersistent (bool persistent)
 Set the persistent state of the data. More...
 
void setPrecision (short precision)
 Set the number of digits to the right of the decimal point when translating the value to a string. More...
 
void setSnapshotAverage (bool state)
 Controls whether averaging is done as a normal true average or if it is just a snapshot of the last value. More...
 
void setTagID (tagIDType tagID, bool assignedOTF)
 Set tagID. More...
 
virtual void setTimeSeries (bool timeSeries)
 Determines whether data should be interpreted as time series or as an array (spectrum) when there are multiple samples per frame. More...
 
void setUnits (const std::string &units)
 Get the units string for the monitor point. More...
 
void setUpdateInterval (int interval)
 Set the basic sampling update interval. More...
 
void setValidity (VALIDITY validity, int sampleIndex=0) const
 Set the validity for a single sample. More...
 
void setWarnHighDefault (const MonitorValue threshold)
 Set the upper warning default threshold. More...
 
void setWarnLowDefault (const MonitorValue threshold)
 Set the lower warning default threshold. More...
 
void setWidth (short width) const
 Set the maximum width(length) of the string for interpreting the value to a string. More...
 
std::string toString (bool canonicalName=false, bool verbose=false, bool value=true, int sampleIndex=0, int indent=0) const
 Write this monitor component to a string. More...
 
std::string toStringAverage (bool canonicalName=false, bool verbose=false, bool value=true, int indent=0) const
 Write this monitor component to a string, using frame average values. More...
 
virtual std::string toStringShort (int sampleIndex=0) const
 Dumps name and value of monitor point as a short string (name=value). More...
 
virtual void updateFrameAverage (ScratchAverages &scratchAvgs)=0
 Abstract method that updates the average value/validity for the frame. More...
 
std::string valuetypeToString () const
 Get a string representation for the datatype of this monitor point. More...
 
bool warnHighDefaultIsSet () const
 Returns true if a default value was set for warnHigh for this monitor point. More...
 
bool warnLowDefaultIsSet () const
 Returns true if a default value was set for warnLow for this monitor point. More...
 
virtual ~MonitorPoint ()
 Destructor. More...
 
- Public Member Functions inherited from carma::monitor::MonitorComponent
const std::string & getCanonicalName () const
 Get the canonical component name. More...
 
virtual const std::string & getDescription () const
 Get the verbose description of the monitor component. More...
 
virtual const std::string & getLongName () const
 Get the long name of the monitor component. More...
 
virtual const std::string & getName () const
 Get the component name (leaf part of canonical name). More...
 
virtual std::string getPhysicalDeviceName () const
 Get the physical device name, if one exists. More...
 
std::string getPhysicalDeviceString () const
 Get the physical device name, if one exists, enclosed in parentheses. More...
 
std::string getPhysicalName () const
 Get the physical name, which is location.device.component or if there is no associated physical device it is just component name. More...
 
virtual const std::string & getShortName () const
 Get the short name of the monitor component. More...
 
virtual bool isSubsystem () const
 Check if the component is a MonitorSubsystem. More...
 
 MonitorComponent (const std::string &name)
 Constructor. More...
 
bool operator!= (const MonitorComponent &component) const
 Checks if components are not equal. More...
 
virtual void setCanonicalName (const std::string &parents)
 Recursively set the canonical component name for this and all below. More...
 
void setDescription (const std::string &text)
 Set the verbose description of the monitor component. More...
 
void setLongName (const std::string &name)
 Set the long name of the monitor component. More...
 
void setName (const std::string &name)
 Set the leaf part of the canonical name of the monitor component. More...
 
void setShortName (const std::string &name)
 Set the short name of the monitor component. More...
 
void setShortName (const std::string &name, int index)
 Set the short name of the monitor component, with an index appended. More...
 
virtual std::string transportStatisticsToString (bool canonical=false) const
 Dump end-toe-end transport statistics (if available). More...
 
virtual ~MonitorComponent ()
 Destructor. More...
 

Static Public Member Functions

static std::string blankingFlaggingToString (BLANKING_FLAGGING flag)
 Get a string representation for a blanking/flagging flag. More...
 
static bool isValid (VALIDITY validity)
 Check for any of the valid states. More...
 
static std::string monitorPointTypeToString (MONITOR_POINT_TYPE monitorPointType)
 Get a string representation for a monitor point type. More...
 
static std::string validityToString (VALIDITY validity)
 Get a string representation for a validity. More...
 
static std::string valuetypeToString (MonitorValueType valuetype)
 Get a string representation for a valuetype. More...
 
- Static Public Member Functions inherited from carma::monitor::MonitorComponent
static std::string archivePriorityToString (MonitorComponent::ARCHIVE_PRIORITY priority)
 Get a string representation for an archive priority. More...
 
static std::string convertAllLower (std::string name)
 Convert a name to all lower case. More...
 

Protected Member Functions

void clearAllDefaults ()
 Clears all default threshold values (makes them zero) and sets thresholdFlags_ to THRESHOLD_NONE_SET. More...
 
bool getAveBoolean () const
 
char getAveChar () const
 
::std::complex< float > getAveComplex () const
 
double getAveDouble () const
 
float getAveFloat () const
 
long getAveLong () const
 
long getAveSerialNo () const
 
short getAveShort () const
 
std::string getSnapshotAverageToString () const
 
bool getValueBoolean (int sampleIndex) const
 
char getValueChar (int sampleIndex) const
 
::std::complex< float > getValueComplex (int sampleIndex) const
 
double getValueDouble (int sampleIndex) const
 
float getValueFloat (int sampleIndex) const
 
long getValueLong (int sampleIndex) const
 
long getValueSerialNo () const
 
short getValueShort (int sampleIndex) const
 
MonitorValueStringChunk getValueStringChunk (int sampleIndex) const
 
bool isEqualTo (const MonitorPoint &mp) const
 
void setAve (char d) const
 
void setAve (short d) const
 
void setAve (long d) const
 
void setAve (bool d) const
 
void setAve (float d) const
 
void setAve (double d) const
 
void setAve (const ::std::complex< float > &d) const
 
void setAveSerialNo (long d) const
 
void setValue (char d, int sampleIndex) const
 
void setValue (short d, int sampleIndex) const
 
void setValue (long d, int sampleIndex) const
 
void setValue (bool d, int sampleIndex) const
 
void setValue (float d, int sampleIndex) const
 
void setValue (double d, int sampleIndex) const
 
void setValue (const ::std::complex< float > &d, int sampleIndex) const
 
void setValueSerialNo (long d) const
 
void setValuesStringChunksAndValidities (const MonitorValueStringChunk *chunks, int numChunks, VALIDITY validity) const
 

Protected Attributes

bool timeSeries_
 
short width_
 
- Protected Attributes inherited from carma::monitor::MonitorComponent
bool debug_
 

Additional Inherited Members

Detailed Description

Abstract base class for a monitor point.

Concrete class will implement (by convention) a typed getValue()/setValue pair that distinguishes the different specialized types of monitor points.

The number of samples per frame defaults to one.

There are several aspects regarding the name of a monitor point:

  • name - the monitor point name, no hierarchy (leaf node name). This name is not necessarily unique, e.g. temperature2
  • subsystemName - subsystem that a monitor point belongs to, e.g. ovro3
  • canonicalName - full physical name starting at the subsystem. This is the unique name of a monitor point, and can be used to get monitorPointID e.g. ovro3.cryo.temperature2
  • shortName - used for a compact label, e.g. temp2
  • hierarchicalName - hierarchical name in a given situation
    in a subsystem, e.g. ovro3.cryo.temperature2
    in the ACC (physical), e.g. carma.ovro3.cryo.temperature2
    in the ACC (logical), e.g. science1.ant2.cryo.temperature2
See Also
http://www.mmarray.org/project/WP/Monitoring/monitoringDesign.pdf

Definition at line 68 of file MonitorPoint.h.

Member Enumeration Documentation

Blanking/flagging status of the data.

  • OK - The data is not blanked or flagged inside the thresholds.
  • UNDETERMINED - The blanking/flagging status not yet determined.
  • BLANKED - The data is blanked.
  • FLAGGED - The data is flagged.
  • BLANKED_FLAGGED - The data is both blanked and flagged.

Definition at line 159 of file MonitorPoint.h.

Monitor point type.

Enumerator
MONITOR 

Simple monitor point.

CONTROL 

A control point.

Definition at line 171 of file MonitorPoint.h.

Validity states of the data value.

Many (but not all) of the monitor points have values that can be checked against contiguous ranges of values for being good, warning or error. Other monitor points may have custom code to check for good, warning or errors, without the range concept. For numeric data using the range construct, there is a good range that is bracketed by a warning range that is bracketed by an an error range.

 ||
 ||            ERROR_HIGH
 ||
 --------- High Error Threshold ----------
 ||
 ||            WARNING_HIGH
 ||
 --------- High Warning Threshold ----------
 ||  ////////////////////////////////////
 ||  ////          GOOD              ////
 ||  ////////////////////////////////////
 --------- Low Warning Threshold ----------
 ||
 ||            WARNING_LOW
 ||
 --------- Low Error Threshold ----------
 ||
 ||            ERROR_LOW
 ||
  • INVALID_NO_DATA - Data is invalid because the data was was not sent on time (the data transmission can be broken anywhere along the chain)
  • INVALID_NO_HW - Data is invalid because the hardware does not exist (or can't be detected)
  • INVALID_HW_BAD - Data is invalid because the hardware data collection got a bad sample (e.g. A/D conversion failure)
  • VALID - the data is valid and threshold do not apply to this type of data.
  • VALID_NOT_CHECKED - the data is valid but has not been checked against the thresholds
  • VALID_GOOD - the data is valid and its value is inside the thresholds
  • VALID_WARNING- the data is valid but the value warrants a warning (not using range thresholds)
  • VALID_ERROR - the data is valid but bad (not using range thresholds)
  • VALID_WARNING_LOW - the data is valid and below the lower warning range threshold
  • VALID_ERROR_LOW - the data is valid and below the lower error range threshold
  • VALID_WARNING_HIGH - the data is valid and above the upper warning range threshold
  • VALID_ERROR_HIGH - the data is valid and above the upper error range threshold

Definition at line 132 of file MonitorPoint.h.

Constructor & Destructor Documentation

carma::monitor::MonitorPoint::MonitorPoint ( const std::string &  name,
MonitorValueType  valuetype,
MONITOR_POINT_TYPE  monitorPointType = MONITOR 
)

Constructor, name is later used to lookup the tagID.

Number of samples per frame is set to one.

Parameters
nameof the monitor point - no hierarchy (e.g. powerSupply5volt)
valuetype(datatype of the value) of the monitor point
virtual carma::monitor::MonitorPoint::~MonitorPoint ( )
virtual

Destructor.

Nothing fancy here - the dynamic storage is managed elsewhere.

Member Function Documentation

std::string carma::monitor::MonitorPoint::archivePriorityToString ( ) const

Get a string for the archive priority for this monitor point.

static std::string carma::monitor::MonitorPoint::blankingFlaggingToString ( BLANKING_FLAGGING  flag)
static

Get a string representation for a blanking/flagging flag.

Parameters
flag
void carma::monitor::MonitorPoint::checkThreshold ( const MonitorPointThreshold &  threshold) const

Method checks that threshold object corresponds to this monitor point - checks to see that threshold's tagID == this monitor point's tagID, and that value type of threshold == value type of this monitor point.

If the threshold fails the test, then the method throws an ErrorException with a canned error message.

Parameters
threshold,constMonitorPointThreshold& reference to a MonitorPointThreshold object.
Exceptions
throwsa ::carma::monitor::InvalidThresholdException with a canned error message.
void carma::monitor::MonitorPoint::clearAllDefaults ( )
protected

Clears all default threshold values (makes them zero) and sets thresholdFlags_ to THRESHOLD_NONE_SET.

void carma::monitor::MonitorPoint::clearComment ( )

Clear all comment attributes for the monitor point.

virtual std::string carma::monitor::MonitorPoint::dumpSamples ( bool  includeAverage = true,
bool  includeValidity = true 
) const
virtual

Create a string with sample and average values and validities.

Debugging quality. The validity is represented by a 'G' or 'B' for good or bad.

Parameters
includeAveragedefaults to true
includeValiditydefaults to true
bool carma::monitor::MonitorPoint::errorHighDefaultIsSet ( ) const

Returns true if a default value was set for errorHigh for this monitor point.

Should be tested before using the value returned from getErrorHigh.

Parameters
none
Returns
bool true if default was set for errorHigh threshold.
bool carma::monitor::MonitorPoint::errorLowDefaultIsSet ( ) const

Returns true if a default value was set for errorLow for this monitor point.

Should be tested before using the value returned from getErrorLowDefault.

Parameters
none
Returns
bool true if default was set for errorLow threshold.
virtual void carma::monitor::MonitorPoint::evaluateTolerance ( const MonitorPointThreshold &  threshold)
virtual

Set the validity flags for the MonitorPoint using the threshold limits stored in the input MonitorPointThreshold object.

Parameters
thresholdMonitorPointThreshold object holding user set threshold limits for this monitor point
See Also
setErrorHigh, setWarnHigh, setWarnLow, setErrorLow
getErrorHigh, getWarnHigh, getWarnLow, getErrorLow

Reimplemented in carma::monitor::MonitorPointSerialNo, carma::monitor::MonitorPointString, carma::monitor::MonitorPointAbstime, carma::monitor::MonitorPointComplex, carma::monitor::MonitorPointDouble, carma::monitor::MonitorPointFloat, carma::monitor::MonitorPointEnum, carma::monitor::MonitorPointBool, carma::monitor::MonitorPointInt, carma::monitor::MonitorPointShort, carma::monitor::MonitorPointByte, and carma::monitor::MonitorPointChar.

carma::monitor::MonitorComponent::ARCHIVE_PRIORITY carma::monitor::MonitorPoint::getArchivePriority ( ) const

Get the archive priority.

Definition at line 1027 of file MonitorPoint.h.

virtual std::string carma::monitor::MonitorPoint::getAverageToString ( ) const
pure virtual
virtual VALIDITY carma::monitor::MonitorPoint::getAveValidity ( ) const
virtual

Get the validity for the average.

This is virtual in case a specific type of monitor point needs to do something different from the default implementation, which returns the validity of MonitorSample(0), which is normally reserved for the averagge.

See Also
getValidity setValidity
carma::monitor::MonitorPoint::BLANKING_FLAGGING carma::monitor::MonitorPoint::getBlankingFlagging ( ) const

Get the blanking/flagging flag for the average.

Only applies for the average.

Returns
blanking/flagging status of the average of the monitor point.
See Also
setBlankingFlagging

Definition at line 1088 of file MonitorPoint.h.

std::string carma::monitor::MonitorPoint::getComment ( ) const

Get a comment for the monitor point.

For example, "Thresholds changed because of A/D offset" The comment time field is automatically updated.

Returns
comment string
See Also
setComment, getCommentTime, getCommentUser
double carma::monitor::MonitorPoint::getCommentTime ( ) const

Get time last comment was inserted.

Returns
time of last comment in MJD
See Also
getComment, setComment
std::string carma::monitor::MonitorPoint::getCommentUser ( ) const

Get username that generated comment for the monitor point.

Returns
username (userID) of originator of comment
See Also
setComment, getComment, getComment
std::string carma::monitor::MonitorPoint::getCoreValueAsString ( int  sampleIndex = 0) const

Get value as a string using the underlying basic type representation.

Returns underlying core value as a string with the full precision and range of it's basic type.

MonitorValue carma::monitor::MonitorPoint::getErrorHighDefault ( ) const

Get the upper error default threshold.

Test with errorHighDefaultIsSet before getting the value. The default value is sometimes in range of valid values, so it is best to test whether the value was set before using the value.

Returns
threshold
See Also
setErrorHighDefault, setWarnHighDefault, setWarnLowDefault, setErrorLowDefault
getErrorHighDefault, getWarnHighDefault, getWarnLowDefault, getErrorLowDefault
errorHighDefaultIsSet
MonitorValue carma::monitor::MonitorPoint::getErrorLowDefault ( ) const

Get the upper error default threshold.

Test with errorLowDefaultIsSet before getting the value. The default value is sometimes in range of valid values, so it is best to test whether the value was set before using the value.

Returns
threshold
See Also
setErrorHighDefault, setWarnHighDefault, setWarnLowDefault, setErrorLowDefault
getErrorHighDefault, getWarnHighDefault, getWarnLowDefault, getErrorLowDefault
errorLowDefaultIsSet
MonitorPointSample carma::monitor::MonitorPoint::getMonitorPointSample ( int  sampleIndex) const

Get the monitor point sample.

Parameters
sampleIndexsample index (0 is first sample)
carma::monitor::MonitorPoint::MONITOR_POINT_TYPE carma::monitor::MonitorPoint::getMonitorPointType ( ) const

Get the type of the monitor point.

Returns
type of the monitor point.
See Also
MonitorPoint

Definition at line 1020 of file MonitorPoint.h.

int carma::monitor::MonitorPoint::getNumSamples ( ) const

Get the number of samples per frame.

Returns
number of samples per frame.
See Also
setNumSamples

Definition at line 1041 of file MonitorPoint.h.

int carma::monitor::MonitorPoint::getNumValidSamples ( ) const

Get the number of valid samples per frame.

Returns
number of valid samples per frame.
See Also
isValid
std::string carma::monitor::MonitorPoint::getPaddedAverageString ( int  width) const

Gets the average value as a string, padded to requested width.

If the interpretation results in a string longer than width, the string will be truncated to width and represented by asterisks "*"'s.

Parameters
widththe string width to return
Returns
average value as a string
std::string carma::monitor::MonitorPoint::getPaddedAverageString ( ) const

Gets the average value as a string, padded to internal width.

If the interpretation results in a string longer than width, the string will be truncated to width and represented by asterisks "*"'s.

Returns
average value as a string
std::string carma::monitor::MonitorPoint::getPaddedValueString ( int  width,
int  sampleIndex 
) const

Gets the data value as a string, padded to requested width.

If the interpretation results in a string longer than width, the string will be truncated to width and represented by asterisks "*"'s.

Parameters
widththe string width to return
sampleIndexsample index (0 is first sample), negative gets ave
Returns
data value as a string
std::string carma::monitor::MonitorPoint::getPaddedValueString ( int  sampleIndex) const

Gets the data value as a string, padded to internal width.

If the interpretation results in a string longer than width, the string will be truncated to width and represented by asterisks "*"'s.

Parameters
sampleIndexsample index (0 is first sample), negative gets ave
Returns
data value as a string
short carma::monitor::MonitorPoint::getPrecision ( ) const

Get the number of digits to the right of the decimal point when translating the value to a string.

Returns
number of digits to the right of the decimal
See Also
setPrecision
carma::monitor::tagIDType carma::monitor::MonitorPoint::getTagID ( ) const

Get the tagID (unique identifier of monitor point).

Returns
tagID.

Definition at line 1006 of file MonitorPoint.h.

std::string carma::monitor::MonitorPoint::getUnits ( ) const

Get the units string for the monitor point.

White space is not allowed. An example is "milliamps".

Returns
the units for the monitor point.
See Also
setUnits
int carma::monitor::MonitorPoint::getUpdateInterval ( ) const

Get the basic sampling update interval in frames.

Definition at line 1034 of file MonitorPoint.h.

VALIDITY carma::monitor::MonitorPoint::getValidity ( int  sampleIndex) const

Get the validity flag for a sample.

Returns
validity of the monitor point.
Parameters
sampleIndexsample number (0 is first sample), defaults to 0
See Also
setValidity
virtual std::string carma::monitor::MonitorPoint::getValueToString ( int  sampleIndex) const
pure virtual
carma::monitor::MonitorValueType carma::monitor::MonitorPoint::getValuetype ( ) const

Get the datatype of the value.

Returns
datatype of the monitor point value.
See Also
MonitorPoint

Definition at line 1013 of file MonitorPoint.h.

MonitorValue carma::monitor::MonitorPoint::getWarnHighDefault ( ) const

Get the upper warning default threshold.

Test with warnHighDefaultIsSet before getting the value. The default value is sometimes in range of valid values, so it is best to test whether the value was set before using the value.

Returns
threshold
See Also
setErrorHighDefault, setWarnHighDefault, setWarnLowDefault, setErrorLowDefault
getErrorHighDefault, getWarnHighDefault, getWarnLowDefault, getErrorLowDefault
warnHighDefaultIsSet
MonitorValue carma::monitor::MonitorPoint::getWarnLowDefault ( ) const

Get the lower warning default threshold.

Test with warnLowDefaultIsSet before getting the value. The default value is sometimes in range of valid values, so it is best to test whether the value was set before using the value.

Returns
threshold
See Also
setErrorHighDefault, setWarnHighDefault, setWarnLowDefault, setErrorLowDefault
getErrorHighDefault, getWarnHighDefault, getWarnLowDefault, getErrorLowDefault
warnLowDefaultIsSet
virtual short carma::monitor::MonitorPoint::getWidth ( ) const
virtual

Get the string length to use when interpreting the value to a string.

Returns
width of the string representing the monitor point value
See Also
setWidth

Reimplemented in carma::monitor::MonitorPointEnum.

bool carma::monitor::MonitorPoint::hasAllData ( ) const
virtual

See if all MPs in this component and below have data samples.

Can be time consuming to check a large branch.

Implements carma::monitor::MonitorComponent.

virtual ::std::string carma::monitor::MonitorPoint::hierarchyToString ( bool  canonical = false,
bool  verbose = false,
bool  value = true,
int  sampleIndex = 0,
int  indent = 0,
int  levels = -1 
) const
virtual

Dump this and all contained monitor components to a string.

The string will potentially have many lines, and will end with a new line in all cases.

Parameters
canonicaldetermines if canonical or component name is output
verbosedetermines if a terse or verbose dump is done
valuedetermines if current value is output
sampleIndex(0 is first sample)
indentfor this level in characters
levelsnumber of levels below this to descend; -1 means all

Implements carma::monitor::MonitorComponent.

virtual ::std::string carma::monitor::MonitorPoint::hierarchyToStringAverage ( bool  canonical = false,
bool  verbose = false,
bool  value = true,
int  indent = 0,
int  levels = -1 
) const
virtual

Dump this and all contained monitor components to a string.

The frame average value is output. The string will potentially have many lines, and will end with a new line in all cases.

Parameters
canonicaldetermines if canonical or component name is output
verbosedetermines if a terse or verbose dump is done
valuedetermines if current value is output
indentfor this level in characters
levelsnumber of levels below this to descend; -1 means all

Implements carma::monitor::MonitorComponent.

virtual void carma::monitor::MonitorPoint::hierarchyToVector ( ::std::vector< ::std::string > &  hierarchyList,
bool  canonical = false,
bool  verbose = false,
int  sampleIndex = 0 
) const
virtual

Dump this and all contained monitor component strings into a map hierarchy.

Parameters
canonicaldetermines if canonical or component name is output
verbosedetermines if a terse or verbose dump is done

Implements carma::monitor::MonitorComponent.

bool carma::monitor::MonitorPoint::isAveValid ( ) const

Check to see if the average is valid.

Returns
true if the average is valid

Definition at line 1081 of file MonitorPoint.h.

virtual bool carma::monitor::MonitorPoint::isMonitorPoint ( ) const
virtual

Identifies this component as a MonitorPoint or any derivative Should be over-ridden by the MonitorPoint class; others that don't derive from MP can use this default implementation.

Used to speed up iteration through a monitor hierarchy.

Returns
true if the component is a MonitorPoint or any derivative

Reimplemented from carma::monitor::MonitorComponent.

bool carma::monitor::MonitorPoint::isPersistent ( ) const

Returns the persistent state of the data.

See Also
setPersistent

Definition at line 999 of file MonitorPoint.h.

bool carma::monitor::MonitorPoint::isSnapshotAverage ( ) const

Returns state of snapshot averaging for this MP.

See Also
setSnapshotAverage

Definition at line 1047 of file MonitorPoint.h.

bool carma::monitor::MonitorPoint::isTimeSeries ( ) const

Are multiple samples in a frame a time series or an array.

Definition at line 992 of file MonitorPoint.h.

bool carma::monitor::MonitorPoint::isValid ( VALIDITY  validity)
static

Check for any of the valid states.

Parameters
validityto check

Definition at line 1074 of file MonitorPoint.h.

bool carma::monitor::MonitorPoint::isValid ( int  sampleIndex) const

Check if this monitor point validity is any of the valid states.

Parameters
sampleIndexsample index (0 is first sample), defaults to 0
virtual std::string carma::monitor::MonitorPoint::leafToString ( bool  verbose = false,
bool  value = true,
int  sampleIndex = 0 
) const
virtual

Dump all leaf nodes below this component to a string.

Leaf nodes should be MonitorPoints (or a subclass thereof). The string will potentially have many lines, and will end with a new line in all cases. The canonical name is used in the output.

Parameters
verbosedetermines if a terse or verbose dump is done
valuedetermines if current value is output
sampleIndex(0 is first sample)

Implements carma::monitor::MonitorComponent.

virtual std::string carma::monitor::MonitorPoint::monitorPointTags ( bool  untagged = false) const
virtual

Write list of monitor points and their tagIDs to a string, one monitor point per line.

Parameters
untaggedOnly list those MPs without tagIDs

Implements carma::monitor::MonitorComponent.

static std::string carma::monitor::MonitorPoint::monitorPointTypeToString ( MONITOR_POINT_TYPE  monitorPointType)
static

Get a string representation for a monitor point type.

Parameters
monitorPointType
std::string carma::monitor::MonitorPoint::monitorPointTypeToString ( ) const

Get a string representation for the monitor point type of this monitor point.

virtual bool carma::monitor::MonitorPoint::operator< ( const MonitorPoint rhs) const
virtual

Compares monitor point for precedence to the one passed.

This monitor point precedes the one passed if this monitor point's tagID is less than that of one passed. (*this) < (mpoint) == (this->getTagID() < mpoint.getTagID())

Parameters
rhsmonitor point to compare to
virtual bool carma::monitor::MonitorPoint::operator== ( const MonitorComponent rhs) const
virtual

Compares monitor point for equality to the monitor component passed.

The names must match; value checks will have to be implemented by the derived types.

Parameters
rhsmonitor component to compare to

Implements carma::monitor::MonitorComponent.

Reimplemented in carma::monitor::MonitorPointString, carma::monitor::MonitorPointComplex, and carma::monitor::MonitorPointNumeric.

virtual bool carma::monitor::MonitorPoint::operator== ( const MonitorPoint rhs) const
virtual

Compares monitor point for equality to the one passed.

The name and tagID's must match; value checks will have to be implemented by the derived types.

Parameters
rhsmonitor point to compare to
void carma::monitor::MonitorPoint::setAllValidity ( VALIDITY  validity,
bool  markMpAsModified = true 
) const

Set the validity for all samples and the average.

Parameters
validityof the monitor point.
See Also
getValidity setValidity
void carma::monitor::MonitorPoint::setArchivePriority ( ARCHIVE_PRIORITY  priority)

Set the archive priority Priority may be used by archiver to control data volume.,.

Parameters
prioritythe priority for archiving
void carma::monitor::MonitorPoint::setAveValidity ( VALIDITY  validity) const

Set the validity for the average.

See Also
getValidity setValidity
void carma::monitor::MonitorPoint::setBlankingFlagging ( BLANKING_FLAGGING  flag) const

Set the blanking/flagging flag for the average.

Blanking/flagging only apply to the average.

Parameters
flagblanking/flagging status of the monitor point.
See Also
getBlankingFlagging
void carma::monitor::MonitorPoint::setComment ( const std::string &  text)

Set a comment for the monitor point.

For example, "Thresholds changed because of A/D offset", or "Intermittent encoder readout error around 25 degrees". The comment time field is automatically updated. Because the comments are usually retrieved from a configuration along with the time of the comment and username, this interface is usually just used for debugging. The username "test" is automatically inserted.

Parameters
textstring
See Also
getComment, getCommentTime, getCommentUser
void carma::monitor::MonitorPoint::setComment ( const std::string &  text,
const std::string &  user,
double  mjd 
)

Set all comment attributes for the monitor point.

Used when setting from a configuration file or database.

Parameters
textstring
user- userid for author of the comment
mjd- date of origin of comment
See Also
getComment, getCommentTime, getCommentUser
void carma::monitor::MonitorPoint::setDefaultArchivePriority ( ARCHIVE_PRIORITY  priority)

Set the default archive priority If the archive priority is set to DEFAULT, it is replaced with the new priority.

Parameters
prioritythe priority for archiving
void carma::monitor::MonitorPoint::setErrorHighDefault ( const MonitorValue  threshold)
void carma::monitor::MonitorPoint::setErrorLowDefault ( const MonitorValue  threshold)
void carma::monitor::MonitorPoint::setMonitorPointHeader ( MonitorPointHeader  header)

Set the monitor point header.

The monitor point is not usable until the header has been set and storage set.

void carma::monitor::MonitorPoint::setNoData ( ) const
virtual

Recursively mark all data samples as INVALID_NO_DATA.

Implements carma::monitor::MonitorComponent.

virtual void carma::monitor::MonitorPoint::setNumSamples ( int  nSamples) const
virtual

Set the number of samples per frame.

This is virtual because some monitor points may want to restrict the number of samples per frame.

Parameters
nSamplesnumber of samples per frame.
See Also
getNumSamples

Reimplemented in carma::monitor::MonitorPointSerialNo.

void carma::monitor::MonitorPoint::setPersistent ( bool  persistent)
virtual

Set the persistent state of the data.

If the data is not persistent then immediately after the write() method is called the data are set to INVALID_NO_DATA. If it is persistent then the validity is not changed after the write.

Parameters
persistent
See Also
isPersistent

Implements carma::monitor::MonitorComponent.

void carma::monitor::MonitorPoint::setPrecision ( short  precision)

Set the number of digits to the right of the decimal point when translating the value to a string.

This is only used for monitor points that have values that are real numbers, but has been included in the base class so that the precision may be manipulated on the base class rather than the derived class.

Parameters
precisionnumber of digits to the right of the decimal
See Also
getPrecision
void carma::monitor::MonitorPoint::setSnapshotAverage ( bool  state)

Controls whether averaging is done as a normal true average or if it is just a snapshot of the last value.

Snapshot mode is useful for things that are averaged in other parts of the code and then passed to an averager.

Parameters
stateif true, snapshot averaging is done; if false, normal averaging
void carma::monitor::MonitorPoint::setTagID ( tagIDType  tagID,
bool  assignedOTF 
)

Set tagID.

Parameters
tagIDtag id to assign to MP
assignedOTFif true the MP tagID is assigned on the fly

Definition at line 1054 of file MonitorPoint.h.

virtual void carma::monitor::MonitorPoint::setTimeSeries ( bool  timeSeries)
virtual

Determines whether data should be interpreted as time series or as an array (spectrum) when there are multiple samples per frame.

Only numeric types can be an array, so the default implementation of this method throws an exception. Default is time series.

Parameters
timeSeriestrue if data is time series, false if array
Exceptions
ErrorException.

Reimplemented in carma::monitor::MonitorPointNumeric.

void carma::monitor::MonitorPoint::setUnits ( const std::string &  units)

Get the units string for the monitor point.

Parameters
unitsfor the monitor point. White space allowed.
See Also
getUnits
void carma::monitor::MonitorPoint::setUpdateInterval ( int  interval)

Set the basic sampling update interval.

This can be many frames in length. Set to 1 if there are multiple samples in a frame. May be used by archiver to control data volume.

Parameters
intervalsampling interval in half second frames
void carma::monitor::MonitorPoint::setValidity ( VALIDITY  validity,
int  sampleIndex = 0 
) const

Set the validity for a single sample.

Parameters
validityof the monitor point.
sampleIndexsample index (0 is first sample), defaults to 0
See Also
getValidity
void carma::monitor::MonitorPoint::setWarnHighDefault ( const MonitorValue  threshold)
void carma::monitor::MonitorPoint::setWarnLowDefault ( const MonitorValue  threshold)
void carma::monitor::MonitorPoint::setWidth ( short  width) const

Set the maximum width(length) of the string for interpreting the value to a string.

Parameters
widthof the returned string
See Also
getWidth, getValueToString
std::string carma::monitor::MonitorPoint::toString ( bool  canonicalName = false,
bool  verbose = false,
bool  value = true,
int  sampleIndex = 0,
int  indent = 0 
) const
virtual

Write this monitor component to a string.

If verbose, the string may have multiple lines but is guaranteed to be terminated with a newline. If not verbose, the string is guaranteed to be a single line without a newline.

Parameters
canonicalNameoutput canonicalName or leaf name
verbosedetermines if a terse or verbose dump is done
valuedetermines if current value is output
sampleIndex(0 is first sample)
indentfor this level (number of characters)
See Also
toStringAverage

Implements carma::monitor::MonitorComponent.

std::string carma::monitor::MonitorPoint::toStringAverage ( bool  canonicalName = false,
bool  verbose = false,
bool  value = true,
int  indent = 0 
) const
virtual

Write this monitor component to a string, using frame average values.

If verbose, the string may have multiple lines but is guaranteed to be terminated with a newline. If not verbose, the string is guaranteed to be a single line without a newline.

Parameters
canonicalNameoutput canonicalName or leaf name
verbosedetermines if a terse or verbose dump is done
valuedetermines if current value is output
indentfor this level (number of characters)
See Also
toString

Implements carma::monitor::MonitorComponent.

virtual std::string carma::monitor::MonitorPoint::toStringShort ( int  sampleIndex = 0) const
virtual

Dumps name and value of monitor point as a short string (name=value).

No carriage returns or line feeds.

Parameters
sampleIndexsample index (0 is first sample), negative gets ave
Returns
just the name=value.
virtual void carma::monitor::MonitorPoint::updateFrameAverage ( ScratchAverages &  scratchAvgs)
pure virtual
static std::string carma::monitor::MonitorPoint::validityToString ( VALIDITY  validity)
static

Get a string representation for a validity.

Parameters
validity
static std::string carma::monitor::MonitorPoint::valuetypeToString ( MonitorValueType  valuetype)
static

Get a string representation for a valuetype.

Parameters
valuetype
std::string carma::monitor::MonitorPoint::valuetypeToString ( ) const

Get a string representation for the datatype of this monitor point.

bool carma::monitor::MonitorPoint::warnHighDefaultIsSet ( ) const

Returns true if a default value was set for warnHigh for this monitor point.

Should be tested before using the value returned from getWarnHigh.

Parameters
none
Returns
bool true if default was set for warnHigh threshold.
bool carma::monitor::MonitorPoint::warnLowDefaultIsSet ( ) const

Returns true if a default value was set for warnLow for this monitor point.

Should be tested before using the value returned from getWarnLowDefault.

Parameters
none
Returns
bool true if default was set for warnLow threshold.

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