CARMA C++
|
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 MonitorSampleValue & | getAverageMonitorSampleValueRef () const |
MonitorSampleValue & | getAverageMonitorSampleValueRef () |
MonitorPointSample | getMonitorPointSample (int iSample) |
gets the ith sample from the set of sampled monitor values associated with the monitor point. More... | |
const MonitorSampleValue & | getMonitorSampleValueRef (int iSample) const |
MonitorSampleValue & | getMonitorSampleValueRef (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... | |
MonitorPointHeader & | operator= (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... | |
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.
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.
header | MonitorHeader& reference to MonitorHeader structure |
samples | MonitorSampleValue* const pointer to beginning of array of monitor point samples in the enclosing subsystem frame. |
index | int offset of this monitor point header that represents the monitor point in the containing SubsystemFrame. |
set | MonitorPointSet* const pointer to MonitorPointSet that contains and manages storage for this monitor point. |
Definition at line 368 of file MonitorPointHeader.h.
carma::monitor::MonitorPointHeader::~MonitorPointHeader | ( | ) |
Destructor.
Definition at line 382 of file MonitorPointHeader.h.
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'.
bool | deallocate free sample storage if true, default value is false. |
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.
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.
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.
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.
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.
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.
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.
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.
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.
Definition at line 267 of file MonitorPointHeader.h.