consumptionInLegUpTo
fun consumptionInLegUpTo(routeOffset: Distance, withAuxPower: AuxiliaryPower? = null): Result<Consumption>
Calculates the electric energy used up to routeOffset, starting from the preceding waypoint or origin.
Important: This is a Public Preview API. It may be changed or removed at any time.
This function can only be used if the route was planned using a Vehicle with an ElectricEngine containing consumption parameters.
Return
A Result containing a Consumption.Energy or a RouteDataFailure instance if an error occurred.
Parameters
routeOffset
The distance from the start of the route up to which the consumption within the same leg should be calculated.
withAuxPower
A different assumed auxiliary power which should be used for the consumption estimation. If not specified, the actual auxiliary power that the route was planned with is used.