private void InitializeFixtureNPointToNPoint()
        {
            try
            {
#if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL)
                txtExposure.Text   = m_aAcqFifo.Exposure.ToString();
                txtContrast.Text   = m_aAcqFifo.Contrast.ToString();
                txtBrightness.Text = m_aAcqFifo.Brightness.ToString();
#elif _USE_BASLER_PYLON
                txtExposure.Text   = ABaslerPylon.GetExposureTime(m_aPoint.m_strDevName).ToString();
                txtContrast.Text   = "";
                txtBrightness.Text = "";
#elif _USE_IMAGING_CONTROL
                txtExposure.Text   = AImagingControl.m_rngpExposure.Value.ToString();
                txtContrast.Text   = "";
                txtBrightness.Text = AImagingControl.m_rngpBrightness.Value.ToString();
#endif
            }
            catch
            {
                txtExposure.Text   = "0.5";
                txtContrast.Text   = "0.5";
                txtBrightness.Text = "0.5";
            }
        }
        private void InitializeFindEllipse()
        {
            // 2014.03.27
            m_IsInitializing = true;
            m_aIni           = new AIniFindEllipse(m_nType, m_nPoint, m_nToolIndex);
            m_aIni.Read();
            cmbCalibCase.SelectedItem = m_aIni.CalibCase;

            try
            {
#if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL)
                txtExposure.Text   = m_aAcqFifo.Exposure.ToString();
                txtContrast.Text   = m_aAcqFifo.Contrast.ToString();
                txtBrightness.Text = m_aAcqFifo.Brightness.ToString();
#elif _USE_BASLER_PYLON
                txtExposure.Text   = ABaslerPylon.GetExposureTime(m_aPoint.m_strDevName).ToString();
                txtContrast.Text   = "";
                txtBrightness.Text = "";
#elif _USE_IMAGING_CONTROL
                txtExposure.Text   = AImagingControl.m_rngpExposure.Value.ToString();
                txtContrast.Text   = "";
                txtBrightness.Text = AImagingControl.m_rngpBrightness.Value.ToString();
#endif
            }
            catch
            {
                txtExposure.Text   = "0.5";
                txtContrast.Text   = "0.5";
                txtBrightness.Text = "0.5";
            }
            // 2014.03.27
            m_IsInitializing = false;
        }
Esempio n. 3
0
        private void InitializeCalibration()
        {
            if (m_aCalibNPointToNPoint.Calibrated == true)
            {
                // 2013.12.02
                stslblStatus.Text      = AUtil.GetXmlLanguage("Calibrated");
                stslblStatus.ForeColor = Color.ForestGreen;
                btnRun.Enabled         = true;
            }

            txtPoint0X.Text = m_aCalibNPointToNPoint.m_pdRawX[0].ToString();
            txtPoint0Y.Text = m_aCalibNPointToNPoint.m_pdRawY[0].ToString();
            txtPoint1X.Text = m_aCalibNPointToNPoint.m_pdRawX[1].ToString();
            txtPoint1Y.Text = m_aCalibNPointToNPoint.m_pdRawY[1].ToString();
            txtPoint2X.Text = m_aCalibNPointToNPoint.m_pdRawX[2].ToString();
            txtPoint2Y.Text = m_aCalibNPointToNPoint.m_pdRawY[2].ToString();

            //btnLoadCalibImage_Click(null, null);

            /*
             * m_aCalibNPointToNPoint.GrabCalibrationImage(m_aDisplay);
             * if (m_aCalibNPointToNPoint.Calibrate(m_aDisplay) == true)
             * {
             *  stslblStatus.Text = "Calibrated!";
             *  stslblStatus.ForeColor = Color.ForestGreen;
             *  btnRun.Enabled = true;
             * }
             */

            try
            {
#if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL)
                txtExposure.Text   = m_aAcqFifo.Exposure.ToString();
                txtContrast.Text   = m_aAcqFifo.Contrast.ToString();
                txtBrightness.Text = m_aAcqFifo.Brightness.ToString();
#elif _USE_BASLER_PYLON
                txtExposure.Text   = ABaslerPylon.GetExposureTime(m_aPoint.m_strDevName).ToString();
                txtContrast.Text   = "";
                txtBrightness.Text = "";
#elif _USE_IMAGING_CONTROL
                txtExposure.Text   = AImagingControl.m_rngpExposure.Value.ToString();
                txtContrast.Text   = "";
                txtBrightness.Text = AImagingControl.m_rngpBrightness.Value.ToString();
#endif
            }
            catch
            {
                txtExposure.Text   = "0.5";
                txtContrast.Text   = "0.5";
                txtBrightness.Text = "0.5";
            }
        }
Esempio n. 4
0
        private void InitializeCalibration()
        {
            switch (m_aCalibCheckerboard.ComputationMode)
            {
            case CogCalibFixComputationModeConstants.Linear:
                rdoLinear.Checked        = true;
                chkShowUndistort.Checked = false;
                chkShowUndistort.Enabled = false;
                break;

            case CogCalibFixComputationModeConstants.PerspectiveAndRadialWarp:
                rdoNonlinear.Checked     = true;
                chkShowUndistort.Enabled = true;
                break;
            }

            switch (m_aCalibCheckerboard.Fiducial)
            {
            case CogCalibCheckerboardFiducialConstants.StandardRectangles:
                chkMark.Checked = true;
                break;

            case CogCalibCheckerboardFiducialConstants.None:
                chkMark.Checked = false;
                break;
            }

            if (m_aCalibCheckerboard.Calibrated == true)
            {
                // 2013.12.02
                stslblStatus.Text      = AUtil.GetXmlLanguage("Calibrated");
                stslblStatus.ForeColor = Color.ForestGreen;
            }

            chkSwap.Checked       = m_aCalibCheckerboard.SwapHandedness;
            txtSizeX.Text         = m_aCalibCheckerboard.SizeX.ToString();
            txtSizeY.Text         = m_aCalibCheckerboard.SizeY.ToString();
            numUpDnX.Value        = (decimal)m_aCalibCheckerboard.OriginX;
            numUpDnY.Value        = (decimal)m_aCalibCheckerboard.OriginY;
            numUpDnRotation.Value = (decimal)(m_aCalibCheckerboard.OriginRotation / Math.PI * 180);

            /*
             * btnLoadCalibImage_Click(null, null);
             * m_aCalibCheckerboard.GrabCalibrationImage(m_aDisplay);
             * if (m_aCalibCheckerboard.Calibrate(m_aDisplay, chkShowUndistort.Checked) == true)
             * {
             *  m_aCalibCheckerboard.GetResultToList(lstvwResult);
             *  stslblStatus.Text = "Calibrated!";
             *  stslblStatus.ForeColor = Color.ForestGreen;
             * }
             */

            m_aCalibCheckerboard.CoordinateAxes_DraggingStopped += new ACalibCheckerboard.SendMes(CoordinateAxes_DraggingStopped);

            try
            {
#if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL)
                txtExposure.Text   = m_aAcqFifo.Exposure.ToString();
                txtContrast.Text   = m_aAcqFifo.Contrast.ToString();
                txtBrightness.Text = m_aAcqFifo.Brightness.ToString();
#elif _USE_BASLER_PYLON
                txtExposure.Text   = ABaslerPylon.GetExposureTime(m_aPoint.m_strDevName).ToString();
                txtContrast.Text   = "";
                txtBrightness.Text = "";
#elif _USE_IMAGING_CONTROL
                txtExposure.Text   = AImagingControl.m_rngpExposure.Value.ToString();
                txtContrast.Text   = "";
                txtBrightness.Text = AImagingControl.m_rngpBrightness.Value.ToString();
#endif
            }
            catch
            {
                txtExposure.Text   = "0.5";
                txtContrast.Text   = "0.5";
                txtBrightness.Text = "0.5";
            }
        }