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

Frame containing monitor points for a monitor subsystem frame. More...

#include <carma/monitor/SubsystemFrame.h>

Inheritance diagram for carma::monitor::SubsystemFrame:
carma::monitor::SubsystemFrameBuffer

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 SubsystemHeadergetSubsystemHeader () 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...
 
MonitorSampleValuegetSamples () 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_
 
SubsystemHeaderframe_
 

Friends

class MonitorPointSet
 

Detailed Description

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

See Also
carma::monitor::SubsystemFrameBuffer
carma::monitor::MonitorSubsystem
carma/monitor/monitorframe.idl
http://www.mmarray.org/project/WP/Monitoring/monitoringDesign.pdf

Definition at line 80 of file SubsystemFrame.h.

Constructor & Destructor Documentation

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.

Parameters
frameSubsystemHeader& reference to a monitor subsystem frame.
virtual carma::monitor::SubsystemFrame::~SubsystemFrame ( )
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!

carma::monitor::SubsystemFrame::SubsystemFrame ( ushort  subsystemID,
unsigned short  numMonitorPoints,
unsigned short  numSamples,
bool  leakStorage 
)
protected

Constructor that constructs a SubsystemHeader of the appropriate size and then constructs and initializes the SubsystemFrame object.

Parameters
subsystemIDushort ID of this subsystem frame
numMonitorPointsconst ushort maxmimum number of monitor points this subsystemframe is expected to accommodate.
numSamplesconst ushort maxmimum number of monitor samples this subsystemframe is expected to accommodate.

Member Function Documentation

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.

Exceptions
throwsan ErrorException if the frame does not have enough space to accomodate either the monitor point header or the associated samples.
ushort carma::monitor::SubsystemFrame::allocateSamples ( int  headerOffset,
ushort  sampleOffset,
ushort  nSamplesPerCycle = 1 
)
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.

Parameters
headerOffsetint index in monitorHeader array where the associated monitor header will live
sampleOffsetushort offset in the monitorValues array in this subsystem frame where the samples will be allocated.
nSamplesPercyclenumber of sampled values available per sampling cycle
Returns
int sample offset (sampleOffset) in sample array
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.

void carma::monitor::SubsystemFrame::clearSamples ( )
protected

Clears all samples in this subsystem frame.

Resets the blanking/validity flags for every allocated sample.

static long carma::monitor::SubsystemFrame::computeCurrentFrameTime ( )
static

Static method used to calculate frame count as number of half-seconds since Januray 1, 2000.

See Also
carma::util::Time.h
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()).

Returns
long counted number of monitor points with a single sample in this subsystem frame.
int carma::monitor::SubsystemFrame::findMonitorPoint ( const tagIDType  tagID) const
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.

Parameters
tagIDIdentifier for monitor point
Returns
int index of monito point header
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.

Returns
long timestamp for this frame.
See Also
carma::util::Time
MonitorPointHeader carma::monitor::SubsystemFrame::getHeaderByIndex ( int  index) const

Returns maximum number of monitor samples this subsystem frame can accommodate.

Returns
long maximum number of monitor samples this subsystem frame can accomodate.
MonitorPointHeader carma::monitor::SubsystemFrame::getHeaderByTagID ( const tagIDType  tagID) const

Returns MonitorPointHeader object corresponding to the monitor point with the specified tagID.

Todo:
add IllegalMonitorPoint exception
Returns
MonitorPointHeader maximum number of monitor samples this subsystem frame can accomodate.
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.

Todo:
add IllegalMonitorPoint exception
Returns
int index of moinitor point header with specified tagID
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)

Returns
double delay specified as fractions of a second
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.

Returns
double time of last client write specified as an MJD
long carma::monitor::SubsystemFrame::getMaxNumMonitorPoints ( ) const

Returns maximum number of monitor points this subsystem frame can accommodate.

Returns
long maximum number of monitor points this subsystem frame can accomodate.
long carma::monitor::SubsystemFrame::getMaxNumSamples ( ) const

Returns maximum number of monitor samples this subsystem frame can accommodate.

Returns
long maximum number of monitor samples this subsystem frame can accomodate.
int carma::monitor::SubsystemFrame::getNumActualSamples ( ) const

Returns number of monitor samples for this subsystem frame.

Returns
int actual number of monitor samples in this subsystem frame.
int carma::monitor::SubsystemFrame::getNumAllocatedSamples ( ) const
protected

Returns the number of allocated samples.

Includes "holes" created by requests to setNumSamplesperCycle. Used to determine place to allocate next set of samples.

Returns
int number of allocated 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.

Returns
long actual number of monitor points 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.

Returns
long actual number of monitor points of specified type 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.

Returns
long actual number of monitor samples of specified type in this subsystem frame.
long carma::monitor::SubsystemFrame::getNumMonitorSamples ( ) const

Returns total allocated number of monitor samples in this subsystem frame.

Includes averages.

Returns
long actual, total number of monitor samples in this subsystem frame.
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'.

Parameters
tagIDidentifies monitor point of interest
Returns
ushort number of samples per cycle (a cycle is 500 ms)
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.

Parameters
indexIndex of monitor point of interest
Returns
ushort number of samples per cycle (a cycle is 500 ms)

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.

Returns
long actual number of monitor points with a single sample in this subsystem frame.
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.

Returns
double time of publication of this frame, specified 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.

Returns
double time of reception of this frame, specified 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).

Parameters
tagIDIdentifies the monitor point of interest
Returns
MonitorPointSample average of all samples in current cycle for monitor point with tagID == 'tagID'.
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).

Parameters
indexconst int index of monitor point of interest
Returns
MonitorPointSample average of all samples in current cycle for monitor point at index == 'index'.
MonitorSampleValue* carma::monitor::SubsystemFrame::getSamples ( ) const
protected

Returns pointer to beginning of monitor sample array in this subsystem frame.

Returns
MonitorSampleValue* pointer to first element in 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.

Parameters
tagIDidentifies monitor point of interest
iSamplesample index in array of samples associated with monitor point.
Returns
MonitorPointSample object representing the requested sample value
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.

Parameters
indexidentifies monitor point of interest
iSamplesample index in array of samples associated with monitor point.
Returns
MonitorPointSample object representing the requested sample value
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)

Returns
double delay specified as fractions of a second
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.

Returns
double time of last subsystem IPQ write specified 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.

Returns
uchar set of 8 bit flags representing various status information about this frame.
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.

Returns
SubsystemHeader& reference to structure that stores actual monitor points.

Definition at line 977 of file SubsystemFrame.h.

unsigned short carma::monitor::SubsystemFrame::getSubsystemID ( ) const

Returns subsystemID of this subsystem frame.

Returns
ushort subsystemID for 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.

Returns
tagID associated with monitor point header at index
MonitorValueType carma::monitor::SubsystemFrame::getValueType ( const tagIDType  tagID) const

Returns type of sample value associated with the monitor point specified by tagID.

Parameters
tagIDIdentifies the monitor point of interest
Returns
MonitorValueType value type of samples from monitor point
See Also
carma::monitor::MonitorValueType
MonitorValueType carma::monitor::SubsystemFrame::getValueType ( const int  index) const

Returns type of sample value associated with the monitor point specified by index.

Parameters
indexconst int identifies the monitor point of interest
Returns
MonitorValueType value type of samples from monitor point
See Also
carma::monitor::MonitorValueType
bool carma::monitor::SubsystemFrame::isCurrentFrame ( ) const

Method returns true if frame's timestamp is current; false otherwise.

Returns
bool true if frame's timestamp (frameCount) is current
bool carma::monitor::SubsystemFrame::isPublished ( ) const

True if this subsystem frame has been published.

Returns
bool 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.

Returns
bool true if monitor point with specified tagID is found in 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 long carma::monitor::SubsystemFrame::maxNumSamplesIncludingAverages ( const long  maxMonitorPoints,
const long  maxSamples 
)
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.

Parameters
maxMonitorPointsconst long maximum number of monitor points in the subsystem frame
maxSamplesconst long maximum number of monitor point samples in the subsystem frame
Returns
long number of samples to allocate - includes space for averages and string expansion.
static ushort carma::monitor::SubsystemFrame::numSamplesToAllocate ( const ushort  nSamplesPerCycle)
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.

Parameters
nSamplesPerCycleushort sampling frequency, specified as number of samples every half-second.
Returns
# of samples to allocate - includes average if nSamplesPerCycle > 1.
bool carma::monitor::SubsystemFrame::received ( ) const

True if this subsystem frame has been received by the frame collator (in the ACC).

Returns
bool true if this subsystem frame has been published and received.
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.

Returns
long timestamp for this frame.
See Also
carma::util::Time
static void carma::monitor::SubsystemFrame::setFrameSize ( SubsystemHeader frame,
SubsystemDataPointers &  dataPointers,
long  maxMonitorPoints,
long  maxSamples 
)
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.

Parameters
frameSubsystemHeader& frame whose size parameters must be set
maxMonitorPointslong maximum number of monitor points in the subsystem frame
maxSampleslong 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)

Parameters
timedouble 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.

Parameters
mjdTimestamptime of last client write specified as an MJD
void carma::monitor::SubsystemFrame::setMonitorPointSet ( MonitorPointSet set)
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.

Parameters
setMonitorPointSet* pointer to MonitorPointSet which was this subsystem frame's progenitor.
See Also
carma::monitor::MonitorPointSet

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.

Parameters
numMonitorSamplesunsigned 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.

Parameters
numMonitorPointsunsigned 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.

Parameters
numMonitorSamplesunsigned 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().

Parameters
indexint index of monitor point of interest
samplesushort 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.

Parameters
longactual 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.

Parameters
mjdTimestamptime 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.

Parameters
mjdTimestamptime 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)

Parameters
writeDelaydouble 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.

Parameters
mjdTimestamptime 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.

Parameters
statusuchar 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.

Parameters
subsystemIDushort subsystemID for this subsystem frame.
static size_t carma::monitor::SubsystemFrame::sizeFrame ( long  maxMonitorPoints,
long  maxSamples 
)
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.

Parameters
maxMonitorPointslong maximum number of monitor points in the subsystem frame
maxSampleslong maximum number of monitor point samples in the subsystem frame
Returns
size_t size of subsystem frame to accommodate maxMonitorPoints and maxsamples, in bytes.
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.

Parameters
tagIDIdentifies the monitor point associated with the sample 'value'
valueconst MonitorPointSample& sample being tested for validity
Returns
bool true if sample is valid
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() .

Parameters
dataSeqconst MonitorSamplevalueSeq& reference to transported sequence containing modified sample values for this subsystem
See Also
carma/monitor/monitorframe.idl
::carma::monitor::MonitorSampleValueSeq
carma::monitor::MonitorPointSet
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.

Parameters
transportFrameconst TransportSubsystemFrame& reference to transported subsystem frame containing all sample values for this subsystem
See Also
carma/monitor/monitorframe.idl
carma::monitor::TransportSubsystemFrame
carma::monitor::SubsystemHeader
void carma::monitor::SubsystemFrame::writeSampleValue ( const int  index,
const MonitorSampleValue value,
ushort  iSample 
)
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.

Parameters
indexconst int index of monitor point header in monitorHeader array in this subsystem frame
valueconst MonitorSampleValue& value to be written
iSampleushort 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.

Parameters
transFrameTransportSubsystemFrame& reference to empty subsystem transport frame
See Also
carma/monitor/monitorframe.idl
carma::monitor::TransportSubsystemFrame
carma::monitor::SubsystemHeader

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