public override void TakeSnapshot()
        {
            var image = m_vimbaHelper.AcquireSingleImage();

            OnNewFrame(this, new FrameEventArgs(image));
            AccionTerminada.Set();
        }
        public override void SetVideo()
        {
            var color = ID == CameraIndex.Cam1 ? Properties.Settings.Default.Camera1Color : Properties.Settings.Default.Camera2Color;

            m_vimbaHelper.SetVideoValues(color ? AlliedVisionPixelFormat.BGR8 : AlliedVisionPixelFormat.Mono8);
            AccionTerminada.Set();
        }
Beispiel #3
0
        private void Cycle()
        {
            WaitHandle[] waitevents = new WaitHandle[2];
            waitevents[0] = m_eventoAccion;
            waitevents[1] = m_eventoSalir;

            bool bSeguir = true;

            while (bSeguir)
            {
                int nEvent = WaitHandle.WaitAny(waitevents, 500);

                if (nEvent == 0)
                {
                    if (m_queueAcciones.Count == 0)
                    {
                        continue;
                    }
                    Acciones acc = m_queueAcciones.Dequeue();
                    switch (acc)
                    {
                    case Acciones.Init:
                        Init();

                        break;

                    case Acciones.Foto:
                        m_bSnapShot = true;
                        m_Camera.Acquisition.Capture();
                        break;

                    case Acciones.StartVideo:
                        m_Camera.Acquisition.Capture();
                        break;

                    case Acciones.StopVideo:
                        m_Camera.Acquisition.Stop();
                        break;

                    case Acciones.SetFormatPhoto:
                        SetImageFormat(ImageFormat.Foto);
                        break;

                    case Acciones.SetFormatVideo:
                        SetImageFormat(Properties.Settings.Default.VideoFormat.ToImageFormat());
                        break;
                    }
                    AccionTerminada.Set();
                }
                else if (nEvent == 1)
                {
                    bSeguir = false;
                }
            }
            m_Camera.Exit();
        }
Beispiel #4
0
 private void EnqueueAction(Acciones acc)
 {
     AccionTerminada.Reset();
     m_queueAcciones.Enqueue(acc);
     m_eventoAccion.Set();
 }
 public override void StopGrab()
 {
     m_vimbaHelper.StopContinuousImageAcquisition();
     AccionTerminada.Set();
 }
 public override void StartGrab(string strPath)
 {
     m_vimbaHelper.StartContinuousImageAcquisition(this.OnNewFrame);
     AccionTerminada.Set();
 }