TimestampOperator Class
(Automation::TimestampOperator)The TimestampOperator outputs the timestamp as a double value (with millisecond precision). More...
Header: | #include <TimestampOperator.h> |
Inherits: | CDPOperator<T> |
Public Functions
TimestampOperator(const CDPPropertyBase &in) |
Reimplemented Public Functions
- 18 public functions inherited from CDPOperator
- 17 public functions inherited from CDPOperatorBase
- 46 public functions inherited from CDPBaseObject
- 26 public functions inherited from CDP::StudioAPI::CDPNode
- 22 public functions inherited from CDP::StudioAPI::ICDPNode
Additional Inherited Members
- 1 public variable inherited from CDPOperatorBase
- 1 static public member inherited from CDPBaseObject
- 1 protected function inherited from CDP::StudioAPI::CDPNode
- 8 protected variables inherited from CDPOperator
- 5 protected variables inherited from CDPOperatorBase
- 11 protected variables inherited from CDPBaseObject
Detailed Description
The TimestampOperator outputs the timestamp as a double value (with millisecond precision).
If HwClock argument is set to true
more accurate (but slower) hardware time source is used, otherwise operator uses less expensive way to calculate the time from the last component run.
Arguments
Name | Description |
---|---|
Enable | Non-zero value enables generating timestamps |
SystemRunTime | When set to false (default) then time since epoch (00:00:00 UTC on 1 January 1970) is returned. When set to true then relative time since the system start is returned. |
HwClock | Use more accurate (but slower) hardware time source |
Out | Timestamp in seconds including milliseconds as decimal places of the value |
When operator is used inside a signal its default input is automatically tied to signal's InternalValue or previous operator's output. Its default output is automatically tied to next operator's input or to signal's Value. See also CDP Operator Usage In CDP Signals.
Actual Processing Code of the TimestampOperator
unsigned int TimestampOperator<double>::Process() { if (!m_systemRunTime || !m_hwClock) return STATUS_ERROR; if ((bool)*m_enable) { if ((bool)*m_systemRunTime) { if ((bool)m_hwClock) m_output = CDPTimer::Time(); else m_output = CDPTime::GetGlobalTime(); } else { if ((bool)m_hwClock) m_output = CDPTime::GlobalClock(); else m_output = CDPTime::GlobalClockMs(); } } return STATUS_OK; }
See also Argument.
Member Function Documentation
TimestampOperator::TimestampOperator(const CDPPropertyBase &in)
Default constructs an instance of TimestampOperator.
[override virtual]
void TimestampOperator::Configure(XMLPrimitive *operatorXML)
[override virtual]
unsigned int TimestampOperator::Process()
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.