示例#1
0
        /// <summary>Asynchronously looks for first available GigEVision camera device.</summary>
        GigEVision_DeviceDescriptor FindFirstAvailableDevice()
        {
            var devices = new List <GigEVision_DeviceDescriptor>();

            GenICam.GigEVision_FindDevices(2000, 1, devices);

            if (!devices.Any())
            {
                return(null);
            }

            return(devices.FirstOrDefault());
        }
示例#2
0
        static bool FindFirstAvailableDevice(out GigEVision_DeviceDescriptor device)
        {
            var devices = new List <GigEVision_DeviceDescriptor>();

            device = null;

            GenICam.GigEVision_FindDevices(800, 1, devices);

            if (devices == null || !devices.Any())
            {
                return(false);
            }

            device = devices.First();

            Console.WriteLine(string.Format("{0} {1} [{2}]", device.ManufacturerName, device.ModelName, device.IpAddress));

            return(true);
        }