private LapTelemetryDto LoadLapTelemetryDto(string lapId, LapSummaryDto lapSummaryDto)
        {
            LapTelemetryDto lapTelemetryDto = _telemetryRepository.LoadLapTelemetryDtoFromAnySession(lapSummaryDto);

            _missingTelemetryFillers.ForEach(x => x.SetSimulator(lapSummaryDto.Simulator));
            lapTelemetryDto.Accept(_missingTelemetryFillers.OfType <ITimedTelemetrySnapshotVisitor>().ToArray());
            FillCustomDisplayName(lapTelemetryDto.LapSummary);
            return(lapTelemetryDto);
        }
Beispiel #2
0
        public async Task <LapTelemetryDto> LoadLap(LapSummaryDto lapSummaryDto)
        {
            try
            {
                AddToActiveLapJob();
                if (!_cachedTelemetries.TryGetValue(lapSummaryDto.Id, out LapTelemetryDto lapTelemetryDto))
                {
                    lapTelemetryDto = await Task.Run(() => _telemetryRepository.LoadLapTelemetryDtoFromAnySession(lapSummaryDto));

                    FillCustomDisplayName(lapTelemetryDto.LapSummary);
                    _cachedTelemetries[lapTelemetryDto.LapSummary.Id] = lapTelemetryDto;
                }
                _telemetryViewsSynchronization.NotifyLapLoaded(lapTelemetryDto);
                RemoveFromActiveLapJob();
                return(lapTelemetryDto);
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Error while loading lap telemetry");
                return(null);
            }
        }