From a0c982ba8abdbd7569a6cae07812127a757fd410 Mon Sep 17 00:00:00 2001
From: C3032 <C3032@BC3032>
Date: 星期三, 07 一月 2026 16:02:34 +0800
Subject: [PATCH] 更新相机实例化和UI线程处理逻辑
---
LB_VisionProcesses/Cameras/LBCameras/LBCamera.cs | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/LB_VisionProcesses/Cameras/LBCameras/LBCamera.cs b/LB_VisionProcesses/Cameras/LBCameras/LBCamera.cs
index a7c409b..a856458 100644
--- a/LB_VisionProcesses/Cameras/LBCameras/LBCamera.cs
+++ b/LB_VisionProcesses/Cameras/LBCameras/LBCamera.cs
@@ -266,27 +266,27 @@
private void OnLineReceived(IntPtr pInstance, IntPtr buffer, int points)
{
- // 瀹炴椂鍥炶皟澶勭悊锛氱疮绉鏁版嵁
- if (!isGrabbing) return;
+ // 瀹炴椂鍥炶皟澶勭悊锛氱疮绉鏁版嵁
+ if (!isGrabbing) return;
- int lineSize = points * Marshal.SizeOf(typeof(LBPointZA));
- byte[] lineData = new byte[lineSize];
- Marshal.Copy(buffer, lineData, 0, lineSize);
+ int lineSize = points * Marshal.SizeOf(typeof(LBPointZA));
+ byte[] lineData = new byte[lineSize];
+ Marshal.Copy(buffer, lineData, 0, lineSize);
- lock (_bufferLock)
- {
- _lineDataBuffer.Add(lineData);
- _currentLineCount++;
- }
+ lock (_bufferLock)
+ {
+ _lineDataBuffer.Add(lineData);
+ _currentLineCount++;
+ }
}
private void OnAcquisitionCompleted(IntPtr pInstance, int nOption)
{
- // nOption: 0=涓�鎵规暟鎹粨鏉�, 1=鍏ㄩ儴瀹屾垚, 2=鐐逛簯灏辩华
- if (nOption == 1 || nOption == 0)
- {
- GenerateIntensityMap();
- }
+ // nOption: 0=涓�鎵规暟鎹粨鏉�, 1=鍏ㄩ儴瀹屾垚, 2=鐐逛簯灏辩华
+ if (nOption == 1 || nOption == 0)
+ {
+ GenerateIntensityMap();
+ }
}
private void GenerateIntensityMap()
--
Gitblit v1.9.3