Marsyas  0.5.0-beta1
Public Member Functions
TmSampleCount Class Reference

TmSampleCount reads the insamples information to advance the timer. More...

#include <TmSampleCount.h>

Inherits TmTimer.

Public Member Functions

mrs_natural intervalsize (std::string interval)
 convert the given interval into a number of samples.
mrs_natural readTimeSrc ()
 get the difference between the current source control value and its value since it was last read.
void setReadCtrl (MarSystem *ms, std::string cname)
 set the control that is to be the reference for this timer
void setSource (MarSystem *ms)
 set the MarSystem that contains the read control.
void setSourceCtrl (std::string cname)
 set the control path
 TmSampleCount ()
 empty constructor. The read source MarSystem and control are zero values and must be updated using setReadCtrl(...) Given the default name: Virtual as in "TmSampleTime/Virtual"
 TmSampleCount (std::string name)
 named constructor. The read source MarSystem and control are zero values and must be updated using setReadCtrl(...). Given the default name: "TmSampleTime/name"
 TmSampleCount (MarSystem *ms, std::string cname)
 main constructor. Has identifier "TmSampleCount/Virtual"
 TmSampleCount (const TmSampleCount &s)
 copy constructor
virtual void updtimer (std::string cname, TmControlValue value)
 update timer values.
virtual ~TmSampleCount ()

Detailed Description

TmSampleCount reads the insamples information to advance the timer.

Author:
Neil Burroughs inb@cs.uvic.ca

Definition at line 39 of file TmSampleCount.h.


Constructor & Destructor Documentation

empty constructor. The read source MarSystem and control are zero values and must be updated using setReadCtrl(...) Given the default name: Virtual as in "TmSampleTime/Virtual"

Definition at line 26 of file TmSampleCount.cpp.

TmSampleCount ( std::string  name)

named constructor. The read source MarSystem and control are zero values and must be updated using setReadCtrl(...). Given the default name: "TmSampleTime/name"

Parameters:
namea unique name to call this timer

Definition at line 31 of file TmSampleCount.cpp.

TmSampleCount ( MarSystem ms,
std::string  cname 
)

main constructor. Has identifier "TmSampleCount/Virtual"

Parameters:
msthe MarSystem that contains the control to read
cnamethe control name to read

Definition at line 36 of file TmSampleCount.cpp.

TmSampleCount ( const TmSampleCount s)

copy constructor

Parameters:
stimer to copy

Definition at line 41 of file TmSampleCount.cpp.

~TmSampleCount ( ) [virtual]

Definition at line 46 of file TmSampleCount.cpp.


Member Function Documentation

mrs_natural intervalsize ( std::string  interval) [virtual]

convert the given interval into a number of samples.

The interval must fall within sample time which can include standard time units: us, ms, s, m, h, d. The sample rate used for this function is the value of the mrs_real/israte control of the source MarSystem.

Parameters:
intervalthe interval to calculate
Returns:
the number of samples contained in the interval

Implements TmTimer.

Definition at line 87 of file TmSampleCount.cpp.

mrs_natural readTimeSrc ( ) [virtual]

get the difference between the current source control value and its value since it was last read.

Returns:
the count since last read

Implements TmTimer.

Definition at line 76 of file TmSampleCount.cpp.

void setReadCtrl ( MarSystem ms,
std::string  cname 
)

set the control that is to be the reference for this timer

Set the reference control for this timer. The control must be of type mrs_natural. The control value is read by getting a MarControlPtr from the MarSystem that owns the control then reading that pointer on each readTimeSrc() call.

Parameters:
msthe MarSystem that owns the control
cnamethe control name to read

Definition at line 49 of file TmSampleCount.cpp.

void setSource ( MarSystem ms)

set the MarSystem that contains the read control.

This method sets the read source to the parameter without checking. It then attempts to get the MarControlPtr for the control unless the read source is NULL or the read ctrl path is "". No warnings are produced.

Parameters:
msread source MarSystem

Definition at line 58 of file TmSampleCount.cpp.

void setSourceCtrl ( std::string  cname)

set the control path

This method sets the read control path to the parameter. It then attempts to get the MarControlPtr for the control unless the read source is NULL or the read ctrl path is "". No warnings are produced.

Parameters:
cnamethe control path to read from

Definition at line 67 of file TmSampleCount.cpp.

void updtimer ( std::string  cname,
TmControlValue  value 
) [virtual]

update timer values.

Allowable control values for this timer are: MarSystem/source, and mrs_string/control.

Parameters:
cnamethe control name of a timer value
valuethe value to update the control with

Reimplemented from TmTimer.

Definition at line 94 of file TmSampleCount.cpp.


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