openDAQ
Open data acquisition platform
ScalingPtr Class Reference

Enumeration of available scaling types. More...

Inherits ObjectPtr< IScaling >.

Detailed Description

Enumeration of available scaling types.

Signal descriptor field that defines a scaling transformation, which should be applied to data carried by the signal's packets when read.

Each scaling specifies its scalingType and parses the parameters accordingly. The parameters are to be interpreted and used as specified by each specific scaling type as detailed below.

Additionally, each Scaling object states is input and output data types. The inputDataType describes the raw data type of the signal value (that data is input into the scaling scaling), while the outputDataType should match the sample type of the signal's value descriptor. Scaling objects implement the Struct methods internally and are Core type ctStruct.

Scaling types

Linear scaling

Linear scaling parameters must have two entries:

  • Scale: coefficient by which the input data is to be multiplied
  • Offset: a constant that is added to the scale * value multiplication result

The linear scaling output is calculated as follows: inputValue * scale + offset

Public Member Functions

daq::SampleType getInputSampleType () const
 Gets the scaling's input data type. More...
 
daq::ScaledSampleType getOutputSampleType () const
 Gets the scaling's output data type. More...
 
daq::ScalingType getType () const
 Gets the type of the scaling that determines how the scaling parameters should be interpreted and how the scaling should be calculated. More...
 
daq::DictPtr< daq::IString, daq::IBaseObject > getParameters () const
 Gets the dictionary of parameters that are used to calculate the scaling in conjunction with the input data. More...
 

Member Function Documentation

◆ getInputSampleType()

daq::SampleType getInputSampleType ( ) const
inline

Gets the scaling's input data type.

Returns
The input data type

The input data type corresponds to the raw values passed through the signal path in data packets.

◆ getOutputSampleType()

daq::ScaledSampleType getOutputSampleType ( ) const
inline

Gets the scaling's output data type.

Returns
The output data type

The output data type corresponds to the sample type specified in the value descriptor of a signal, and is the type in which said signal's data should be read in after having the scaling applied to it.

◆ getParameters()

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

Gets the dictionary of parameters that are used to calculate the scaling in conjunction with the input data.

Returns
The dictionary of parameters.

◆ getType()

daq::ScalingType getType ( ) const
inline

Gets the type of the scaling that determines how the scaling parameters should be interpreted and how the scaling should be calculated.

Returns
The type of the scaling.