示例#1
0
 /// <summary>
 /// 关闭流
 /// </summary>
 public void CloseStream()
 {
     try
     {
         //关闭流
         if (null != m_objIGXStream)
         {
             m_objIGXStream.Close();
             m_objIGXStream = null;
         }
     }
     catch (Exception)
     {
     }
 }
示例#2
0
 private void __CloseStream()
 {
     try
     {
         // Close stream
         if (null != m_objIGXStream)
         {
             m_objIGXStream.Close();
             m_objIGXStream = null;
         }
     }
     catch (Exception)
     {
     }
 }
示例#3
0
        public void Close()
        {
            if (device == null)
            {
                return;
            }

            try
            {
                if (featureControl != null)
                {
                    featureControl.GetCommandFeature("AcquisitionStop").Execute();
                    featureControl = null;
                }

                if (stream != null)
                {
                    stream.StopGrab();
                    stream.UnregisterCaptureCallback();
                    stream.Close();
                    stream = null;
                }

                if (device != null)
                {
                    device.Close();
                    device = null;
                }
            }
            catch (Exception e)
            {
                log.ErrorFormat(e.Message);
            }
        }
示例#4
0
 public bool __close()
 {
     m_objIGXStream.UnregisterCaptureCallback();
     m_objIGXStream.Close();
     m_objIGXDevice.Close();
     return(true);
 }
示例#5
0
        /// <summary>
        /// 关闭相机
        /// </summary>
        public override void Close()
        {
            // 如果未停采则先停止采集
            if (bIsSnap)
            {
                objIGXFeatureControl.GetCommandFeature("AcquisitionStop").Execute();
                objIGXFeatureControl = null;
            }
            bIsSnap = false;

            //停止流通道、注销采集回调和关闭流
            try
            {
                if (null != objIGXStream)
                {
                    objIGXStream.StopGrab();
                    //注销采集回调函数
                    objIGXStream.UnregisterCaptureCallback();
                    objIGXStream.Close();
                    objIGXStream = null;
                    objIGXStreamFeatureControl = null;
                }
            }
            catch (Exception) { }

            //关闭设备
            if (null != objIGXDevice)
            {
                objIGXDevice.Close();
                objIGXDevice = null;
            }
        }
示例#6
0
        private void Close()
        {
            if (device == null)
            {
                return;
            }

            try
            {
                if (featureControl != null)
                {
                    featureControl.GetCommandFeature("AcquisitionStop").Execute();
                    featureControl = null;
                }

                if (stream != null)
                {
                    stream.StopGrab();
                    stream.UnregisterCaptureCallback();
                    stream.Close();
                    stream = null;
                }

                if (device != null)
                {
                    device.Close();
                    device = null;
                }
            }
            catch (Exception e)
            {
                LogError(e, null);
            }
        }
示例#7
0
        public void Close()
        {
            if (device == null)
            {
                return;
            }

            // Stop everything and destroy resources.

            // Stop acquisition.
            try
            {
                if (featureControl != null)
                {
                    featureControl.GetCommandFeature("AcquisitionStop").Execute();
                    featureControl = null;
                }
            }
            catch (Exception e)
            {
                log.Error(e.Message);
            }

            // Close stream.
            try
            {
                if (stream != null)
                {
                    stream.StopGrab();
                    stream.UnregisterCaptureCallback();
                    stream.Close();
                    stream = null;
                }
            }
            catch (Exception e)
            {
                log.Error(e.Message);
            }

            // Close device.
            try
            {
                if (device != null)
                {
                    device.Close();
                    device = null;

                    SpecificInfo specific = summary.Specific as SpecificInfo;
                    if (specific != null && specific.Device != null)
                    {
                        specific.Device = null;
                    }
                }
            }
            catch (Exception e)
            {
                log.Error(e.Message);
            }
        }
示例#8
0
 public void Close()
 {
     if (objDevice != null)
     {
         objIGXFeatureControl.GetCommandFeature("AcquisitionStop").Execute();
         objIGXStream.StopGrab();
         objIGXStream.UnregisterCaptureCallback();
         objIGXStream.Close();
         objDevice.Close();
     }
 }
        public int OpenCamera()
        {
            //关闭流
            if (null != m_objIGXStream)
            {
                m_objIGXStream.Close();
                m_objIGXStream = null;
            }

            //关闭设备
            if (null != m_objIGXDevice)
            {
                m_objIGXDevice.Close();
                m_objIGXDevice = null;
            }

            IGXFactory m_objIGXFactory = null;

            m_objIGXFactory = IGXFactory.GetInstance();
            m_objIGXFactory.Init();
            List <IGXDeviceInfo> listGXDeviceInfo = new List <IGXDeviceInfo>();

            m_objIGXFactory.UpdateDeviceList(200, listGXDeviceInfo);

            foreach (IGXDeviceInfo tempinfo in listGXDeviceInfo)
            {
                if (tempinfo.GetUserID() == this.name)
                {
                    m_objIGXDevice         = ObjIGXFactory.OpenDeviceByUserID(this.Name, GX_ACCESS_MODE.GX_ACCESS_EXCLUSIVE);
                    m_objIGXFeatureControl = m_objIGXDevice.GetRemoteFeatureControl();
                    m_DeviceOffLine        = m_objIGXDevice.RegisterDeviceOfflineCallback(null, CallOffLineFunction);
                }
            }

            TriggerConfiguration();
            SetExposureTime();

            return(0);
        }