Exemple #1
0
 /// <summary>
 /// Gather all services
 /// </summary>
 /// <param name="onDate"></param>
 /// <param name="filter"></param>
 /// <param name="dayBoundary"></param>
 /// <returns>All services for day</returns>
 /// <remarks>Reuses standard Gather functionality, setting starting index to 0 and config to get all (actually lots) </remarks>
 public ResolvedServiceStop[] AllServices(DateTime onDate, GatherConfiguration.GatherFilter filter, Time dayBoundary)
 {
     var first = FindNearestTime(dayBoundary);
     
     var config = new GatherConfiguration(0, 0, true, filter);
     var gatherer = new ScheduleGatherer(this, config, _arrivalsOrDepartures);
     return gatherer.Gather(first.index, onDate.Date);
 }
Exemple #2
0
        public ResolvedServiceStop[] FindServices(DateTime at, GatherConfiguration config)
        {
            var onDate = at.Date;
            var time = new Time(at.TimeOfDay);

            var first = FindNearestTime(time);
            
            if (config.HasRequestedBeforeOnly && EqualsTime(first.index, time))
                first.index += 1; 
            
            return GatherServices(first.index, onDate, config);
        }
Exemple #3
0
 /// <summary>
 /// Scheduled services arriving on date near to time
 /// </summary>
 /// <param name="at">Date and Time</param>
 /// <param name="before">Number of services before to return</param>
 /// <param name="after">Number of services after to return.  First found after or on time is always included in after</param>
 /// <param name="config"></param>
 /// <returns>Schedules of running services.</returns>
 public ResolvedServiceStop[] FindArrivals(DateTime at, GatherConfiguration config)
 {
     return(_arrivals.FindServices(at, config));
 }
Exemple #4
0
 private ResolvedServiceStop[] GatherServices(int startIdx, DateTime onDate, GatherConfiguration config)
 {
     var gatherer = new ScheduleGatherer(this, config, _arrivalsOrDepartures);
     return gatherer.Gather(startIdx, onDate);
 }
Exemple #5
0
 /// <summary>
 /// Scheduled services departing on date near to time
 /// </summary>
 /// <param name="at">Date and Time</param>
 /// <param name="before">Number of services before to return</param>
 /// <param name="after">Number of services after to return.  First found after or on time is always included in after</param>
 /// <returns>Schedules of running services.</returns>
 public ResolvedServiceStop[] FindDepartures(DateTime at, GatherConfiguration config)
 {
     return(_departures.FindServices(at, config));
 }