Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        private void PrepareToEnterStartTime()
        {
            ucUtcTime.DateTimeUtc = m_VideoController.GetBestGuessDateTimeForCurrentFrame();

            pnlEnterTimes.Visible = true;
            lblTimesHeader.Text   = "Enter the UTC time of the first exported frame:";
            btnNextTime.Text      = "Next >>";
            m_FirstTimeSet        = false;

            ucUtcTime.FocusHourControl();

            // Split the video in fields for interlaced video
            m_ShowingFields = m_VideoController.IsPlainAviVideo || m_VideoController.IsAstroAnalogueVideo;

            m_VideoController.MoveToFrame((int)nudFirstFrame.Value);
            m_VideoController.ToggleShowFieldsMode(m_ShowingFields);
            UpdateShowingFieldControls();

            m_FirstTimeFrame = -1;
            m_LastTimeFrame  = -1;
        }
Ejemplo n.º 3
0
        private void PrepareToEnterStarTime()
        {
            ucUtcTime.DateTimeUtc = m_VideoController.GetBestGuessDateTimeForCurrentFrame();
            pnlEnterTimes.Visible = true;
            lblTimesHeader.Text   = "Enter the UTC time of the first measured frame:";
            btnNextTime.Text      = "Next >>";
            m_FirstTimeSet        = false;
            m_StateMachine.VideoOperation.InitGetStartTime();

            ucUtcTime.FocusHourControl();

            // Split the video in fields for interlaced video
            m_ShowingFields = m_VideoController.IsPlainAviVideo;
            m_StateMachine.VideoOperation.ToggleShowFields(m_ShowingFields);
            UpdateShowingFieldControls();

            m_FirstTimeFrame = -1;
            m_LastTimeFrame  = -1;
        }
Ejemplo n.º 4
0
        public frmConfigureAstrometricFit(VideoController videoController, AstroPlate image)
        {
            m_VideoController = videoController;
            m_Image           = image;

            InitializeComponent();

            rbKnownCenter.Checked = TangraConfig.Settings.PlateSolve.StarIDSettings.Method == 0;

#if ASTROMETRY_DEBUG
            Trace.Assert(TangraConfig.Settings.PlateSolve.SelectedScopeRecorderConfig != null);
#endif

            if (!string.IsNullOrEmpty(TangraConfig.Settings.LastUsed.AstrRAHours) &&
                !string.IsNullOrEmpty(TangraConfig.Settings.LastUsed.AstrDEDeg))
            {
                cbxRA.Text = TangraConfig.Settings.LastUsed.AstrRAHours;
                cbxDE.Text = TangraConfig.Settings.LastUsed.AstrDEDeg;
            }

            if (!double.IsNaN(TangraConfig.Settings.LastUsed.AstrErrFoVs))
            {
                SetNUDValue(nudError, (decimal)TangraConfig.Settings.LastUsed.AstrErrFoVs);
            }

            int lastSearchTypeIdx = TangraConfig.Settings.LastUsed.AstrSearchTypeIndex;
            switch (lastSearchTypeIdx)
            {
            case 0:
                rbKnownObject.Checked = true;
                break;

            default:
                rbKnownCenter.Checked = true;
                break;
            }

            Context.FoundObject = null;

            utcTime.OnDateTimeChanged += new EventHandler <DateTimeChangeEventArgs>(ucTime_OnDateTimeChanged);

            if (TangraConfig.Settings.LastUsed.LastAstrometryUTCDate.Date.Year == 1)
            {
                TangraConfig.Settings.LastUsed.LastAstrometryUTCDate = DateTime.Now;
            }

            DateTime?timeStamp = videoController.GetCurrentFrameTime();
            if (timeStamp != null && timeStamp != DateTime.MinValue)
            {
                if (timeStamp.Value.Year == 1)
                {
                    // OCR-ed timestamp that doesn't contain a year
                    utcTime.DateTimeUtc       = TangraConfig.Settings.LastUsed.LastAstrometryUTCDate.Date.AddDays(timeStamp.Value.TimeOfDay.TotalDays);
                    lblOCRTimeWarning.Visible = true;
                }
                else
                {
                    utcTime.DateTimeUtc = timeStamp.Value;
                }
            }
            else
            {
                utcTime.DateTimeUtc = m_VideoController.GetBestGuessDateTimeForCurrentFrame(TangraConfig.Settings.LastUsed.LastAstrometryUTCDate);
            }

            DisplayEnterTimePage();

            UpdateErrorInDeg();

            m_MaxRefValue        = TangraConfig.Settings.PlateSolve.SelectedScopeRecorderConfig.LimitingMagnitudes[TangraConfig.Settings.PlateSolve.SelectedCameraModel];
            nudFaintestMag.Value = (decimal)Math.Round(m_MaxRefValue);

            pnlSelectedLimitMagnitude.Enabled = false;
            rbAutomaticLimitMagnitude.Checked = true;
        }