openDAQ
Open data acquisition platform
DimensionRulePtr Class Reference

Enumeration of available rule types. More...

Inherits ObjectPtr< IDimensionRule >.

Detailed Description

Enumeration of available rule types.

Rule that defines the labels (alternatively called bins, ticks) of a dimension.

Each dimension has a rule, which is queried and parsed by the dimension getLabels and getSize calls. Three different rule types are supported by openDAQ, with all others having to be set to custom type, requiring anyone using them to parse them manually.

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

Rule types

Linear dimension rule

The parameters include a delta, start, and size number members. The list of labels of size size is generated by the equation: index * delta + start, where the index starts with 0 and goes up to size - 1.

In example: delta = 10, start = 5, size = 5 produces the following list of samples -> [5, 15, 25, 35, 45]

Logarithmic dimension rule

The parameters include a delta, start, base and size number members. The list of labels of size size is generated by the equation: base ^ (index * delta + start), where the index starts with 0 and goes up to size - 1.

In example: delta = 1, start = -2, base = 10 size = 5 produces the following list of samples -> [0.01, 0.1, 1, 10, 20]

List dimension rule

The parameters include a list list-typed member. The list contains labels, implicitly also defining the dimension size. The labels in the list can be either strings, numbers, or ranges.

String example list: list = ["banana", "apple", "coconut"] Number example list: = [1.2, 10.5, 20.2, 50.7] Range example list: [1-10, 10-20, 20-30, 30-40, 40-50]

Public Member Functions

daq::DimensionRuleType getType () const
 Gets the type of the dimension 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::DimensionRuleType getType ( ) const
inline

Gets the type of the dimension rule.

Returns
The type of the dimension rule.