Marsyas
0.6.0-alpha
|
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 () |
TmSampleCount reads the insamples information to advance the timer.
Definition at line 39 of file TmSampleCount.h.
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"
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"
name | a 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"
ms | the MarSystem that contains the control to read |
cname | the control name to read |
Definition at line 36 of file TmSampleCount.cpp.
TmSampleCount | ( | const TmSampleCount & | s | ) |
~TmSampleCount | ( | ) | [virtual] |
Definition at line 46 of file TmSampleCount.cpp.
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.
interval | the interval to calculate |
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.
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.
ms | the MarSystem that owns the control |
cname | the control name to read |
Definition at line 49 of file TmSampleCount.cpp.
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.
ms | read 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.
cname | the 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.
cname | the control name of a timer value |
value | the value to update the control with |
Reimplemented from TmTimer.
Definition at line 94 of file TmSampleCount.cpp.