public async Task <Route> ProcessIndividualRoute(SyncromaticsRoute route) { Route newRoute = new Route(route); route.Waypoints = SubdivideWaypoints(route.Waypoints); newRoute.RouteWaypoints = await ParseWaypoints(route.Waypoints); //newRoute.MapboxMatchedWaypoints = await MapboxMatch(route.Waypoints); newRoute.RouteStops = ParseStops(route.Waypoints, route.Stops); newRoute.StopPaths = ParseStopPaths(route.Waypoints, route.Stops); newRoute.RouteDistance = CalculateTotalDistance(route.Waypoints); double totalDistance = 0.0; int stopCount = 0; int wayPointCount = 0; foreach (StopPath paths in newRoute.StopPaths) { totalDistance += paths.TotalPathDistance; stopCount += 2; wayPointCount += paths.Path.Count; } return(newRoute); }
internal void TriggerNewVehicleDownloaded(SyncromaticsRoute route, SyncromaticsVehicle vehicle, int i) { if (NewVehicleDownloaded != null) { index = i; NewVehicleDownloaded.Invoke(this, new VehicleDownloadedArgs() { Route = route, Vehicle = vehicle }); } }
public Route(SyncromaticsRoute route) { RouteLetter = route.ShortName; RouteName = route.Name; RouteID = route.ID; Color = route.Color; RouteWaypoints = new List <RouteWaypoint>(); MapboxMatchedWaypoints = new List <RouteWaypoint>(); StopPaths = new List <StopPath>(); RouteStops = new List <Stop>(); }