Beispiel #1
0
 /// <summary>
 /// Notifies the instance that a bot just arrived in the queueing area of its destination station.
 /// </summary>
 /// <param name="bot">The bot that just arrived.</param>
 /// <param name="tripType">The trip type.</param>
 /// <param name="tripTime">The time it took to get to the queueing area.</param>
 internal void NotifyTripCompleted(Bot bot, StationTripType tripType, double tripTime)
 {
     // Add to running statistics
     StatAddTrip(tripType, tripTime);
     // Mark every incident in the history with a timestamp
     _statStationTripTimestamps.Add(new StationTripDatapoint(StatTime, tripTime, tripType));
     // Flush data points in case there are too many already
     if (_statStationTripTimestamps.Count > STAT_MAX_DATA_POINTS)
     {
         StatFlushTripsCompleted();
     }
     // Raise the event
     TripCompleted?.Invoke(bot, tripType, tripTime);
 }
        public async Task TripCompletedAsync(TripCompleted tripRequest)
        {
            storedSettingsService.TripCompleted = tripRequest;

            var result = await serverApiService.TripCompletedAsync(tripRequest);

            if (result != null)
            {
                storedSettingsService.TripCompleted = null;
            }
            else
            {
                await Mvx.Resolve <IUserInteraction>().AlertAsync("Problem with server connection! Your trip result will be sended later.", "Warning", "Ok");
            }
        }
Beispiel #3
0
 public Task <TripResponse> TripCompletedAsync(TripCompleted tripRequest)
 {
     return(SendAsync <TripCompleted, TripResponse>(tripRequest, $"{BaseApiUrl}trip", storedSettingsService.AuthToken));
 }