flync_4_instrumentation¶
The flync_4_instrumentation module declares the measurement points of a network:
the physical capture locations a measurement or logging setup reads, each identified by the
ASAM CMP / TECMP interface ids that carry its frames.
The module’s public face is the Instrumentation
wrapper, which maps to the instrumentation/ workspace folder. Its measurement_points
lists every capture point the author has recorded.
A measurement point taps exactly one medium - a point-to-point Ethernet link (one or two ECU
ports), an Ethernet shared-medium segment, a CAN bus, or a LIN bus. Which medium it taps is
what the point is: the type discriminator picks one of the four shapes, and the medium
dictates the captured payload - only a CAN bus asks the author to say more than the bus name,
because a CAN FD bus carries both classic and FD frames.
The overlay is optional: a workspace that is not being instrumented has no instrumentation/
folder, flync_model.instrumentation stays None, and every measurement point’s reference
resolves against the same loaded network model that defines its bus, segment or port.
Note
A point-to-point link can be tapped from both ends - one interface id per direction, each tied to the ECU port on that side:
- name: gateway_to_hpc_link
type: ethernet_ports
ports:
- ecu_port: zgw_p1
interface_id: 0x00010001 # gateway -> HPC direction
- ecu_port: hpc1_p5
interface_id: 0x00010002 # HPC -> gateway direction
The two ports must be the two ends of the same EthernetPointToPointConnection; to tap a
link that is not point-to-point (a shared medium), use type: ethernet_bus instead.
Processing¶
The overlay is loaded into Instrumentation,
available on the root model as flync_model.instrumentation (None when the workspace is
not instrumented). Its measurement_points are parsed from the single overlay file, and two
helpers drive their lifecycle:
- class Instrumentation¶
Bases:
FLYNCBaseModelOptional workspace-level wrapper (
instrumentation/) grouping the measurement points.Parameters¶
- measurement_pointslist of
MeasurementPointType, optional The measurement points recording this system, one file listing them all, discriminated by
type. Absent when the workspace is not being measured.
- measurement_pointslist of
- validate_measurement_points_local(measurement_points: List[Annotated[CANBusMeasurementPoint | EthernetBusMeasurementPoint | EthernetPortsMeasurementPoint | LINBusMeasurementPoint, FieldInfo(annotation=NoneType, required=True, discriminator='type')]] | None) None¶
FLYNC-independent structural rules over a workspace’s instrumentation list.
Runs at parse time, before any FLYNC model is bound: every CMP interface id (flattened across all points, port captures included) and every measurement point
namemust be unique.Parameters¶
- measurement_pointslist of
MeasurementPointType The measurement points collected from
flync_model.instrumentation.measurement_points.
- measurement_pointslist of
- bind_measurement_points(measurement_points: List[Annotated[CANBusMeasurementPoint | EthernetBusMeasurementPoint | EthernetPortsMeasurementPoint | LINBusMeasurementPoint, FieldInfo(annotation=NoneType, required=True, discriminator='type')]] | None, flync_model: FLYNCModel) None¶
Resolve every measurement point’s references against an already-loaded FLYNC model.
Bundled into one call so a single
FLYNCIndexis built and reused across all points; the references a point resolves are identical to the onesMeasurementPoint.bind()offers, only the lookup tables are shared.Parameters¶
- measurement_pointslist of
MeasurementPointType The measurement points to resolve, as collected from
flync_model.instrumentation.measurement_points.- flync_modelflync.model.flync_model.FLYNCModel
An already-loaded and already-validated FLYNC model, e.g.
FLYNCWorkspace.load_workspace(...).flync_model. Its buses and topology must be bound as well - run after the model’s own binding passes.
- measurement_pointslist of
Measurement Points¶
The type discriminator on MeasurementPoint
(described below) selects the concrete class at load time.
- MeasurementPointType¶
alias of
Annotated[CANBusMeasurementPoint|EthernetBusMeasurementPoint|EthernetPortsMeasurementPoint|LINBusMeasurementPoint, FieldInfo(annotation=NoneType, required=True, discriminator=’type’)]
- class MeasurementPoint¶
Bases:
FLYNCBaseModelBase of every measurement point - the name a later measurement setup uses to refer to it.
Parameters¶
- namestr
Unique name of this measurement point, unique across the measurement system.
- descriptionstr, optional
Human-readable purpose of this measurement point.
- typestr
The discriminator: which kind of medium this point taps.
- class CANBusMeasurementPoint¶
Bases:
MeasurementPointA measurement point tapping one CAN bus.
Parameters¶
- typeLiteral[“can_bus”]
The discriminator. Defaults to
"can_bus".- busstr
Name of the CAN bus this point taps.
- interface_idint
Interface identifier (32-bit) of this capture, unique across the measurement system.
- payload_typeslist of “can” | “can_fd”
Every payload type captured on the bus - at least one, no duplicates. A bus with
fd_enabled=Truemust includecan_fd; a bus without it must not.
- class LINBusMeasurementPoint¶
Bases:
MeasurementPointA measurement point tapping one LIN bus.
Parameters¶
- typeLiteral[“lin_bus”]
The discriminator. Defaults to
"lin_bus".- busstr
Name of the LIN bus this point taps.
- interface_idint
Interface identifier (32-bit) of this capture, unique across the measurement system.
- class EthernetBusMeasurementPoint¶
Bases:
MeasurementPointA measurement point tapping an Ethernet shared-medium segment (an
ethernet_multidropconnection).Parameters¶
- typeLiteral[“ethernet_bus”]
The discriminator. Defaults to
"ethernet_bus".- busstr
Id of the Ethernet multidrop connection (segment) this point taps.
- interface_idint
Interface identifier (32-bit) of this capture, unique across the measurement system.
- class EthernetPortsMeasurementPoint¶
Bases:
MeasurementPointA measurement point tapping one or two ECU ports of a point-to-point Ethernet link.
Two ports must be the two ends of the same
ecu_port_to_ecu_portconnection - the point then carries one interface id per direction, keyed by the transmitting port.Parameters¶
- typeLiteral[“ethernet_ports”]
The discriminator. Defaults to
"ethernet_ports".- portslist of
PortCapture One or two port captures - two for a full-duplex link tapped from both sides, one for a single direction.
- class PortCapture¶
Bases:
FLYNCBaseModelOne end of a point-to-point Ethernet link and the interface id capturing the frames this port transmits.
Parameters¶
- ecu_portstr
Name of the ECU port at this end of the link. Port names are globally unique in FLYNC.
- interface_idint
Interface identifier (32-bit) for the frames leaving this port, unique across the measurement system.