private void SyncTimeStampControlWithExpectedFrameTime() { VideoFileFormat format = m_VideoController.GetVideoFileFormat(); if (format == VideoFileFormat.AVI || format == VideoFileFormat.AAV || /* Old AAV files with manually entered timestamps */ (format == VideoFileFormat.AAV2 && !m_VideoController.HasEmbeddedTimeStamps())) { double milisecondsDiff = (m_VideoController.CurrentFrameIndex - AstrometryContext.Current.FieldSolveContext.FrameNoOfUtcTime) * 1000.0 / m_VideoController.VideoFrameRate; ucUtcTimePicker.DateTimeUtc = AstrometryContext.Current.FieldSolveContext.UtcTime.AddMilliseconds(milisecondsDiff); if (m_VideoController.HasTimestampOCR()) { m_VideoController.AssertOCRTimestamp(ucUtcTimePicker.DateTimeUtc, true); } } else { ucUtcTimePicker.DateTimeUtc = m_VideoController.GetBestGuessDateTimeForCurrentFrame(); } if (format == VideoFileFormat.AAV || /* Old AAV files with manually entered timestamps */ (format == VideoFileFormat.AAV2 && !m_VideoController.HasEmbeddedTimeStamps())) { // Refresh the current frame to split the AAV timestamp for manual validation // NOTE: This assumes the Split option is selected in the settings (which will be by default) m_VideoController.RefreshCurrentFrame(); } }
private void SyncTimeStampControlWithExpectedFrameTime() { VideoFileFormat format = m_VideoController.GetVideoFileFormat(); if (format == VideoFileFormat.AVI || format == VideoFileFormat.AAV || /* Old AAV files with manually entered timestamps */ (format == VideoFileFormat.AAV2 && !m_VideoController.HasEmbeddedTimeStamps())) { double milisecondsDiff = (m_VideoController.CurrentFrameIndex - AstrometryContext.Current.FieldSolveContext.FrameNoOfUtcTime) * 1000.0 / m_VideoController.VideoFrameRate; ucUtcTimePicker.DateTimeUtc = AstrometryContext.Current.FieldSolveContext.UtcTime.AddMilliseconds(milisecondsDiff); if (m_VideoController.HasTimestampOCR()) { m_VideoController.AssertOCRTimestamp(ucUtcTimePicker.DateTimeUtc, true); } } else { DateTime?timeStamp = m_VideoController.GetCurrentFrameTime(); if (timeStamp != null && timeStamp != DateTime.MinValue) { ucUtcTimePicker.DateTimeUtc = timeStamp.Value; } } }