Exemple #1
0
        public TimingSession ResumeSession(Id <RecordingSessionDto> recordingSessionId)
        {
            using var s = sync.UseOnce();
            var recordingSessionDto = ActiveRecordingSession = eventRepository.GetRawDtoById(recordingSessionId);

            return(ActiveTimingSession = CreateTimingSession(recordingSessionDto));
        }
Exemple #2
0
        public TimingSession StartSession(Id <SessionDto> sessionDtoId, string name)
        {
            var recordingSessionDto = ActiveRecordingSession = new RecordingSessionDto {
                Name = name, SessionId = sessionDtoId
            };

            eventRepository.Save(recordingSessionDto);
            return(ActiveTimingSession = CreateTimingSession(recordingSessionDto));
        }
Exemple #3
0
        private TimingSession CreateTimingSession(RecordingSessionDto recordingSessionDto)
        {
            var staticData    = LoadTimingSessionStaticData(recordingSessionDto.SessionId);
            var timingSession = ActiveTimingSession = autoMapperProvider.Map <TimingSession>(recordingSessionDto);

            timingSession.StartTime      = recordingSessionDto.Created;
            timingSession.MinLap         = staticData.MinLap;
            timingSession.FinishCriteria = staticData.FinishCriteria;
            timingSession.Initialize(autoMapperProvider.Map <List <Checkpoint> >(eventRepository.GetRawDtos <CheckpointDto>(x => x.RecordingSessionId == recordingSessionDto.Id)));
            return(timingSession);
        }