private PlannerComponent_WP80.PlanningAspect Convert(PlannerComponent.Interface.PlanningAspect val)
        {
            switch (val)
            {
            case PlannerComponent.Interface.PlanningAspect.Time: return(PlannerComponent_WP80.PlanningAspect.Time);

            case PlannerComponent.Interface.PlanningAspect.TransferCount: return(PlannerComponent_WP80.PlanningAspect.TransferCount);

            case PlannerComponent.Interface.PlanningAspect.WalkDistance: return(PlannerComponent_WP80.PlanningAspect.WalkDistance);

            default: throw new NotImplementedException();
            }
        }
        public Way CalculatePlanning(StopGroup source, StopGroup target, DateTime startTime, PlannerComponent.Interface.PlanningAspect aspect)
        {
            var middleWay = comp.CalculatePlanning(source.ID, target.ID, startTime.ToString(CultureInfo.InvariantCulture), Convert(aspect));
            var way       = new PlannerComponent.Interface.Way
            {
                LastWalkDistance = middleWay.LastWalkDistance,
                Message          = middleWay.Message,
                TotalTime        = TimeSpan.FromMinutes(middleWay.TotalTime),
                TotalTransfers   = middleWay.TotalTransfers,
                TotalWalk        = middleWay.TotalWalk
            };

            if (middleWay.Entries != null)
            {
                foreach (var e in middleWay.Entries)
                {
                    var entry = new PlannerComponent.Interface.WayEntry
                    {
                        Route            = App.TB.Logic.GetRouteByID(e.RouteID),
                        TripType         = App.TB.TripTypes[e.TripTypeID],
                        StartStop        = App.TB.Logic.GetStopByID(e.StartStopID),
                        EndStop          = App.TB.Logic.GetStopByID(e.EndStopID),
                        StartTime        = TimeSpan.FromMinutes(e.StartTimeMinutes),
                        EndTime          = TimeSpan.FromMinutes(e.EndTimeMinutes),
                        WaitMinutes      = e.WaitMinutes,
                        WalkBeforeMeters = e.WalkBeforeMeters,
                        StopCount        = e.Stops.Length - 1
                    };
                    entry.AddRange(e.Stops.Select(sId => App.TB.Logic.GetStopByID(sId)));
                    way.Add(entry);
                }
            }
            return(way);
        }