public HalAcqFifoTool(HTuple deviceName, string colorspace) : base() { acqState = new HalAcqState(); cameraOpenInfo = new HalAcqOpenInfo(deviceName, colorspace); //打开相机 if (OpenCamera(ref cameraOpenInfo)) { //初始化Operator _operator = new HalAcqOperator(ref __halAcqHandle); halGigEAccess = new CHalGigEAccess(ref __halAcqHandle); } }
/// <summary> /// 反序列化构造 /// </summary> /// <param name="info"></param> /// <param name="context"></param> private HalAcqFifoTool(SerializationInfo info, StreamingContext context) { //反序列化对象 _operator = (IHalAcqOperator)info.GetValue("operator", typeof(IHalAcqOperator)); cameraOpenInfo = (IHalAcqOpenInfo)info.GetValue("cameraOpenInfo", typeof(IHalAcqOpenInfo)); asyncGrab = info.GetBoolean("asyncGrabImage"); m_outputImage = (IHalImage)info.GetValue("outputImage", typeof(IHalImage)); acqState = new HalAcqState(); //判断被序列化的相机是否在相机列表中,如果在尝试打开相机 if (SystemExistCamera(cameraOpenInfo.Device.S)) { //打开相机 if (OpenCamera(ref cameraOpenInfo)) { //对Operator传入新的相机句柄 _operator.CameraHandle = __halAcqHandle; halGigEAccess = new CHalGigEAccess(ref __halAcqHandle); } } }