Kvaser CanKing GUI Extensions SDK v7.4.0
Kvaser CanKing GUI Extensions SDK / hooks / useSignalData
Function: useSignalData()
useSignalData(
id,subscriptionName,subscribedSignals):ISignalData[]
A hook for extracting signal data from the measurement context. Will return the latest measurement data for the specified signal names.
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 signals to extract data for, including optional source identifiers. To avoid unnecessary re-renders, make sure to memoize this object.
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 buffers incoming frame data during initialization (before frame keys and historical data are ready) and merges it with historical data once available. This ensures no data is lost during the startup phase.