/// <summary>
 /// Destroy this Component
 /// </suimmary>
 public override void Destroy()
 {
     base.Destroy();
     StopLiveAllCameraWindows();
     lock (LockCogDisplay)
     {
         _cogDisplayWindows.Clear();
     }
     if (_frameGrabber != null)
     {
         lock (_lockAcqFifo)
         {
             if (_cogAcqFifo != null)
             {
                 _cogAcqFifo.Flush();
             }
         }
         _frameGrabber.Disconnect(false);
         _frameGrabber = null;
     }
 }
        public override void InitializeFrameGrabber()
        {
            if (_frameGrabber != null)
            {
                if (string.IsNullOrEmpty(VideoFormat))
                {
                    return;
                }
                // Confirm video format
                lock (_lockAcqFifo)
                {
                    try
                    {
                        if (_cogAcqFifo != null)
                        {
                            _cogAcqFifo.Flush();
                        }

                        bool b16FGrey      = _frameGrabber.GetSupportsPixelFormat(CogAcqFifoPixelFormatConstants.Format16Grey);
                        bool b32RGB        = _frameGrabber.GetSupportsPixelFormat(CogAcqFifoPixelFormatConstants.Format32RGB);
                        bool bFormat3Plane = _frameGrabber.GetSupportsPixelFormat(CogAcqFifoPixelFormatConstants.Format3Plane);
                        bool bFormat565RGB = _frameGrabber.GetSupportsPixelFormat(CogAcqFifoPixelFormatConstants.Format565RGB);

                        _cogAcqFifo = _frameGrabber.CreateAcqFifo(VideoFormat, CogAcqFifoPixelFormatConstants.Format8Grey, 0, false);
                        //_cogAcqFifo.OutputPixelFormat = CogImagePixelFormatConstants.PlanarRGB8;
                        _cogAcqFifo.Prepare();
                        _cogAcqFifo.Flush();
                        ICogAcqTrigger mTrigger = _cogAcqFifo.OwnedTriggerParams;
                        if (mTrigger != null && ExternalTrigger)
                        {
                            mTrigger.TriggerModel     = CogAcqTriggerModelConstants.Auto;
                            mTrigger.TriggerLowToHigh = false;
                            _cogAcqFifo.Complete     += _delCogCompleteHandler;
                        }
                    }
                    catch (Exception ex)
                    {
                        U.LogPopup(ex.Message);
                    }
                }
                OnChangedTriggerMode(TriggerMode);
            }
        }