"curveDataAtOffset","curveDataAtOffsetX"

Returns the data which is available for a specific curve at a stated point in time with an additional offset to the value index.

Synopsis

trendObj.curveDataAtOffset(string curve, time ti, int offset, mapping &data);

getValue(trendObj, "curveDataAtOffset", string curve, time ti, int offset, mapping &data);

Parameter

Parameter Description
trendObj Trend for which the attributed should be get
curve Name of the curve
ti Point in time for which the data should be returned
offset Offset for the value index.
data Data that is returned

Description

The Function returns the data for a specific point of time for the given curve including an offset for the value index. Inside of the trend the values are stored within an array and using the offset previous or following values to a specific time inside of the trend can be queried. When using an offset of 0 the function behaves identical to the function "curveDataAt".

The offset can be a positive or negative value where a positive value is a newer value from the time perspective. If no value is available for the offset inside of the value array an empty mapping is returned.

The returned data is a mapping that contains following information/keys:

  • time - Exact time (might differ from the stated time)
  • status - The status of the curve as bit64
  • value - the corresponding value as float
  • formattedValue - The formatted value as displayed inside of the legend
  • msgCatKey - Contains the matched config keys for the "trendStatusPattern" (optional)
  • pointIcon - Path to the used icon file (optional)

If the curve is an event curve than the corresponding event data is returned as JSON mapping in addition to the mapping keys above.

Example

In following example the value for the time 2018,10,24,13,07 is queried including an offset of 4. For an example trend with the values inside the value array as described below the value of 50 is returned inside of the returned mapping.

Example - Trend Values

[2018,10,24,13,07] 10

[2018,10,24,13,08] 20

[2018,10,24,13,09] 30

[2018,10,24,13,10] 40

[2018,10,24,13,11] 50

main(mapping event)
{
  mapping data;
  time t1;
  int offset = 4;
  string curve = "one";
  t1 = makeTime(2018,10,24,13,07);
  DebugN(t1);
  data = TREND1.curveDataAtOffset(curve,t1,offset);
  DebugN(data);
}

Assignment

Trend