Class DataMonitoring

The DataMonitoring class tracks and collects device parameter values.

Unlike startMonitoring, which returns an observable that never completes on its own, this class provides a stop() method to complete the monitoring observable, enabling the use of operators like toArray() as intended.

Hierarchy

  • DataMonitoring

Constructors

Properties

collect: boolean = true

Besides emitting monitored data through the observable created by the #start() method, an instance of this class will also collect data as it arrives.

data: ParameterValueType[][] = []

The collected data.

Use the clear() method before starting a new monitoring if you want to collect a fresh set of data.

finalize$: Subject<void> = ...

Emit a value to stop the ongoing monitoring.

monitoringInterval: number

Accessors

  • get timestampIndex(): number
  • Finds the index of the timestamp field in the ids array.

    The timestamp field is identified by object 0x20F0 and subindex 0x00. IDs may be strings (parsed using splitDeviceParameterId) or tuples in the form [deviceRef, index, subindex].

    Returns

    The zero-based index of the timestamp field in ids, or -1 if no timestamp entry exists.

    Returns number

  • get timestamps(): number[]
  • Extracts the timestamp column from the monitoring data.

    Each entry of data contains an array of values aligned with ids. If no timestamp index exists, an empty array is returned.

    Returns

    An array of numeric timestamps extracted from the monitoring data.

    Returns number[]

Methods

  • Computes the average time difference between consecutive timestamps.

    Uses the values returned by timestampDiffs. If no diffs exist (e.g., fewer than two timestamps), returns 0.

    Returns

    The average timestamp delta, or 0 if no diffs are available.

    Returns number

  • Computes differences between consecutive timestamps.

    The result contains timestamps.length - 1 entries, where each value is:

    timestamps[i] - timestamps[i - 1]

    If fewer than two timestamps are available, an empty array is returned.

    Returns

    An array of time deltas between consecutive timestamps.

    Returns number[]

Generated using TypeDoc