openDAQ
Open data acquisition platform
IScaling Struct Referenceabstract

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

+ Inheritance diagram for IScaling:
+ Collaboration diagram for IScaling:

Detailed Description

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

virtual ErrCode INTERFACE_FUNC getInputSampleType (SampleType *type)=0
 Gets the scaling's input data type. More...
 
virtual ErrCode INTERFACE_FUNC getOutputSampleType (ScaledSampleType *type)=0
 Gets the scaling's output data type. More...
 
virtual ErrCode INTERFACE_FUNC getType (ScalingType *type)=0
 Gets the type of the scaling that determines how the scaling parameters should be interpreted and how the scaling should be calculated. More...
 
virtual ErrCode INTERFACE_FUNC getParameters (IDict **parameters)=0
 Gets the dictionary of parameters that are used to calculate the scaling in conjunction with the input data. 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

◆ getInputSampleType()

virtual ErrCode INTERFACE_FUNC getInputSampleType ( SampleType *  type)
pure virtual

Gets the scaling's input data type.

Parameters
[out]typeThe input data type

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

◆ getOutputSampleType()

virtual ErrCode INTERFACE_FUNC getOutputSampleType ( ScaledSampleType *  type)
pure virtual

Gets the scaling's output data type.

Parameters
[out]typeThe 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()

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

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

Parameters
[out]parametersThe dictionary of parameters.

◆ getType()

virtual ErrCode INTERFACE_FUNC getType ( ScalingType type)
pure virtual

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

Parameters
[out]typeThe type of the scaling.