From 78289c64a16dd02cc9fec595bf758a9e30a30926 Mon Sep 17 00:00:00 2001 From: patrick.xu <patrick.xu@broconcentric.com> Date: 星期六, 20 二月 2021 10:51:11 +0800 Subject: [PATCH] gocator修改异步模式下图片获取操作 --- src/Bro.Device.Gocator/GocatorDriver.cs | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Bro.Device.Gocator/GocatorDriver.cs b/src/Bro.Device.Gocator/GocatorDriver.cs index 52c32df..99263dc 100644 --- a/src/Bro.Device.Gocator/GocatorDriver.cs +++ b/src/Bro.Device.Gocator/GocatorDriver.cs @@ -269,16 +269,23 @@ GoDataSet dataSet = null; if (IIConfig.IsAsyncMode) { - if (!IIConfig.IsHardwareTrigger) + if (opConfig.IsSnapshotAction) { - _snapFlag = true; - if (!_snapHandle.WaitOne(IIConfig.SnapshotTimeout)) + if (!IIConfig.IsHardwareTrigger) { - LogAsync(DateTime.Now, $"{Name}鑾峰彇鍥惧儚瓒呮椂", ""); - return null; - } + _snapFlag = true; + if (!_snapHandle.WaitOne(IIConfig.SnapshotTimeout)) + { + LogAsync(DateTime.Now, $"{Name}鑾峰彇鍥惧儚瓒呮椂", ""); + return null; + } - dataSet = _currentData; + dataSet = _currentData; + } + } + else + { + imgSet = null; } } else @@ -342,12 +349,12 @@ Thread.Sleep(100); } } while (true); - - sensor.Flush(); LogAsync(DateTime.Now, $"浼犳劅鍣ㄥ叧闂垚鍔�", ""); } } + sensor.Flush(); + if (dataSet != null) { HandleGoData(dataSet, imgSet); -- Gitblit v1.8.0