System.Beacon.TMeanCalculator.AddGetValue
Delphi
function AddGetValue(AValue: T; IsMoving: Boolean): T;
C++
T __fastcall AddGetValue(T AValue, bool IsMoving);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.Beacon.pas System.Beacon.hpp |
System.Beacon | TMeanCalculator |
Description
Calculates a stabilized value from the array of T and returns the calculated value.
Accepts the following parameters:
AValue: AddGetValue adds the provided value to the array ofTbefore it calculates the result.IsMoving: Indicates whether the beacon is moving. This affects the way AddGetValue calculates the result.- If
IsMovingisTruethe result is the mean of the array ofT.
- Note: If the array of
Tis full, AddGetValue empties the array ofTbefore adding the provided value to the array ofT. This improves the accuracy of the calculated value when the beacon is moving.
- If
IsMovingisFalseand the array ofTis not full, the result is the mean of the array ofT. - If
IsMovingisFalseand the array ofTis full, the result is the median of the array ofT.
- If
This function calls Get.