Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Module description

This module allows to compute a boolean operation across multiple input status points in order to produce a single output status point.

...

The types of boolean operations currently available are:

  • Boolean OR
  • OR

NB: Operations are unaware of other operations, which have two major consequences:

  • Operations cannot be chained: the output of an operation cannot be used as the input of another.
  • If multiple operations are defined on the same status point, they will overwrite each other's results.

Operation on input that is not the output:

Image Added

Operation on input that is also the output:

Image AddedTODO: Diagramme

Configuration

The following attributes are read from the Exchanged data configuration:

  • An array of operations that will generate the current status point as output
  • For each operation:
    • The type of operation
    • The list of inputs status points (Pivot ID)

Filtering rules

R1 : Only status points with a Pivot ID that appear in as input of at least one of the operations are processed.

R2 : When receiving such status point convert its value to an internal boolean value [0-1] that is later called the operation input value.

  • For simple point data type operation input value = status point value unchanged.
  • For double point data type operation input value = 1 if the status point value is "on", else 0.

R3 : List all operations using the received status point as input and apply the following for each of them.

R3.1 : Use the values of all operation inputs to compute the operation result based on the operation type:

  • OR: Compute the logical OR of all inputs defined as "0 if all inputs are 0, else 1".

R3.2 : If one of the inputs was never received, assume its value is 0.

R3.3 : Create a new PIVOT object for the output status point and copy to it all fields from the received input status point (convert if needed the <PivotType>  section to match the type of the output status point).

R3.4 : Set the following values on the PIVOT object based on the operation type :

...

:

...

If

...

R3.5 : Send the generated status point.

R4 : If any of the mandatory PIVOT fields necessary to identify or compute the operation is missing in the received reading, no output reading is generated for the operation.

R5 R3 : If the input status point received is also the output status point and an output reading was generated with no error, delete the reading of the input status point, else the input reading is forwarded unchanged.

Data processing

Input

This filter plugin expects readings to be a pivot model status point datapoints.

...

The data read from the pivots format are :

  • PIVOT.GTIMGTIS.SpsTyp.stVal => input value in bool format [0-1]
  • PIVOT.GTIMGTIS.DpsTyp.stVal => input value in enum format ("intermediate-state" | "off" | "on" | "bad-state")

Output

The input status point is forwarded unchanged or deleted based on rule R3.

For each operation having the received status point as one of its input, generate a new status point as described below.

The value of the status point received is converted internally as follow based on the operation type to become the operation input value :

  • OR:
    • For simple point data type, operation input value = value unchanged.
    • For double point data type, operation input value = 1 if the value is "on", else 0.

The operation result is computed as follow based on the operation type:

  • OR: Compute the logical OR of all operation input values (0 if all inputs are 0, else 1).

If one of the inputs was never received, assume its value is 0.

A new status points is generated with the following format based on the operation output data point type generated output data points have the following format :

  • For a simple point data type :
    • PIVOT.GTIS.* = copy from input PIVOT.GITS

       

      .*

    • PIVOT.GTIS.Identifier = output status point pivot ID
    • PIVOT.GTIS.SpsTyp.* = copy from input GTIS PIVOT.GITS.<PivotType>.*
    • PIVOT.GTIS.SpsTyp.stVal = operation result
    • PIVOT.GTIS.SpsTyp.q.Source = "substituted"
  • For a double point data type :
    • PIVOT.GTIS.* = copy from input PIVOT.GITS.*
    • PIVOT.GTIS.Identifier = output status point pivot ID
    • PIVOT.GTIS.DpsTyp.* = copy from input PIVOT.GTISGITS.<PivotType> .*
    • PIVOT.GTIS.DpsTyp.stVal"on" if operation result is 1, else "off"
    • PIVOT.GTIS.DpsTyp.q.Source = "substituted"

...