private void tmrLive_Tick(object sender, EventArgs e)
        {
            // 2012.02.19
            tmrLive.Enabled = false;
            try
            {
                // 2012.04.25
                AVisionProBuild.Acq(m_nType, m_nPoint, ref m_cogImage);
                m_aFixtureNPointToNPoint.InputImage = m_cogImage;
            }
            catch
            {
            }
            // 2012.06.07
            GC.Collect();

            // 2012.02.19
            if (m_bLive == true)
            {
                tmrLive.Enabled = true;
            }
        }
Example #2
0
        // 2011.04.21 Live
        private void tmrLive_Tick(object sender, EventArgs e)
        {
            // 2012.02.19
            tmrLive.Enabled = false;

            try
            {
                // 2017.01.26
                m_aDisplay.m_cogDisplay.DrawingEnabled = false;

                // 2012.04.25
                AVisionProBuild.Acq(m_nType, m_nPoint, ref m_cogImage);
                // 2012.01.17
                m_aDisplay.Image = m_cogImage;
                // 2011.08.17
                //m_aDisplay.Display.Fit(true);
                m_aDisplay.AddCross();
                m_aCalibCheckerboard.InputImage = m_aDisplay.GetImage8Grey();
            }
            catch
            {
            }
            // 2017.01.26
            finally
            {
                m_aDisplay.m_cogDisplay.DrawingEnabled = true;
            }

            GC.Collect();

            // 2012.02.19
            if (m_bLive == true)
            {
                tmrLive.Enabled = true;
            }
        }
        private void tmrLive_Tick(object sender, EventArgs e)
        {
            // 2012.02.19
            tmrLive.Enabled = false;
            try
            {
                // 2012.04.25
                AVisionProBuild.Acq(m_nType, m_nPoint, ref m_cogImage);
                // 2014.03.27
                m_aFindEllipse.InputImage = RunCalibImage();
            }
            catch
            {
            }

            // 2012.06.07
            GC.Collect();

            // 2012.02.19
            if (m_bLive == true)
            {
                tmrLive.Enabled = true;
            }
        }
Example #4
0
        private void btnAcquireSingle_Click(object sender, EventArgs e)
        {
            //m_aDisplay.ClearAll();
            m_aDisplay.ClearExcludeImage();
#if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL)
            // 2012.04.24
            m_aAcqFifo.Exposure = Convert.ToDouble(txtExposure.Text);

            /* 2015.10.18
             * if (m_aAcqFifo.AcqFifoTool.Operator != null)
             * {
             *  if (m_aAcqFifo.GetFrameGrabberName().Contains("acA2500"))
             *  {
             *      txtExposure.Text = m_aAcqFifo.Exposure.ToString();
             *  }
             * }
             */
            m_aAcqFifo.Contrast   = Convert.ToDouble(txtContrast.Text);
            m_aAcqFifo.Brightness = Convert.ToDouble(txtBrightness.Text);
#elif _USE_BASLER_PYLON
            // 2017.06.27
            if (ABaslerPylon.GetPixelFormat(m_aPoint.m_strDevName) != m_aPoint.m_strPixelFormat)
            {
                ABaslerPylon.SetPixelFormat(m_aPoint.m_strDevName, m_aPoint.m_strPixelFormat);
            }

            Int64 nVal = Convert.ToInt64(txtExposure.Text);
            nVal             = ABaslerPylon.SetExposureTime(m_aPoint.m_strDevName, nVal);
            txtExposure.Text = nVal.ToString();
#elif _USE_IMAGING_CONTROL
            int nVal = Convert.ToInt32(txtExposure.Text);
            if (AImagingControl.m_rngpExposure.RangeMax < nVal)
            {
                nVal             = AImagingControl.m_rngpExposure.RangeMax;
                txtExposure.Text = nVal.ToString();
            }
            if (AImagingControl.m_rngpExposure.RangeMin > nVal)
            {
                nVal             = AImagingControl.m_rngpExposure.RangeMin;
                txtExposure.Text = nVal.ToString();
            }
            AImagingControl.m_rngpExposure.Value = nVal;

            nVal = Convert.ToInt32(txtBrightness.Text);
            if (AImagingControl.m_rngpBrightness.RangeMax < nVal)
            {
                nVal = AImagingControl.m_rngpBrightness.RangeMax;
                txtBrightness.Text = nVal.ToString();
            }
            if (AImagingControl.m_rngpBrightness.RangeMin > nVal)
            {
                nVal = AImagingControl.m_rngpBrightness.RangeMin;
                txtBrightness.Text = nVal.ToString();
            }
            AImagingControl.m_rngpBrightness.Value = nVal;
#endif

            if (btnAcquireLive.Text != AUtil.GetXmlLanguage("Acquire_Live"))
            {
                // 2011.04.21 Live
                //btnAcquireLive.Text = AUtil.GetXmlLanguage("Acquire_Live");
                //m_aAcqFifo.StopLiveAcquisition(cogDisplay);
                btnAcquireLive_Click(null, null);
            }

            try
            {
                // 2012.04.25
                AVisionProBuild.Acq(m_nType, m_nPoint, ref m_cogImage);
                // 2012.01.17
                m_aDisplay.Image = m_cogImage;

                m_aDisplay.Display.Fit(true);
                m_aCalibCheckerboard.InputImage = m_aDisplay.GetImage8Grey();
            }
            catch
            {
            }

            // 2011.06.09
            lblFileName.Text = "";
        }
        private void btnAcquireSingle_Click(object sender, EventArgs e)
        {
            // 2016.12.01
            chkRun.Visible = false;

#if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL)
            // 2012.04.24
            m_aAcqFifo.Exposure = Convert.ToDouble(txtExposure.Text);

            /* 2015.10.18
             * if (m_aAcqFifo.AcqFifoTool.Operator != null)
             * {
             *  if (m_aAcqFifo.GetFrameGrabberName().Contains("acA2500"))
             *  {
             *      txtExposure.Text = m_aAcqFifo.Exposure.ToString();
             *  }
             * }
             */
            m_aAcqFifo.Contrast   = Convert.ToDouble(txtContrast.Text);
            m_aAcqFifo.Brightness = Convert.ToDouble(txtBrightness.Text);
#elif _USE_BASLER_PYLON
            Int64 nVal = Convert.ToInt64(txtExposure.Text);
            nVal             = ABaslerPylon.SetExposureTime(m_aPoint.m_strDevName, nVal);
            txtExposure.Text = nVal.ToString();
#elif _USE_IMAGING_CONTROL
            int nVal = Convert.ToInt32(txtExposure.Text);
            if (AImagingControl.m_rngpExposure.RangeMax < nVal)
            {
                nVal             = AImagingControl.m_rngpExposure.RangeMax;
                txtExposure.Text = nVal.ToString();
            }
            if (AImagingControl.m_rngpExposure.RangeMin > nVal)
            {
                nVal             = AImagingControl.m_rngpExposure.RangeMin;
                txtExposure.Text = nVal.ToString();
            }
            AImagingControl.m_rngpExposure.Value = nVal;

            nVal = Convert.ToInt32(txtBrightness.Text);
            if (AImagingControl.m_rngpBrightness.RangeMax < nVal)
            {
                nVal = AImagingControl.m_rngpBrightness.RangeMax;
                txtBrightness.Text = nVal.ToString();
            }
            if (AImagingControl.m_rngpBrightness.RangeMin > nVal)
            {
                nVal = AImagingControl.m_rngpBrightness.RangeMin;
                txtBrightness.Text = nVal.ToString();
            }
            AImagingControl.m_rngpBrightness.Value = nVal;
#endif
            if (btnAcquireLive.Text != "        " + AUtil.GetXmlLanguage("Acquire_Live"))
            {
                // 2011.04.21 Live
                //btnAcquireLive.Text = "        " + AUtil.GetXmlLanguage("Acquire_Live");
                //m_aAcqFifo.StopLiveAcquisition(cogDisplay);
                btnAcquireLive_Click(null, null);
            }

            try
            {
                // 2012.04.25
                AVisionProBuild.Acq(m_nType, m_nPoint, ref m_cogImage);
                m_aFixtureNPointToNPoint.InputImage = m_cogImage;
            }
            catch
            {
            }
            // 2011.06.09
            lblFileName.Text = "";
        }