Description

The SmartAverage is a NumericPoint with an extension, the SmartAverageExt, which allows you to average the values of several points as well to synthesize their states. The components taken into account by the SmartAverage are the following:

  • NumericPoint
  • NumericPoint SmartOperators

The extension averages the values of the points and then returns the result to the NumericPoint in which it is located. The SmartAverageExt is a variation of the SmartStatusExt, which means that it performs the same job on the states as the SmartStatusExt.

In the case of a SmartAverage, the NumericPoint slot out will therefore contain the average of the points and the state resulting from the synthesis of all the states of the incoming points.

 

(info) Particular case: Case of a SmartAverage that takes inputs from other SmartAverage

If we consider other SmartOperators as MultiplePoints, i.e. as an aggregation of points, then the SmartAverage provides special processing. It does not consider the SmartOperator as a single point, but refers to it to get the number of valid points (TotalPointCount - InvalidPointCount) and the sum of its points (saved in the result slot). It will then add this number of points and the sum to its own calculations.

Example: A SmartAverage is the synthesis of 3 valid points whose sum is 180 and an average of 60.

A second SmartAverage works on this SmartAverage as well as on a valid point whose value is 20.

If the first SmartAverage is considered SinglePoint, then the result of the second SmartAverage will be as follows:

sumTotal = 60 (result of the first SmartOperator) + 20 (point value) = 80 and numberOfPoints = 2 so average = 80/2 = 40

However, if the first SmartAverage is considered MultiplePoints, then the result becomes: sumTotal = 180 + 20 = 200 and numberOfPoints = 3 + 1 = 4 so average = 200/4 = 50 

 

Implementation

Refer to the SmartOperator section for general description.

  • To use the SmartAdd component: copy paste a SmartAdd from the btibTooIkit palette to anywhere in the station.

          To use the extension in an existing point, copy and paste the SmartAddExt extension in the SmartAdd into a NumericPoint.

  • Select the points from Query request ((warning)Only NumericPoints will be taken into account)
  • Change the Enable property to true


Properties

The properties of the extension are the same as those of the SmartStatusExt.

The properties of the parent point are the same as those of the SmartStatusExt parent. However, two slots differ in type and content:

  • Out: This is a StatusNumeric that contains the average of the valid values of the incoming points. A value is considered invalid in these four cases:
    • The state of the point is invalid according to the InvalidStatus property
    • The value is Nan,
    • The value is +inf or -inf AND the ExcludelnfiniteValues property is true
    • If autoConversion is enabled and the input slot units are not convertible in the SmartOperator unit
    • Value: This is a Double that contains the out value


Advanced configuration property:

  • Conversion Auto: Enables the automatic conversion of values according to the facets of the "value" slot. See the "Converting Values" section below for more explanation.


Actions

  • The actions of the SmartAverageExt are the same as those of SmartStatusExt


Converting values

SmartOperators that work on numeric values take into account the units of the values processed.

  • Initialization:
    • The facets of the "out" property of the SmartOperator are applied to the "value" slot

                   (warning) It is therefore necessary to relaunch an initialization when the facets of the "out" property change so that this modification is taken into account

  • "autoConversion" property of the advancedConfig:
    • If enabled, the units of the input slots are compared to those of the "value" slot facets. If they are not compatible, the input slot is ignored and is considered an invalid input
    • If not activated, slot units are not checked
    • Execution:
      • The input values are converted according to the units of the "value" slot