Additional Context

The AdditionalContext is an optional property which allows you to provide more context to a scan. This makes sense in a workflow, where a scan is connected to other TireTread scans or other information in a larger context. On initialization, you can provide to it a tirePosition or a correlationId, or both.

Tire Position

The TirePosition identifies the position where the tire is mounted on the vehicle, considering the primary direction of travel. E.g. the front left tire of a passenger car would be specified as axle=1, side=TireSide.Left, position_on_axle=1 and the rear right tire of a passenger car as axle=2, side=TireSide.Right, position_on_axle=1

The TirePosition's parameters are as follows:

  • axle: Number of the axle, whereas 1 is the front axle (in direction of travel). Its value must be at least 1.

  • side: Enum, representing the side where the Tire is located (Left, Center, Right).

  • positionOnAxle: Position on the axle, whereas 1 is the outermost tire and higher values represent the following inner tires. If the side is set to center, 1 is the leftmost tire (in direction of travel), if there are multiple tires on the center axle. Its value must be at least 1.

If the AdditionalContext is provided, it will also be returned with the results in the TreadDepthResult object, in the measurement property.

TirePosition initialization will throw an IllegalArgumentException if axle or positionOnAxle are 0.

Correlation Id

To connect your scans with one of our other Anyline capabilities you can pass a correlationId with the additionalContext either via a JSON configuration file or in code.

The correlationId has to be a valid UUID otherwise the SDK will return an InvalidUUIDException in the initialization callback.

Examples

  • JSON

  • Android

  • iOS

{
  "additionalContext": {
    "tirePosition": {
      "axle": 1,
      "side": "Left",
      "positionOnAxle": 1
    },
    "correlationId": "00000000-0000-0000-0000-000000000000"
  }
}
@Composable
fun TireTreadScanViewWithTireTreadScanViewConfig() {
    // Define the values for your config
    val tireTreadScanViewConfig = TireTreadScanViewConfig().apply {
        additionalContext = AdditionalContext().apply {
            // set tire position
            tirePosition = TirePosition(axle = 1, side = TireSide.Left, positionOnAxle = 1)
            // set correlation ID
            correlationId = "00000000-0000-0000-0000-000000000000"
        }
    }

    // Invoke the TireTreadScanView composable with the TireTreadScanViewConfig above
    TireTreadScanView(context = this,
        config = tireTreadScanViewConfig,
        onScanAborted = ::onScanAborted,
        callback = ::handleEvent
    ) { measurementUUID, exception ->
        // handle errors during the scan process
    }
}
private func setupTireTreadScanView() {
    let config = TireTreadScanViewConfig()

    let additionalContext = AdditionalContext()

    // set tire position
    let frontLeftTire = TirePosition(axle: 1, side: TireSide.left, positionOnAxle: 1)
    additionalContext.tirePosition = frontLeftTire

    // set correlation ID
    additionalContext.correlationId = "00000000-0000-0000-0000-000000000000"
    config.additionalContext = additionalContext

    // Invoke the TireTreadScanView with the TireTreadScanViewConfig above
    TireTreadScanViewKt.TireTreadScanView(
        context: self,
        config: config,
        onScanAborted: onScanAborted,
        onScanProcessCompleted: onScanProcessCompleted,
        callback: handleScanEvent
    ) { [weak self] measurementUUID, error in
        // handle errors
    }
}