DataStatMovingAverage Class

Namespace: id3.Devices

Definition

(C++) Calculates the moving average of data points to provide a smoothed analysis of data trends over time, specifically designed for use in C++ environments.
typedef struct id3DevicesDataStatMovingAverage *ID3_DEVICES_DATA_STAT_MOVING_AVERAGE;

Usage

ID3_DEVICES_DATA_STAT_MOVING_AVERAGE hDataStatMovingAverage{};
int err = id3DevicesDataStatMovingAverage_Initialize(&hDataStatMovingAverage);
if (err == ID3_SUCCESS) {
    // ...
    id3DevicesDataStatMovingAverage_Dispose(&hDataStatMovingAverage);
}

Methods

Name

Description

addData

Incorporates a new data point into the moving average calculation, updating the average to reflect recent data trends.

getAverage

Retrieves the current moving average, reflecting the average value of the specified number of most recent data points.

setDataStatSize

Specifies the number of data points to consider in the moving average calculation, determining the ‘window’ size of the average.