CARMA C++
carma::monitor::MonitorPointHeader Class Reference

Wrapper class for monitor point header information. More...

Public Member Functions

void clearSamples (bool deallocate=false)
 clears all the samples associated with this header. More...
 
const MonitorSampleValuegetAverageMonitorSampleValueRef () const
 
MonitorSampleValuegetAverageMonitorSampleValueRef ()
 
MonitorPointSample getMonitorPointSample (int iSample)
 gets the ith sample from the set of sampled monitor values associated with the monitor point. More...
 
const MonitorSampleValuegetMonitorSampleValueRef (int iSample) const
 
MonitorSampleValuegetMonitorSampleValueRef (int iSample)
 
ushort getNumSamplesPerCycle () const
 gets the number of samples per sampling cycle - which is currently standardized at half-second, and is managed by carma::util::Time. More...
 
MonitorPointSample getSampleAverage ()
 gets the value of sampled data averaged over all monitor point samples that contain filled up data. More...
 
ushort getSampleOffset () const
 gets a reference to the set of sampled data associated with the monitor point. More...
 
tagIDType getTagID () const
 gets the unique tagID for a monitor point. More...
 
MonitorValueType getValueType () const
 
 MonitorPointHeader (MonitorHeader &header, MonitorSampleValue *samples, int index=-1, MonitorPointSet *set=0)
 public constructor to build MonitorPointHeader object. Requires reference to a MonitorHeader structure and a pointer to the collection of sampled data associated with the monitor point. More...
 
MonitorPointHeaderoperator= (const MonitorPointHeader &rhs)
 operator for assigning values to a MonitorPointHeader. More...
 
void setNumSamplesPerCycle (const ushort nSamples)
 sets the number of samples per sampling cycle - which is currently standardized at half-second. Time to next cycle is determined by carma::util::Time. More...
 
void setSampleOffset (const ushort sampleOffset)
 sets a reference to the set of sampled data associated with the monitor point. For use by Frame methods only More...
 
void setSamplesPerCycle (const ushort nSamples)
 sets the the filed "nSamples" in the MonitorHeader struct. Meant for use by other classes in this file. Do not use this method to change the sample rate - use setNumSamplesPerCycle instead. More...
 
void setValueType (MonitorValueType mvt)
 
 ~MonitorPointHeader ()
 Destructor. More...
 

Detailed Description

Wrapper class for monitor point header information.

A wrapper class to manage header information for monitor points - manages tagID, sample rate, a reference to the collection of sampled data, Also provides interfaces for getting sample data and the averaged value of sampled data.

Definition at line 75 of file MonitorPointHeader.h.

Constructor & Destructor Documentation

carma::monitor::MonitorPointHeader::MonitorPointHeader ( MonitorHeader &  header,
MonitorSampleValue samples,
int  index = -1,
MonitorPointSet set = 0 
)

public constructor to build MonitorPointHeader object. Requires reference to a MonitorHeader structure and a pointer to the collection of sampled data associated with the monitor point.

The intent is to put a wrapper around a MonitorHeader structure so that monitor header information can be modified and read using methods, rather than direct structure access. MonitorHeader structures should not exist in isolation - they are part of a SubsystemHeader of as part of MonitorSystemFrame. As a result the constructor does not construct an instance of a MonitorHeader structure.

Parameters
headerMonitorHeader& reference to MonitorHeader structure
samplesMonitorSampleValue* const pointer to beginning of array of monitor point samples in the enclosing subsystem frame.
indexint offset of this monitor point header that represents the monitor point in the containing SubsystemFrame.
setMonitorPointSet* const pointer to MonitorPointSet that contains and manages storage for this monitor point.
Returns
none - constructor.
See Also
carma::monitor::MonitorHeader
carma::monitor::MonitorSampleValue
carma::monitor::MonitorPointSample
carma::monitor::SubsystemHeader
carma::monitor::SubsystemFrame

Definition at line 368 of file MonitorPointHeader.h.

carma::monitor::MonitorPointHeader::~MonitorPointHeader ( )

Destructor.

Definition at line 382 of file MonitorPointHeader.h.

Member Function Documentation

void carma::monitor::MonitorPointHeader::clearSamples ( bool  deallocate = false)

clears all the samples associated with this header.

Clears flags and, if sample is to be deallocated, resets all fields of the sample. To deallocate sample, 'deallocate' must be set to 'true'.

Parameters
booldeallocate free sample storage if true, default value is false.
Returns
none
carma::monitor::MonitorPointSample carma::monitor::MonitorPointHeader::getMonitorPointSample ( int  iSample)

gets the ith sample from the set of sampled monitor values associated with the monitor point.

The number of samples per cycle is determined by the sampling rate for the monitor point, which, for hardware, is detrmined by the micro controlling that piece of hardware. This method gets the ith sampled monitor data value, where i ranges form 1 through nSamplesPerCycle.

Returns
sampled monitor value as a MonitorPointSample object.
See Also
carma::monitor::MonitorPointSample.
carma::monitor::MonitorHeader::nSamples

Definition at line 463 of file MonitorPointHeader.h.

ushort carma::monitor::MonitorPointHeader::getNumSamplesPerCycle ( ) const

gets the number of samples per sampling cycle - which is currently standardized at half-second, and is managed by carma::util::Time.

The number of samples per cycle is determined by the sampling rate for the monitor point, which, for hardware, is determined by the micro controlling that piece of hardware.

Returns
unsigned short # of samples per sampling cycle
See Also
carma::util::Time
carma::monitor::MonitorHeader::nSamples

Definition at line 412 of file MonitorPointHeader.h.

carma::monitor::MonitorPointSample carma::monitor::MonitorPointHeader::getSampleAverage ( )

gets the value of sampled data averaged over all monitor point samples that contain filled up data.

Gets the averaged value as a MonitorPointSample object. Average value is meaningful only for monitor points associated with numeric value types, namely float, double, long, short, byte and complex.

Returns
value averaged over set of sampled data associated with the monitor point, as a MonitorPointSample object.
See Also
carma::monitor::MonitorPointSample.

Definition at line 472 of file MonitorPointHeader.h.

ushort carma::monitor::MonitorPointHeader::getSampleOffset ( ) const

gets a reference to the set of sampled data associated with the monitor point.

The set of sampled data associated with the monitor point contains a number of samples determined by the number of samples per cycle, i.e. numSamplesPerCycle. This method provides a reference to the set of sampled monitor values within a frame structure.

Returns
unsigned short reference to set of sampled values within a frame structure (SubsystemHeader or MonitorSystemFrame).
See Also
carma::monitor::MonitorPointSample
carma::monitor::SubsystemHeader
carma::monitor::MonitorSystemFrame

Definition at line 405 of file MonitorPointHeader.h.

carma::monitor::tagIDType carma::monitor::MonitorPointHeader::getTagID ( ) const

gets the unique tagID for a monitor point.

The tagID is a structured ID which is unique across all of CARMA. It identifies a monitor point, and is used within all Frame classes to address monitor points.

Returns
tagIDType tagID
See Also
carma::monitor::MonitorHeader::tagID

Definition at line 398 of file MonitorPointHeader.h.

carma::monitor::MonitorPointHeader & carma::monitor::MonitorPointHeader::operator= ( const MonitorPointHeader rhs)

operator for assigning values to a MonitorPointHeader.

This method uses standard techniques to allow for a MonitorPointHeader to be part of treated as either an rvalue or as an lvalue.

Returns
reference to the modified MonitorPointHeader.

Definition at line 388 of file MonitorPointHeader.h.

void carma::monitor::MonitorPointHeader::setNumSamplesPerCycle ( const ushort  nSamples)

sets the number of samples per sampling cycle - which is currently standardized at half-second. Time to next cycle is determined by carma::util::Time.

The number of samples per cycle is determined by the sampling rate for the monitor point, which, for hardware, is determined by the micro controlling that piece of hardware.

Returns
void
See Also
carma::monitor::MonitorHeader::nSamples
void carma::monitor::MonitorPointHeader::setSampleOffset ( const ushort  sampleOffset)

sets a reference to the set of sampled data associated with the monitor point. For use by Frame methods only

The set of sampled data associated with the monitor point contains a number of samples determined by the number of samples per cycle, i.e. numSamplesPerCycle. This method provides a way to set this reference to the set of sampled monitor values within a frame structure.

Returns
void
See Also
carma::monitor::MonitorPointSample
carma::monitor::SubsystemHeader
carma::monitor::MonitorSystemFrame

Definition at line 199 of file MonitorPointHeader.h.

void carma::monitor::MonitorPointHeader::setSamplesPerCycle ( const ushort  nSamples)

sets the the filed "nSamples" in the MonitorHeader struct. Meant for use by other classes in this file. Do not use this method to change the sample rate - use setNumSamplesPerCycle instead.

The number of samples per cycle is determined by the sampling rate for the monitor point, which, for hardware, is detrmined by the micro controlling that piece of hardware.

Returns
void
See Also
carma::monitor::MonitorHeader::nSamples
carma::monitor::MonitorPointHeader::setNumSamplesPerCycle

Definition at line 267 of file MonitorPointHeader.h.


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