Creates a new DataMonitoring instance for collecting device parameter values.
The Motion Master client used to communicate with the device.
An array of device parameter IDs to monitor. Each ID can be a string
or a tuple [deviceRef, index, subindex].
The interval, in microseconds, at which parameter values should be sampled.
Optional config: MonitoringConfigOptional monitoring configuration, such as filters or buffering options.
Readonly clientThe Motion Master client used to communicate with the device.
Determines whether incoming monitoring data should be collected.
When true, each emitted value from the monitoring observable is
appended to the data array. Set to false to receive data
without storing it.
Optional Readonly configOptional monitoring configuration, such as filters or buffering options.
Readonly dataReadonly idsAn array of device parameter IDs to monitor. Each ID can be a string
or a tuple [deviceRef, index, subindex].
Readonly monitoringThe interval, in microseconds, at which parameter values should be sampled.
Private stoppedPrivate Optional subscriptionReturns a statistical analysis of the measured timestamp durations.
The analysis is computed by analyzeTimeDurations, which includes a variety of metrics such as minimum, maximum, mean, median, standard deviation, percentiles, and interquartile range. It also provides filtered statistics based on outlier removal using the IQR method.
An object containing both raw and filtered duration statistics for the monitoring session.
Converts the collected monitoring data into CSV (Comma-Separated Values) format.
The first row contains the CSV header generated from header, followed by one row per collected sample in data. Each row represents the parameter values at a given monitoring interval.
A string representing the collected data in CSV format, ready for export or analysis.
Returns the time differences (in microseconds) between consecutive timestamp values.
Each duration is computed as:
durations[i] = timestamps[i] - timestamps[i - 1]
If fewer than two timestamps are available, an empty array is returned.
An array of durations representing the time between successive timestamp samples.
Generates a CSV header string from the monitored parameter IDs.
Each parameter ID in ids is converted to a string representation
using makeParameterId. String IDs are parsed with
splitDeviceParameterId, while tuple IDs [deviceRef, index, subindex]
are converted directly.
// Possible output: "0x6040:00,0x6060:00,0x6071:00,0x607A:00,0x60FF:00"
A comma-separated string representing the header for CSV export.
Indicates whether monitoring is currently active.
true if monitoring has been started via start and
has not yet been stopped, otherwise false.
Indicates whether monitoring has been stopped.
true if stop has been called and the internal
stop flag is set, otherwise false.
Finds the zero-based index of the timestamp field in the monitored parameters.
The timestamp field is identified as object 0x20F0 with subindex 0x00.
Parameter IDs in ids may be strings (parsed using
splitDeviceParameterId) or tuples in the form [deviceRef, index, subindex].
The index of the timestamp entry in ids, or -1 if
no timestamp field exists.
Extracts the timestamp values from the collected monitoring data.
The timestamp column is determined by timestampIndex, which locates the entry corresponding to object 0x20F0:00 in the monitored parameter list. If no timestamp index is found, an empty array is returned.
An array of numeric timestamps aligned with the collected monitoring samples, or an empty array if no timestamp field is configured.
Starts a new monitoring session and returns an observable that emits device parameter values as they arrive.
This method first calls stop to ensure any existing session is cleanly
terminated. It then resets the internal state and, if clear is true,
removes all previously collected data.
The returned observable emits values until stop is called,
at which point the internal stopped flag is set, causing the stream to
complete on its next emission via takeWhile(). This mechanism ensures that
all internal and external subscriptions are cleanly shut down, preventing
resource leaks.
If collect is enabled, each emitted value is also appended to the data array for later retrieval or analysis.
An observable that emits arrays of parameter values until the monitoring is stopped or the source observable completes.
Whether to clear previously collected data in data before
starting the monitoring session. Defaults to false.
Stops the active monitoring session and unsubscribes from the source observable.
This method sets the internal stop flag, causing the observable created in start
to complete on its next emission. If a subscription was created during start(),
it is explicitly unsubscribed and cleared. This ensures that no monitoring pipeline
remains active and prevents resource leaks when creating new DataMonitoring instances.
Calling this method has no effect if monitoring is not currently active.
Generated using TypeDoc
Tracks and collects device parameter values over time.
Unlike startMonitoring, which returns an observable that does not complete on its own, this class provides explicit control over starting, stopping, and collecting monitoring data. It supports exporting the data in CSV format and provides statistical analysis of the sampling intervals.