Kvaser CanKing GUI Extensions SDK v7.4.0
Kvaser CanKing GUI Extensions SDK / hooks / useSignalDataEnvelopes
Function: useSignalDataEnvelopes()
useSignalDataEnvelopes(
id,subscriptionName,subscribedSignals,view):ISignalDataEnvelope[]
A hook for extracting signal data envelopes to be used for graphical visualization. The envelopes contain min/max values for signals over time ranges, suitable for plotting.
Parameters
id
number
The unique id of the view. This is passed to the view component as the id prop.
subscriptionName
string
The subscription name for the data. Must be unique per view. To avoid conflicts, use a descriptive name.
subscribedSignals
object[]
The subscribed signals with their qualified names and optional source identifiers. To avoid unnecessary re-renders, make sure to memoize this object.
view
Optional view parameters to define the time range and width for the envelopes. If startTime and endTime are set then the envelopes will be fetched from history/cached data, otherwise only new/live envelope data will be provided.
Returns
The extracted signal data. If an empty array is returned, then all previously received data is invalid and should be discarded.
Remarks
This hook subscribes to live envelope data when no view time range is provided. If a view with startTime and endTime is given, it fetches envelopes from historical/cached data instead.