Beispiel #1
0
        private void opencamera_Click(object sender, EventArgs e)
        {
            string     dllpath = System.IO.Directory.GetCurrentDirectory() + "\\BalserCamera.dll";
            Assembly   assem   = Assembly.LoadFile(dllpath);
            Type       type    = assem.GetType("AqDevice.AqCameraFactory");
            MethodInfo mi      = type.GetMethod("GetInstance");
            object     obj     = mi.Invoke(null, null);

            cameramanager = (IAqCameraManager)obj;
            cameramanager.Init();
            cameras = cameramanager.GetCameras();
            if (cameras.Count == 0)
            {
                return;
            }
            //cameras[0].Name = "Aqrose-4";
            cameras[0].TriggerMode = AqDevice.TriggerModes.Unknow;
            ;
            cameras[0].RegisterCaptureCallback(new AqCaptureDelegate(RecCapture));
            //      cameras[0].RegisterAcquisitionCallback(new AqAcquisitionDelegate(RecAcquisition));
            cameras[0].ExposureTime = 35000;
            cameras[0].OpenCamera();
            if (cameras[0].OpenStream() == 1)
            {
                opencammeraflag = true;
            }
        }
Beispiel #2
0
        private void opencamera_Click(object sender, EventArgs e)
        {
            string     dllpath = System.IO.Directory.GetCurrentDirectory() + "\\DynamicCamera.dll";
            Assembly   assem   = Assembly.LoadFile(dllpath);
            Type       type    = assem.GetType("AqDevice.AqCameraFactory");
            MethodInfo mi      = type.GetMethod("GetInstance");
            object     obj     = mi.Invoke(null, null);

            cameramanager = (IAqCameraManager)obj;
            cameramanager.Init();
            cameras = cameramanager.GetCameras();
            cameras[0].TriggerMode = AqDevice.TriggerModes.Continuous;
            cameras[0].RegisterCaptureCallback(new AqCaptureDelegate(RecCapture));
            cameras[0].OpenCamera();
        }
        public bool Connect()
        {
            try
            {
                if (!m_connected && AcquisitionStyle == AcquisitionMode.FromCamera)
                {
                    string     dllpath = System.IO.Directory.GetCurrentDirectory() + "\\DaHengCamera.dll";
                    Assembly   assem   = Assembly.LoadFile(dllpath);
                    Type       type    = assem.GetType("AqDevice.AqCameraFactory");
                    MethodInfo mi      = type.GetMethod("GetInstance");
                    object     obj     = mi.Invoke(null, null);

                    cameramanager = (IAqCameraManager)obj;
                    cameramanager.Init();
                    cameras = cameramanager.GetCameras();
                    cameras[0].TriggerMode  = AqDevice.TriggerModes.Unknow;
                    cameras[0].ExposureTime = CameraExposure[0];
                    cameras[0].Name         = CameraName[0];
                    cameras[0].RegisterCaptureCallback(new AqCaptureDelegate(RecCapture));
                    cameras[0].OpenCamera();
                    cameras[0].OpenStream();

                    cameras[1].TriggerMode  = AqDevice.TriggerModes.Unknow;
                    cameras[1].ExposureTime = CameraExposure[1];
                    cameras[1].Name         = CameraName[1];
                    cameras[1].RegisterCaptureCallback(new AqCaptureDelegate(RecCapture1));
                    cameras[1].OpenCamera();
                    cameras[1].OpenStream();

                    m_connected = true;
                }
            }
            catch (FormatException ex)
            {
                System.Windows.Forms.MessageBox.Show("IntegrationTesting Connect Format error " + ex.Message);
                AqVision.Interaction.UI2LibInterface.OutputDebugString("IntegrationTesting Connect Format error " + ex.Message);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("IntegrationTesting Connect error " + ex.Message);
                AqVision.Interaction.UI2LibInterface.OutputDebugString("IntegrationTesting Connect error " + ex.Message);
            }

            return(true);
        }
Beispiel #4
0
        private void opencamera_Click(object sender, EventArgs e)
        {
            string     dllpath = System.IO.Directory.GetCurrentDirectory() + "\\DaHengCamera.dll";
            Assembly   assem   = Assembly.LoadFile(dllpath);
            Type       type    = assem.GetType("AqDevice.AqCameraFactory");
            MethodInfo mi      = type.GetMethod("GetInstance");
            object     obj     = mi.Invoke(null, null);

            cameramanager = (IAqCameraManager)obj;
            cameramanager.Init();
            cameras = cameramanager.GetCameras();
            cameras[0].TriggerMode = AqDevice.TriggerModes.Unknow;
            // cameras[0].TriggerSource = AqDevice.TriggerSources.Software;
            cameras[0].ExposureTime = 50000;
            cameras[0].Name         = "Aqrose2";
            cameras[0].RegisterCaptureCallback(new AqCaptureDelegate(RecCapture));
            cameras[0].OpenCamera();
            cameras[0].OpenStream();
        }