C# Class API.TransitManager

Afficher le fichier Open project: RikkiGibson/Corvallis-Bus-Server

Méthodes publiques

Méthode Description
DistanceTo ( double lat1, double lon1, double lat2, double lon2, char unit = 'K' ) : double

Shamelessly c/ped from stackoverflow.

GetArrivalsSummary ( ITransitRepository repository, ITransitClient client, DateTimeOffset currentTime, IEnumerable stopIds ) : List>>.Task

Gets a user friendly arrivals summary for the requested stops. Returns a dictionary which takes a stop ID and returns the list of route arrival summaries (used to populate a table).

GetEtas ( ITransitRepository repository, ITransitClient client, IEnumerable stopIds ) : Task

Gets the ETA info for a set of stop IDS. The outer dictionary takes a route number and gives a dictionary that takes a stop ID to an ETA.

GetFavoritesViewModel ( ITransitRepository repository, ITransitClient client, DateTimeOffset currentTime, IEnumerable stopIds, LatLong optionalUserLocation ) : Task>
GetSchedule ( ITransitRepository repository, ITransitClient client, DateTimeOffset currentTime, IEnumerable stopIds ) : Task

Returns the bus schedule for the given stop IDs, incorporating the ETA from Connexionz.

Private Methods

Méthode Description
GetFavoriteStops ( BusStaticData staticData, IEnumerable stopIds, LatLong optionalUserLocation ) : List
InterleaveRouteScheduleAndEstimates ( BusStopRouteSchedule routeSchedule, Dictionary stopEstimates, DateTimeOffset currentTime ) : List
MakeRelativeScheduleWithinCutoff ( BusStopRouteDaySchedule daySchedule, DateTimeOffset currentTime ) : IEnumerable
ToRouteArrivalsSummaries ( List routeNames, Dictionary stopArrivals, DateTimeOffset currentTime ) : List
ToViewModel ( FavoriteStop favorite, BusStaticData staticData, ClientBusSchedule schedule, DateTimeOffset currentTime ) : FavoriteStopViewModel

Method Details

DistanceTo() public static méthode

Shamelessly c/ped from stackoverflow.
public static DistanceTo ( double lat1, double lon1, double lat2, double lon2, char unit = 'K' ) : double
lat1 double
lon1 double
lat2 double
lon2 double
unit char
Résultat double

GetArrivalsSummary() public static méthode

Gets a user friendly arrivals summary for the requested stops. Returns a dictionary which takes a stop ID and returns the list of route arrival summaries (used to populate a table).
public static GetArrivalsSummary ( ITransitRepository repository, ITransitClient client, DateTimeOffset currentTime, IEnumerable stopIds ) : List>>.Task
repository ITransitRepository
client ITransitClient
currentTime DateTimeOffset
stopIds IEnumerable
Résultat List>>.Task

GetEtas() public static méthode

Gets the ETA info for a set of stop IDS. The outer dictionary takes a route number and gives a dictionary that takes a stop ID to an ETA.
public static GetEtas ( ITransitRepository repository, ITransitClient client, IEnumerable stopIds ) : Task
repository ITransitRepository
client ITransitClient
stopIds IEnumerable
Résultat Task

GetFavoritesViewModel() public static méthode

public static GetFavoritesViewModel ( ITransitRepository repository, ITransitClient client, DateTimeOffset currentTime, IEnumerable stopIds, LatLong optionalUserLocation ) : Task>
repository ITransitRepository
client ITransitClient
currentTime DateTimeOffset
stopIds IEnumerable
optionalUserLocation API.Models.LatLong
Résultat Task>

GetSchedule() public static méthode

Returns the bus schedule for the given stop IDs, incorporating the ETA from Connexionz.
public static GetSchedule ( ITransitRepository repository, ITransitClient client, DateTimeOffset currentTime, IEnumerable stopIds ) : Task
repository ITransitRepository
client ITransitClient
currentTime DateTimeOffset
stopIds IEnumerable
Résultat Task