CARMA C++
|
Frame containing monitor points for a monitor subsystem frame. More...
#include <carma/monitor/SubsystemFrame.h>
Public Member Functions | |
void | allocateMonitorPoints (const AllocMpInfo *infos, size_t infosCount, bool markMpsAsModified=true) |
method to allocate space within the subsystem frame for a monitor point and its samples. More... | |
void | clearAllTimes () |
Resets lastWriteTime, scriberWriteTime, publishTime and receiveTime to 0. More... | |
void | clearPublished () |
Clears status flag to indicate that this frame is not published. More... | |
void | clearReceived () |
Clears status flag to indicate that this frame has not been received. More... | |
void | consolidateSamples () |
Consolidates storage in the array of monitor samples. More... | |
long | countNumSingleSamplePoints () const |
Counts number of single sample monitor points in this subsystem frame. More... | |
long | getFrameCount () const |
Gets the frame's timestamp. More... | |
MonitorPointHeader | getHeaderByIndex (int index) const |
Returns maximum number of monitor samples this subsystem frame can accommodate. More... | |
MonitorPointHeader | getHeaderByTagID (const tagIDType tagID) const |
Returns MonitorPointHeader object corresponding to the monitor point with the specified tagID. More... | |
unsigned int | getHighwaterNumMonitorSamples (MonitorValueType type) |
Get highwater number of monitor samples. More... | |
int | getIndex (const tagIDType tagID) const |
Returns index of monitor point header corresponding to the specified tagID, in monitor header array in this subsystem frame. More... | |
double | getLastWriterDelay () const |
Returns the delay used by the last client to write to the associated frame scriber publisher process. More... | |
double | getLastWriteTime () const |
Gets the time of the last client write to the associated frame scriber publisher process. More... | |
long | getMaxNumMonitorPoints () const |
Returns maximum number of monitor points this subsystem frame can accommodate. More... | |
long | getMaxNumSamples () const |
Returns maximum number of monitor samples this subsystem frame can accommodate. More... | |
int | getNumActualSamples () const |
Returns number of monitor samples for this subsystem frame. More... | |
long | getNumMonitorPoints () const |
Returns allocated number of monitor points - in other words, the actual number of monitor points present in this subsystem frame. More... | |
long | getNumMonitorPoints (MonitorValueType type) const |
Returns allocated number of monitor points of type == 'type' - in other words, the actual number of monitor points of type 'type' present in this subsystem frame. More... | |
long | getNumMonitorSamples (MonitorValueType type) const |
Returns allocated number of monitor samples of type == 'type' - in other words, the actual number of monitor samples of type 'type' present in this subsystem frame. More... | |
long | getNumMonitorSamples () const |
Returns total allocated number of monitor samples in this subsystem frame. More... | |
ushort | getNumSamplesPerCycle (const tagIDType tagID) const |
Returns number of samples per cycle (0.5*sampling rate) associated with the monitor point with tagID == 'tagID'. More... | |
ushort | getNumSamplesPerCycle (const int index) const |
Returns number of samples per cycle (0.5*sampling rate) associated with the monitor point at index == 'index' in the monitorHeaders array in this subsystem frame. More... | |
long | getNumSingleSamplePoints () const |
Returns total allocated number of monitor points with one sample per cycle, a sampling rate of 2 Hz. More... | |
double | getPublishTime () const |
Returns the time when this subsystem frame was published to the ACC. More... | |
double | getReceiveTime () const |
Returns the time when this subsystem frame was received at the ACC. More... | |
const MonitorPointSample | getSampleAverage (const tagIDType tagID) const |
Returns average of all samples in current cycle as a MonitorPointSample object. More... | |
const MonitorPointSample | getSampleAverage (const int index) const |
Returns average of all samples in current cycle as a MonitorPointSample object. More... | |
MonitorPointSample | getSampleValue (const tagIDType tagID, ushort iSample) const |
Returns requested monitor sample as a MonitorPointSample object. More... | |
MonitorPointSample | getSampleValue (const int index, ushort iSample) const |
Returns requested monitor sample as a MonitorPointSample object. More... | |
double | getScriberWriteDelay () const |
Returns the delay used by the scriber part of the frameScriberPublisher to write to the associated IPQ in the subsystem. More... | |
double | getScriberWriteTime () const |
Gets the time of the last scriber write to the associated subsystem IPQ. More... | |
uchar | getStatusFlags () const |
Returns status flags for subsystem frame. More... | |
const SubsystemDataPointers & | getSubsystemDataPointers () const |
const SubsystemHeader & | getSubsystemHeader () const |
Returns reference to internal structure. More... | |
ushort | getSubsystemID () const |
Returns subsystemID of this subsystem frame. More... | |
tagIDType | getTagID (const int index) const |
Returns tagID of the monitor point with header at index "index" in the monitorHeaders array in this subsystem frame. More... | |
MonitorValueType | getValueType (const tagIDType tagID) const |
Returns type of sample value associated with the monitor point specified by tagID. More... | |
MonitorValueType | getValueType (const int index) const |
Returns type of sample value associated with the monitor point specified by index. More... | |
bool | isCurrentFrame () const |
Method returns true if frame's timestamp is current; false otherwise. More... | |
bool | isPublished () const |
True if this subsystem frame has been published. More... | |
bool | isValid (const tagIDType tagID) const |
True if tagID is that of a valid monitor point within this subsystem frame. More... | |
void | markFramePublished () |
Convenience method that sets the publish time and sets the status flag to indicate that the frame was published. More... | |
void | markFrameReceived () |
Convenience method that sets the recive time and sets the status flag to indicate that the frame was received. More... | |
bool | received () const |
True if this subsystem frame has been received by the frame collator (in the ACC). More... | |
long | setFrameCount (const long frameCount) |
Sets the frame's timestamp. More... | |
void | setLastWriterDelay (double time) |
Sets the delay used by the last client to write to the associated frame scriber publisher process. More... | |
void | setLastWriteTime (double mjdTimestamp) |
Sets the time of the last client write to the associated frame scriber publisher process. More... | |
void | setLastWriteTime () |
void | setNumActualSamples (ushort numSamples) |
Sets number of actual monitor samples for this subsystem frame. More... | |
void | setNumMonitorPoints (ushort numMonitorPoints) |
Sets number of monitor points for this subsystem frame. More... | |
void | setNumMonitorSamples (ushort numSamples) |
Sets number of monitor samples for this subsystem frame. More... | |
void | setNumSamplesPerCycle (int index, const ushort samples) |
Sets number of samples per cycle (0.5*sampling rate) associated with the monitor point at index == 'index' in the monitorHeaders array in this subsystem frame. More... | |
void | setNumSingleSamplePoints (const long numSingleSamples) |
Sets total allocated number of monitor points with one sample per cycle, a sampling rate of 2 Hz. More... | |
void | setPublished () |
Sets status flag to indicate that this frame is published. More... | |
void | setPublishTime (double mjdTimestamp) |
Sets the time when this subsystem frame was published to the ACC. More... | |
void | setPublishTime () |
void | setReceived () |
Sets status flag to indicate that this frame was received. More... | |
void | setReceiveTime (double mjdTimestamp) |
Sets the time when this subsystem frame was received at the ACC. More... | |
void | setReceiveTime () |
void | setScriberWriteDelay (double writeDelay) |
Sets the delay used by the scriber part of the frameScriberPublisher to write to the associated IPQ in the subsystem. More... | |
void | setScriberWriteTime (double mjdTimestamp) |
Sets the time of the last scriber write to the associated subsystem IPQ. More... | |
void | setScriberWriteTime () |
void | setStatusFlags (uchar status) |
Sets status flags for subsystem frame. More... | |
void | setSubsystemID (ushort subsystemID) |
Sets subsystemID of this subsystem frame. More... | |
SubsystemFrame (SubsystemHeader &frame, SubsystemDataPointers &dataPointers, bool embeddedInAFullSystem) | |
Constructor that constructs around a SubsystemHeader structure. More... | |
void | syncSubsystemToNewFrameData () |
Sets the pointers to the monitor point index array (monitorPointIndex), monitor point header array (monitorHeaders), and the monitor sample array (monitorValues). More... | |
bool | validSampleValue (const tagIDType tagID, const MonitorPointSample &value) const |
True if sample is valid - this means that the tagID of the monitor point is valid in this subsystem frame, and the sample index is within the range required by the monitor point's sampling rate. More... | |
void | writeFromPointSet (const MonitorSampleValues &samples) |
Takes the sample values from a transported sequence of sample values and fills them into this subsystem frame. More... | |
void | writeFromTransportFrame (const TransportSubsystemFrame &transFrame) |
Takes the sample values from a transported subsystem frame and fills them into this subsystem frame. More... | |
void | writeToTransport (TransportSubsystemFrame &transFrame) |
Returns a TransportSubsystemFrame filled with monitor sample values from this subsystem frame, ready for transport to the ACC for incorporation into the monitor system object in the ACC. More... | |
virtual | ~SubsystemFrame () |
Destructor. More... | |
Static Public Member Functions | |
static long | computeCurrentFrameTime () |
Static method used to calculate frame count as number of half-seconds since Januray 1, 2000. More... | |
static long | maxNumSamplesIncludingAverages (const long maxMonitorPoints, const long maxSamples) |
Returns number of samples to allocate for the entire subsystem given the maximum number of monitor points and maximum number of monitor samples the subsystem frame has to accommodate. More... | |
static bool | mjdIsCurrentFrame (double mjd, double *mjdDelta) |
static ushort | numSamplesToAllocate (const ushort nSamplesPerCycle) |
Returns the number of samples to allocate for a sampling rate specified as number of samples per cycle (a cycle is every half-second). More... | |
static void | setFrameSize (SubsystemHeader &frame, SubsystemDataPointers &dataPointers, long maxMonitorPoints, long maxSamples) |
Sets size parameters in the subsystem frame. More... | |
static size_t | sizeFrame (long maxMonitorPoints, long maxSamples) |
This method is used to compute the size of a subsystem frame when the the maximum number of monitor points and monitor samples it must accommodate are specified. More... | |
static void | syncSubsystemToNewFrameData (SubsystemHeader &frame, SubsystemDataPointers &dataPointers) |
Static Public Attributes | |
static const int | MONITOR_POINT_ABSENT = -1 |
Protected Member Functions | |
ushort | allocateSamples (int headerOffset, ushort sampleOffset, ushort nSamplesPerCycle=1) |
Allocates monitor samples in this subsystem frame for a monitor point with header at 'headerOffset', sampleOffset = 'sampleOffset' and samples per cycle == 'nSamplesPerCycle'. More... | |
void | clearSamples () |
Clears all samples in this subsystem frame. More... | |
int | findMonitorPoint (const tagIDType tagID) const |
Returns the index to the monitor point header corresponding to specified 'tagID'. More... | |
const MonitorHeader & | getMonitorHeaderRefByIndex (int index) const |
int | getNumAllocatedSamples () const |
Returns the number of allocated samples. More... | |
MonitorSampleValue * | getSamples () const |
Returns pointer to beginning of monitor sample array in this subsystem frame. More... | |
MonitorHeader & | getWritableMonitorHeaderRefByIndex (int index) const |
void | setMonitorPointSet (MonitorPointSet *set) |
Used when subsystem frame is generated from a MonitorPointSet object using the MonitorPointSet::getSubsystemFrame() method. More... | |
SubsystemFrame (ushort subsystemID, unsigned short numMonitorPoints, unsigned short numSamples, bool leakStorage) | |
Constructor that constructs a SubsystemHeader of the appropriate size and then constructs and initializes the SubsystemFrame object. More... | |
void | writeSampleValue (const int index, const MonitorSampleValue &value, ushort iSample) |
Writes specified sample value 'value' into this subsystem frame as sample with sample number 'iSample' for the monitor point at index 'index' in the monitorHeaders array. More... | |
Protected Attributes | |
SubsystemDataPointers & | dataPointers_ |
SubsystemHeader & | frame_ |
Friends | |
class | MonitorPointSet |
Frame containing monitor points for a monitor subsystem frame.
A monitor subsystem is any collection of CARMA components that communicates with the Array Control Computer through a single computer. In other words, a monitor subsystem is any collection of CARMA components that, from the viewpoint of the ACC, is controlled by one computer. A computer may control/host more than one subsystem - for example, the line length subsystem, and the LO Reference both live on one computer.
A SubsystemFrame is a collection of status information from a monitor subsystem, in the form of monitor points. A SubsystemFrameBuffer allows changes made to monitor point values in shared memory to be reflected in the local copy in this class instance.
NOTE: The term "monitor stream" as used in this document refers to all monitor data collected at each monitor subsystem, flowing to the ACC and merged there to form the totality of monitor information across all of CARMA. The term "client" as used in this document refers to clients of monitor system processes - these can be processes that write monitor data to the monitor stream, and processes that read monitor data from the monitor stream.
::carma::monitor::SubsystemFrameBuffer::read
Definition at line 80 of file SubsystemFrame.h.
carma::monitor::SubsystemFrame::SubsystemFrame | ( | SubsystemHeader & | frame, |
SubsystemDataPointers & | dataPointers, | ||
bool | embeddedInAFullSystem | ||
) |
Constructor that constructs around a SubsystemHeader structure.
Used primarily in creating MonitorSubsystem objects from MonitorSystem.
frame | SubsystemHeader& reference to a monitor subsystem frame. |
|
virtual |
Destructor.
Cleans up allocated memory if this->myFrame_ is true. Its virtual so that any classes that inherit from this will also get their destructors called. Very important!
|
protected |
Constructor that constructs a SubsystemHeader of the appropriate size and then constructs and initializes the SubsystemFrame object.
subsystemID | ushort ID of this subsystem frame |
numMonitorPoints | const ushort maxmimum number of monitor points this subsystemframe is expected to accommodate. |
numSamples | const ushort maxmimum number of monitor samples this subsystemframe is expected to accommodate. |
void carma::monitor::SubsystemFrame::allocateMonitorPoints | ( | const AllocMpInfo * | infos, |
size_t | infosCount, | ||
bool | markMpsAsModified = true |
||
) |
method to allocate space within the subsystem frame for a monitor point and its samples.
throws | an ErrorException if the frame does not have enough space to accomodate either the monitor point header or the associated samples. |
|
protected |
Allocates monitor samples in this subsystem frame for a monitor point with header at 'headerOffset', sampleOffset = 'sampleOffset' and samples per cycle == 'nSamplesPerCycle'.
Since most monitor points have a sampling rate of 2 Hz and the sampling cycle is 2 Hz, 'nSamplesPerCycle' has a default value of 1. Allocates the samples as well.
headerOffset | int index in monitorHeader array where the associated monitor header will live |
sampleOffset | ushort offset in the monitorValues array in this subsystem frame where the samples will be allocated. |
nSamplesPercycle | number of sampled values available per sampling cycle |
void carma::monitor::SubsystemFrame::clearAllTimes | ( | ) |
Resets lastWriteTime, scriberWriteTime, publishTime and receiveTime to 0.
void carma::monitor::SubsystemFrame::clearPublished | ( | ) |
Clears status flag to indicate that this frame is not published.
void carma::monitor::SubsystemFrame::clearReceived | ( | ) |
Clears status flag to indicate that this frame has not been received.
|
protected |
Clears all samples in this subsystem frame.
Resets the blanking/validity flags for every allocated sample.
|
static |
Static method used to calculate frame count as number of half-seconds since Januray 1, 2000.
void carma::monitor::SubsystemFrame::consolidateSamples | ( | ) |
Consolidates storage in the array of monitor samples.
"Holes" may occur due to a change in the number of samples asscociated with a monitor point. This method compacts samples, and makes the set allocated samples occupy contiguous space in the sample array, starting from index 0.
long carma::monitor::SubsystemFrame::countNumSingleSamplePoints | ( | ) | const |
Counts number of single sample monitor points in this subsystem frame.
Used to check allocation - if everything is right, then (countNumSingleSamplePoints() == getNumSingleSamplePoints()).
|
protected |
Returns the index to the monitor point header corresponding to specified 'tagID'.
Searches through the sorted index array using binary search to find the index for the specified 'tagID' and returns it, else returns MONITOR_POINT_ABSENT constant.
tagID | Identifier for monitor point |
long carma::monitor::SubsystemFrame::getFrameCount | ( | ) | const |
Gets the frame's timestamp.
Timestamp is measured in number of half-seconds elapsed since the CARMA Epoch - 00:00:00.00 January 1, 2000.
MonitorPointHeader carma::monitor::SubsystemFrame::getHeaderByIndex | ( | int | index | ) | const |
Returns maximum number of monitor samples this subsystem frame can accommodate.
MonitorPointHeader carma::monitor::SubsystemFrame::getHeaderByTagID | ( | const tagIDType | tagID | ) | const |
Returns MonitorPointHeader object corresponding to the monitor point with the specified tagID.
unsigned int carma::monitor::SubsystemFrame::getHighwaterNumMonitorSamples | ( | MonitorValueType | type | ) |
Get highwater number of monitor samples.
Returns the maximum number of monitor samples we've seen for a given sample for this subsystem.
int carma::monitor::SubsystemFrame::getIndex | ( | const tagIDType | tagID | ) | const |
Returns index of monitor point header corresponding to the specified tagID, in monitor header array in this subsystem frame.
double carma::monitor::SubsystemFrame::getLastWriterDelay | ( | ) | const |
Returns the delay used by the last client to write to the associated frame scriber publisher process.
There may be more than one client, but only the last one gets to survive. the delay is specified as a fraction of a second after the half-second tick - it is in the range [0.0, 500.0)
double carma::monitor::SubsystemFrame::getLastWriteTime | ( | ) | const |
Gets the time of the last client write to the associated frame scriber publisher process.
The time is specified as as an MJD.
long carma::monitor::SubsystemFrame::getMaxNumMonitorPoints | ( | ) | const |
Returns maximum number of monitor points this subsystem frame can accommodate.
long carma::monitor::SubsystemFrame::getMaxNumSamples | ( | ) | const |
Returns maximum number of monitor samples this subsystem frame can accommodate.
int carma::monitor::SubsystemFrame::getNumActualSamples | ( | ) | const |
Returns number of monitor samples for this subsystem frame.
|
protected |
Returns the number of allocated samples.
Includes "holes" created by requests to setNumSamplesperCycle. Used to determine place to allocate next set of samples.
Definition at line 991 of file SubsystemFrame.h.
long carma::monitor::SubsystemFrame::getNumMonitorPoints | ( | ) | const |
Returns allocated number of monitor points - in other words, the actual number of monitor points present in this subsystem frame.
Definition at line 956 of file SubsystemFrame.h.
long carma::monitor::SubsystemFrame::getNumMonitorPoints | ( | MonitorValueType | type | ) | const |
Returns allocated number of monitor points of type == 'type' - in other words, the actual number of monitor points of type 'type' present in this subsystem frame.
long carma::monitor::SubsystemFrame::getNumMonitorSamples | ( | MonitorValueType | type | ) | const |
Returns allocated number of monitor samples of type == 'type' - in other words, the actual number of monitor samples of type 'type' present in this subsystem frame.
Includes averages.
long carma::monitor::SubsystemFrame::getNumMonitorSamples | ( | ) | const |
Returns total allocated number of monitor samples in this subsystem frame.
Includes averages.
ushort carma::monitor::SubsystemFrame::getNumSamplesPerCycle | ( | const tagIDType | tagID | ) | const |
Returns number of samples per cycle (0.5*sampling rate) associated with the monitor point with tagID == 'tagID'.
tagID | identifies monitor point of interest |
unsigned short carma::monitor::SubsystemFrame::getNumSamplesPerCycle | ( | const int | index | ) | const |
Returns number of samples per cycle (0.5*sampling rate) associated with the monitor point at index == 'index' in the monitorHeaders array in this subsystem frame.
index | Index of monitor point of interest |
Definition at line 1006 of file SubsystemFrame.h.
long carma::monitor::SubsystemFrame::getNumSingleSamplePoints | ( | ) | const |
Returns total allocated number of monitor points with one sample per cycle, a sampling rate of 2 Hz.
Gets modified by each monitor point allocation.
double carma::monitor::SubsystemFrame::getPublishTime | ( | ) | const |
Returns the time when this subsystem frame was published to the ACC.
The time is specified as as an MJD.
double carma::monitor::SubsystemFrame::getReceiveTime | ( | ) | const |
Returns the time when this subsystem frame was received at the ACC.
The time is specified as as an MJD.
const MonitorPointSample carma::monitor::SubsystemFrame::getSampleAverage | ( | const tagIDType | tagID | ) | const |
Returns average of all samples in current cycle as a MonitorPointSample object.
This is equivalent to getSampleValue (tagID, 0).
tagID | Identifies the monitor point of interest |
const MonitorPointSample carma::monitor::SubsystemFrame::getSampleAverage | ( | const int | index | ) | const |
Returns average of all samples in current cycle as a MonitorPointSample object.
This is equivalent to getSampleValue (index, 0).
index | const int index of monitor point of interest |
|
protected |
Returns pointer to beginning of monitor sample array in this subsystem frame.
MonitorPointSample carma::monitor::SubsystemFrame::getSampleValue | ( | const tagIDType | tagID, |
ushort | iSample | ||
) | const |
Returns requested monitor sample as a MonitorPointSample object.
Monitor point sample is specified using tagID (monitor point identifier) and sample number (iSample) where iSample ranges from 0 to getNumSamplesPerCycle (tagID) when getNumSamplesPerCycle (tagID) > 1, 0 otherwise.
tagID | identifies monitor point of interest |
iSample | sample index in array of samples associated with monitor point. |
MonitorPointSample carma::monitor::SubsystemFrame::getSampleValue | ( | const int | index, |
ushort | iSample | ||
) | const |
Returns requested monitor sample as a MonitorPointSample object.
Monitor point sample is specified using index (monitor point index) and sample number (iSample) where iSample ranges from 0 to getNumSamplesPercycle (index) when getNumSamplesPerCycle (tagID) > 1, 0 otherwise.
index | identifies monitor point of interest |
iSample | sample index in array of samples associated with monitor point. |
double carma::monitor::SubsystemFrame::getScriberWriteDelay | ( | ) | const |
Returns the delay used by the scriber part of the frameScriberPublisher to write to the associated IPQ in the subsystem.
The delay is specified as a fraction of a second after the half-second tick - it is in the range [0.0, 500.0)
double carma::monitor::SubsystemFrame::getScriberWriteTime | ( | ) | const |
Gets the time of the last scriber write to the associated subsystem IPQ.
The time is specified as as an MJD.
uchar carma::monitor::SubsystemFrame::getStatusFlags | ( | ) | const |
Returns status flags for subsystem frame.
Used internally to determine if frame was written to IPQ, if frame has "holes" in it, if frame was published, and if frame was received.
const carma::monitor::SubsystemHeader & carma::monitor::SubsystemFrame::getSubsystemHeader | ( | ) | const |
Returns reference to internal structure.
Used by derived classes and other methods. Used for efficiency in internal monitor system methods only. Not meant for external use.
Definition at line 977 of file SubsystemFrame.h.
unsigned short carma::monitor::SubsystemFrame::getSubsystemID | ( | ) | const |
Returns subsystemID of this subsystem frame.
Definition at line 963 of file SubsystemFrame.h.
tagIDType carma::monitor::SubsystemFrame::getTagID | ( | const int | index | ) | const |
Returns tagID of the monitor point with header at index "index" in the monitorHeaders array in this subsystem frame.
MonitorValueType carma::monitor::SubsystemFrame::getValueType | ( | const tagIDType | tagID | ) | const |
Returns type of sample value associated with the monitor point specified by tagID.
tagID | Identifies the monitor point of interest |
MonitorValueType carma::monitor::SubsystemFrame::getValueType | ( | const int | index | ) | const |
Returns type of sample value associated with the monitor point specified by index.
index | const int identifies the monitor point of interest |
bool carma::monitor::SubsystemFrame::isCurrentFrame | ( | ) | const |
Method returns true if frame's timestamp is current; false otherwise.
bool carma::monitor::SubsystemFrame::isPublished | ( | ) | const |
True if this subsystem frame has been published.
bool carma::monitor::SubsystemFrame::isValid | ( | const tagIDType | tagID | ) | const |
True if tagID is that of a valid monitor point within this subsystem frame.
void carma::monitor::SubsystemFrame::markFramePublished | ( | ) |
Convenience method that sets the publish time and sets the status flag to indicate that the frame was published.
void carma::monitor::SubsystemFrame::markFrameReceived | ( | ) |
Convenience method that sets the recive time and sets the status flag to indicate that the frame was received.
|
static |
Returns number of samples to allocate for the entire subsystem given the maximum number of monitor points and maximum number of monitor samples the subsystem frame has to accommodate.
maxMonitorPoints | const long maximum number of monitor points in the subsystem frame |
maxSamples | const long maximum number of monitor point samples in the subsystem frame |
|
static |
Returns the number of samples to allocate for a sampling rate specified as number of samples per cycle (a cycle is every half-second).
Class static method.
nSamplesPerCycle | ushort sampling frequency, specified as number of samples every half-second. |
bool carma::monitor::SubsystemFrame::received | ( | ) | const |
True if this subsystem frame has been received by the frame collator (in the ACC).
long carma::monitor::SubsystemFrame::setFrameCount | ( | const long | frameCount | ) |
Sets the frame's timestamp.
Timestamp is measured in number of half-seconds elapsed since the CARMA Epoch.
|
static |
Sets size parameters in the subsystem frame.
Size of the frame is determined by the maximum number of monitor points and maximum number of samples the subsystem frame must accommodate.
frame | SubsystemHeader& frame whose size parameters must be set |
maxMonitorPoints | long maximum number of monitor points in the subsystem frame |
maxSamples | long maximum number of monitor point samples in the subsystem frame |
void carma::monitor::SubsystemFrame::setLastWriterDelay | ( | double | time | ) |
Sets the delay used by the last client to write to the associated frame scriber publisher process.
There may be more than one client, but only the last one gets to survive. the delay is specified as a fraction of a second after the half-second tick - it is in the range [0.0, 500.0)
time | double delay specified as fractions of a second |
void carma::monitor::SubsystemFrame::setLastWriteTime | ( | double | mjdTimestamp | ) |
Sets the time of the last client write to the associated frame scriber publisher process.
The time is specified as as an MJD.
mjdTimestamp | time of last client write specified as an MJD |
|
protected |
Used when subsystem frame is generated from a MonitorPointSet object using the MonitorPointSet::getSubsystemFrame() method.
Sets the monitor point set object which it comes from. Used to mark monitor points as modified.
set | MonitorPointSet* pointer to MonitorPointSet which was this subsystem frame's progenitor. |
Definition at line 970 of file SubsystemFrame.h.
void carma::monitor::SubsystemFrame::setNumActualSamples | ( | ushort | numSamples | ) |
Sets number of actual monitor samples for this subsystem frame.
numMonitorSamples | unsigned short number of monitor samples in this subsystem frame. |
void carma::monitor::SubsystemFrame::setNumMonitorPoints | ( | ushort | numMonitorPoints | ) |
Sets number of monitor points for this subsystem frame.
numMonitorPoints | unsigned short number of monitor points in this subsystem frame. |
void carma::monitor::SubsystemFrame::setNumMonitorSamples | ( | ushort | numSamples | ) |
Sets number of monitor samples for this subsystem frame.
numMonitorSamples | unsigned short number of monitor samples in this subsystem frame. |
void carma::monitor::SubsystemFrame::setNumSamplesPerCycle | ( | int | index, |
const ushort | samples | ||
) |
Sets number of samples per cycle (0.5*sampling rate) associated with the monitor point at index == 'index' in the monitorHeaders array in this subsystem frame.
Affects return values of getNumAllocatedSamples() and getNumMonitorSamples().
index | int index of monitor point of interest |
samples | ushort number of samples per cycle (a cycle is 500 ms) |
void carma::monitor::SubsystemFrame::setNumSingleSamplePoints | ( | const long | numSingleSamples | ) |
Sets total allocated number of monitor points with one sample per cycle, a sampling rate of 2 Hz.
Gets modified by each monitor point allocation.
long | actual number of monitor points with a single sample in this subsystem frame. |
void carma::monitor::SubsystemFrame::setPublished | ( | ) |
Sets status flag to indicate that this frame is published.
void carma::monitor::SubsystemFrame::setPublishTime | ( | double | mjdTimestamp | ) |
Sets the time when this subsystem frame was published to the ACC.
The time is specified as as an MJD.
mjdTimestamp | time of publication of this frame specified as an MJD |
void carma::monitor::SubsystemFrame::setReceived | ( | ) |
Sets status flag to indicate that this frame was received.
void carma::monitor::SubsystemFrame::setReceiveTime | ( | double | mjdTimestamp | ) |
Sets the time when this subsystem frame was received at the ACC.
The time is specified as as an MJD.
mjdTimestamp | time of reception of this frame specified as an MJD |
void carma::monitor::SubsystemFrame::setScriberWriteDelay | ( | double | writeDelay | ) |
Sets the delay used by the scriber part of the frameScriberPublisher to write to the associated IPQ in the subsystem.
The delay is specified as a fraction of a second after the half-second tick - it is in the range [0.0, 500.0)
writeDelay | double delay specified as fractions of a second |
void carma::monitor::SubsystemFrame::setScriberWriteTime | ( | double | mjdTimestamp | ) |
Sets the time of the last scriber write to the associated subsystem IPQ.
The time is specified as an MJD.
mjdTimestamp | time of last subsystem IPQ write specified as an MJD |
void carma::monitor::SubsystemFrame::setStatusFlags | ( | uchar | status | ) |
Sets status flags for subsystem frame.
Used internally to determine if frame was written to IPQ, if frame has "holes" in it, if frame was published, and if frame was received.
status | uchar set of 8 bit flags representing various status information about this frame. |
void carma::monitor::SubsystemFrame::setSubsystemID | ( | ushort | subsystemID | ) |
Sets subsystemID of this subsystem frame.
subsystemID | ushort subsystemID for this subsystem frame. |
|
static |
This method is used to compute the size of a subsystem frame when the the maximum number of monitor points and monitor samples it must accommodate are specified.
Returns the size as a size_t in bytes.
maxMonitorPoints | long maximum number of monitor points in the subsystem frame |
maxSamples | long maximum number of monitor point samples in the subsystem frame |
void carma::monitor::SubsystemFrame::syncSubsystemToNewFrameData | ( | ) |
Sets the pointers to the monitor point index array (monitorPointIndex), monitor point header array (monitorHeaders), and the monitor sample array (monitorValues).
These pointers have to be set so there's enough space for each of these arrays. This method is also called after a read as the pointers will be pointing to addresses in the address space of the process that last wrote to the IPQ.
bool carma::monitor::SubsystemFrame::validSampleValue | ( | const tagIDType | tagID, |
const MonitorPointSample & | value | ||
) | const |
True if sample is valid - this means that the tagID of the monitor point is valid in this subsystem frame, and the sample index is within the range required by the monitor point's sampling rate.
tagID | Identifies the monitor point associated with the sample 'value' |
value | const MonitorPointSample& sample being tested for validity |
void carma::monitor::SubsystemFrame::writeFromPointSet | ( | const MonitorSampleValues & | samples | ) |
Takes the sample values from a transported sequence of sample values and fills them into this subsystem frame.
These values replace corresponding values in this subsystem frame. It is assumed that only modified sample values are sent in the sequence dataSeq. Sent by carma::monitor::MonitorPointSet::write() .
dataSeq | const MonitorSamplevalueSeq& reference to transported sequence containing modified sample values for this subsystem |
void carma::monitor::SubsystemFrame::writeFromTransportFrame | ( | const TransportSubsystemFrame & | transFrame | ) |
Takes the sample values from a transported subsystem frame and fills them into this subsystem frame.
These values replace all values in this subsystem frame. It is assumed that all samples are available in the transport subsystem frame.
transportFrame | const TransportSubsystemFrame& reference to transported subsystem frame containing all sample values for this subsystem |
|
protected |
Writes specified sample value 'value' into this subsystem frame as sample with sample number 'iSample' for the monitor point at index 'index' in the monitorHeaders array.
index | const int index of monitor point header in monitorHeader array in this subsystem frame |
value | const MonitorSampleValue& value to be written |
iSample | ushort sample index in sample array associated with monitor point. |
void carma::monitor::SubsystemFrame::writeToTransport | ( | TransportSubsystemFrame & | transFrame | ) |
Returns a TransportSubsystemFrame filled with monitor sample values from this subsystem frame, ready for transport to the ACC for incorporation into the monitor system object in the ACC.
All subsystem frame header information is transported, with a sequence of sample values, where each value is associated with a sample index and a pointID (part of the monitor point tagID that is unique within a subsystem). The pointID serves to identify the associated monitor point as the subsystemID is sent as part of the header. All sample values from this subsystem frame are transported, including averages.
transFrame | TransportSubsystemFrame& reference to empty subsystem transport frame |