示例#1
0
        private void btnDetectIntegrationRate_Click(object sender, EventArgs e)
        {
            var frm = new frmIntegrationDetection(m_VideoController, (int)nudFirstFrame.Value);

            frm.StartPosition = FormStartPosition.CenterParent;
            DialogResult res = frm.ShowDialog(this);

            if (res == DialogResult.OK)
            {
                if (frm.IntegratedFrames != null)
                {
                    nudIntegratedFrames.SetNUDValue(frm.IntegratedFrames.Interval);
                    nudStartingAtFrame.SetNUDValue(frm.IntegratedFrames.StartingAtFrame);

                    m_State = AavConfigState.ReadyToConvert;
                    var reinterlacedStream = m_VideoController.FramePlayer.Video as ReInterlacingVideoStream;
                    if (reinterlacedStream != null && (reinterlacedStream.Mode == ReInterlaceMode.ShiftOneField || reinterlacedStream.Mode == ReInterlaceMode.SwapFields))
                    {
                        rbFirstFieldBottom.Checked = true;
                    }
                    UpdateControlState();
                    return;
                }
            }

            if (m_VideoController.ShowMessageBox(
                    "This must be an integrated video with consistent and known integration rate in order to convert it to AAV.\r\n\r\nTo enter manually the 'Starting At' frame and the 'Integration' rate press OK.\r\n\r\nPlease note that Tangra will not try to validate the values you entered.",
                    "Tangra", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
            {
                m_ManualIntegrationConfig = true;
                m_State = AavConfigState.ManualIntegrationRateEntry;
                UpdateControlState();
            }
        }
示例#2
0
        private void btnIntegrationDetection_Click(object sender, EventArgs e)
        {
            nudNumFramesToBin.BackColor = SystemColors.Window;
            nudReferenceFrame.BackColor = SystemColors.Window;

            var provider = new LCFileImagePixelProvider(LCFile);

            var frm = new frmIntegrationDetection(provider, (int)LCFile.Header.MinFrame);

            frm.StartPosition = FormStartPosition.CenterParent;
            if (frm.ShowDialog(this) == DialogResult.OK &&
                frm.IntegratedFrames != null)
            {
                nudNumFramesToBin.Value = frm.IntegratedFrames.Interval;
                nudReferenceFrame.Value = frm.IntegratedFrames.StartingAtFrame;

                nudNumFramesToBin.BackColor = Color.Honeydew;
                nudReferenceFrame.BackColor = Color.Honeydew;
            }
        }
示例#3
0
        private void btnDetectIntegration_Click(object sender, EventArgs e)
        {
            var intDetController = new IntegrationDetectionController(m_VideoController, m_VideoController.CurrentFrameIndex);

            using (var frm = new frmIntegrationDetection(intDetController, m_VideoController))
            {
                frm.StartPosition = FormStartPosition.CenterParent;
                DialogResult res = frm.ShowDialog(this);

                if (res == DialogResult.OK)
                {
                    if (frm.IntegratedFrames != null)
                    {
                        m_VideoAstrometry.MovingToFirstIntegratedFrame();
                        cbxInstDelayMode.SelectedIndex = 0; // Set delay type to automatic
                        nudIntegratedFrames.SetNUDValue(frm.IntegratedFrames.Interval);
                        m_VideoController.MoveToFrame(frm.IntegratedFrames.StartingAtFrame);

                        SyncTimeStampControlWithExpectedFrameTime();

                        btnDetectIntegration.Enabled = false;
                    }
                }
                else if (res == DialogResult.Cancel)
                {
                    if ((MovementExpectation)cbxExpectedMotion.SelectedIndex != MovementExpectation.Slow)
                    {
                        MessageBox.Show(
                            this,
                            "When measuring fast moving objects it is absolutely essential to move the video to the first frame of an integration interval " +
                            "before starting the measurements. Press 'Cancel' now and ensure that you have manually positioned to the first frame of the next " +
                            "integration interval before you continue.",
                            "Warning",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Warning);
                    }
                }
            }
        }