"curveDataSourceCurve"

The attribute "curveDataSourceCurve" specifies another curve as data source for a curve.

Synopsis

shape.curveDataSourceCurve(string curve, string sourceCurve, mapping options);

Parameters

Parameter Description
shape Object name
curve The curve which will calculate the data from the sourceCurve
sourceCurve The curve which represents the data source. If this is given as an empty string, the auto-calculation is removed.
options An optional mapping to specify the curve calculations and intervals. If this is left as an empty string ("") the default setting is applied:
  • Calculation of the average ("avg") in a 3600 second interval.

Details

The function "curveDataSourceCurve" will by default automatically calculate the average("avg") of the sourceCurve and display it as the given curve. Modifications to this behaviour can be passed via the optional options mapping. This mapping can contain the following key/value pairs:

Key Value Datatype Value Description
"interval" uint The seconds per calculation interval.
"func" string The statistical function to be used. The statistical functions are described in datapoint functions - statistical functions. Please refer to the table for the corresponding CTRL constants. The statistical functions which can be used in this curve function are:
  • "avg": Average (SF_AVG)
  • "avgWT": Average 0/1 (SF_AVG_WT0 / SF_AVG_WT1). Whether the values are interpolated over a stepped curve or over a linear interpolated curve depends on whether the sourceCurve is either STEPS or LINEAR. In case any other type is used, the default is STEPS. The interpolation mode however can be defined by passing another key/value pair:
    • "mode"(int): The int value defines either 0 (steps) or 1 (linear) interpolation.
  • "integral": Integral 0/1 (SF_INTEGRAL0 / SF_INTEGRAL1). The interpolation "mode" is defined as described above at the "avgWT" function.
  • "min": Minimum (SF_MIN)
  • "max": Maximum (SF_MAX)
  • "sum": Sum (SF_SUM)
  • "diff": Difference (SF_DIFF)
  • "count": Number (SF_NUMBER)
  • "startValue": Start Value (SF_SAMPLE). The first value might depend on the last value of the previous interval, interpolated with "mode" in the way described at "avgWT".
  • "endValue": End Value (SF_ENDVALUE). The last value might depend on the first value of the next interval, interpolated with "mode" in the way described at "avgWT".
  • "changes": State Changes (SF_CHANGES). Note that this counts any binary changes (changes between 0 and 1)
  • "changes01": Changes 0 > 1 (SF_CHANGES01)
  • "changes10": Changes 1 > 0 (SF_CHANGES10)
  • "time0": Time 0 (SF_TIME0)
  • "time1": Time 1 (SF_TIME1)
"timeAt" string This option influences the time stamp used for the calculated value. It can be one of the following:
  • "start": The time used is the start time of each calculation period
  • "end": The time used is the end time of each calculation period
  • "mid": The time used is in the middle of each calculation period. This is the default.
  • "value": This is special for the "min" and "max" functions. In this mode, the time used is the time at which the minimum or maximum occurred.

Assignment

Trend