openDAQ
Open data acquisition platform
DataRulePtr Class Reference

Enumeration of available Data rule types. More...

Inherits ObjectPtr< IDataRule >.

Detailed Description

Enumeration of available Data rule types.

Rule that defines how a signal value is calculated from an implicit initialization value when the rule type is not Explicit.

Data rule objects implement the Struct methods internally and are Core type ctStruct.

Explicit rule

When the rule type of the Data rule is set to Explicit, the values passed through the signal path, described by the Value descriptor are stored in packet buffers.

The Explicit rule can have 2 optional parameters:

  • minExpectedDelta: Specifies the minimum difference in value between two subsequent samples
  • maxExpectedDelta: Specifies the maximum difference in value between two subsequent samples

These are mostly used for domain signals to specify the expected rate of a signal, or the expected timeout of a signal. The delta parameters should be configured to match the deltas in terms of the raw signal values (before scaling/resolution are applied).

An explicit rule must have either both or none of these parameters. To use only one, the other must be set to 0.

Implicit rule

When the rule type of the Data rule is not Explicit, the buffers of packets are empty. The values must instead be calculated via the Implicit value found in the packet buffers in conjunction with the parameters of the rule. Each implicit rule type specifies its own required set of parameters.

Linear rule

The parameters include a delta and start integer members. The values are calculated according to the following equation: packetOffset + sampleIndex * delta + start.

Linear rule

The parameters contain a constant number member. The value described by the constant rule is always equal to the constant.

Public Member Functions

daq::DataRuleType getType () const
 Gets the type of the data rule. More...
 
daq::DictPtr< daq::IString, daq::IBaseObject > getParameters () const
 Gets a dictionary of string-object key-value pairs representing the parameters used to evaluate the rule. More...
 

Member Function Documentation

◆ getParameters()

daq::DictPtr<daq::IString, daq::IBaseObject> getParameters ( ) const
inline

Gets a dictionary of string-object key-value pairs representing the parameters used to evaluate the rule.

Returns
The dictionary containing the rule parameter members.

◆ getType()

daq::DataRuleType getType ( ) const
inline

Gets the type of the data rule.

Returns
The type of the data rule.