openDAQ
Open data acquisition platform
IDataRule Struct Referenceabstract

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

+ Inheritance diagram for IDataRule:
+ Collaboration diagram for IDataRule:

Detailed Description

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

virtual ErrCode INTERFACE_FUNC getType (DataRuleType *type)=0
 Gets the type of the data rule. More...
 
virtual ErrCode INTERFACE_FUNC getParameters (IDict **parameters)=0
 Gets a dictionary of string-object key-value pairs representing the parameters used to evaluate the rule. More...
 
- Public Member Functions inherited from IBaseObject
virtual ErrCode INTERFACE_FUNC borrowInterface (const IntfID &intfID, void **obj) const =0
 Returns another interface which is supported by the object without incrementing the reference count. More...
 
virtual ErrCode INTERFACE_FUNC dispose ()=0
 Disposes all references held by the object. More...
 
virtual ErrCode INTERFACE_FUNC getHashCode (SizeT *hashCode)=0
 Returns hash code of the object. More...
 
virtual ErrCode INTERFACE_FUNC equals (IBaseObject *other, Bool *equal) const =0
 Compares object to another object for equality. More...
 
virtual ErrCode INTERFACE_FUNC toString (CharPtr *str)=0
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from IUnknown
virtual ErrCode INTERFACE_FUNC queryInterface (const IntfID &intfID, void **obj)=0
 Returns another interface which is supported by the object and increments the reference count. More...
 
virtual int INTERFACE_FUNC addRef ()=0
 Increments the reference count for an interface on an object. More...
 
virtual int INTERFACE_FUNC releaseRef ()=0
 Decrements the reference count for an interface on an object. More...
 

Member Function Documentation

◆ getParameters()

virtual ErrCode INTERFACE_FUNC getParameters ( IDict **  parameters)
pure virtual

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

Parameters
[out]parametersThe dictionary containing the rule parameter members.

◆ getType()

virtual ErrCode INTERFACE_FUNC getType ( DataRuleType type)
pure virtual

Gets the type of the data rule.

Parameters
[out]typeThe type of the data rule.