Structured Signals¶
Beside regular signals, which have a scalar value or a certain data structure, e.g. a calibration curve, some signals are read in as so-called structured signals. A typical example is the reading of SOME/IP events from a PCAP file. An event is a data structure with a number of attributes and can also be nested. Often it is impractical to read only a certain attribute of the structure, therefore it is possible to read the event as a whole - one gets access to a structured signal within the trace analysis.
Event "bikeDetection"
|-- status
|-+ statistics
|- timeRunning
|- totalBikes
|- numberOfBikes
|-+ bikes [List of up to five elements of type Bike]
|- distance
|- heading
|- velocity
In the following, the basics of structured signals are explained. As an example SigBikeDetection
shall be the parsed structured signal. For further information, the API documentation
StructuredSignals
can be used.
Attribute Access¶
Attributes can be further structured signals or simple value signals (leaf nodes). To access
attributes in expressions of calculation steps, trigger blocks and within trace step templates it is
necessary to use the simple dot notation: SigBikeDetection.numberOfBikes. If a trigger block
should detect ranges where at least one Bike is present one can specify
SigBikeDetection.numberOfBikes > 0 as a start trigger.
Indexing¶
Structured signals can also contain lists of scalars or structures as attributes. Therefore, to access specific elements of the list, extensive indexing is possible.
Access to the first bike in the bikes attribute is possible as follows:
SigBikeDetection.bikes[0]. Assuming that each bike had an attribute with a list of
persons, one could also explicitly access the first person:
SigBikeDetection.bikes[0].persons[0].
As an experimental feature the complex indexing, e.g. with other signals, is also possible (see also Masking).
Masked Values¶
A key feature of structured signals is that values of leaf nodes can be masked. Assuming that
bikes is a dynamic list of an alternating number of Bikes, it might be error-prone to always
access the distance of the fifth Bike via SigBikeDetection.bikes[4].distance in a calculation.
If at any time there are less than 5 elements in the bikes list, the access will result in a
masked value, signaling that the current value is invalid.
Masked values lead to a special behaviour in comparisons and other operations.
SigBikeDetection.bikes[4].distance <= 5.0 will result in a masked value in those places where
distance is masked. If a calculation step yields masked values as the result of any expression
there will be no evaluation check. With regard to the evaluation, masked values thus behave exactly
as if there was no value at all at that time.