consumptionInLegUpTo
fun consumptionInLegUpTo(routeOffset: Distance, withAuxPower: AuxiliaryPower? = null): Result<Consumption, RouteDataFailure>
Calculates the electric energy used up to routeOffset, starting from the preceding waypoint or origin.
This function can only be used if the route was planned using a Vehicle with an ElectricEngine containing consumption parameters.
If routeOffset is exactly at a waypoint, the consumption of the whole preceding leg is returned.
Return
A Result containing a Consumption 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.