| | |
| | | using LB_SmartVisionCommon; |
| | | using LB_VisionProcesses.Cameras.LBCameras; |
| | | using MVSDK_Net; |
| | | using Sunny.UI; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Concurrent; |
| | |
| | | AsyncLogHelper.Warn(SN + "帧转换为Bitmap失败,跳过处理"); |
| | | return; |
| | | } |
| | | AsyncLogHelper.Info(SN + $"图像已加入缓存,当前缓存数量:{CollectedImages[SN].Count}"); |
| | | // 3. 获取/创建线程安全队列 |
| | | var queue = CollectedImages.GetOrAdd(SN, new ConcurrentQueue<Bitmap>()); |
| | | |
| | | AsyncLogHelper.Info(SN + $"图像已加入缓存,当前缓存数量:{CollectedImages[SN].Count}"); |
| | | // 4. 队列限流,防止内存溢出 |
| | | if (queue.Count >= MAX_QUEUE_CAPACITY) |
| | | { |
| | |
| | | { |
| | | // 触发图像事件 |
| | | ImageGrabbed?.Invoke(this, new LBCameraEventArgs(SN, clone, true)); |
| | | CallBackImg = (Bitmap)clone.Clone(); |
| | | } |
| | | |
| | | // 触发模式判断 |