优化相机管理和界面布局
- 在 `CreateCameraForm.cs` 中添加对 `LBCameras` 的引用,并修复相机创建逻辑。
- 调整 `VisionForm.Designer.cs` 和 `2DCameraForm.Designer.cs` 中多个控件的大小和位置,改善界面布局。
- 在 `VisionForm.cs` 中添加对 `LBCameras` 的引用以支持新相机类型。
- 注释掉 `PHM6000Sensor.cs` 和 `PHM6000Profiler.cs` 中与相机信息获取相关的 P/Invoke 方法。
- 重构 `LBCamera.cs`,添加新的相机初始化和参数设置逻辑,确保与 PHM6000 SDK 的兼容性。
- 移除 `PHM6000Camera.cs` 中与 `PHM6000Camera` 相关的代码,简化相机管理逻辑。
Merge branch 'master' of http://lanpucloud.cn:1111/r/~zhengyabo/LB_TyreAppearanceInspectionSoftware
已修改10个文件
771 ■■■■■ 文件已修改
LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/Forms/Pages/CameraPage/CreateCameraForm.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/VisionForm.Designer.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/VisionForm.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/VisionForm.resx 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVisionCameraDevice/PHM6000/PHM6000Sensor.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVisionCameraSDK/PHM6000/PHM6000Profiler.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Cameras/2DCameraForm.Designer.cs 270 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Cameras/2DCameraForm.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Cameras/LBCameras/LBCamera.cs 414 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.cs
@@ -1,4 +1,3 @@

using LB_VisionControl;
using LB_VisionProcesses.Cameras;
using OpenCvSharp.Flann;
@@ -177,4 +176,4 @@
            }
        }
    }
}
}
LB_SmartVision/Forms/Pages/CameraPage/CreateCameraForm.cs
@@ -1,5 +1,6 @@
using LB_VisionProcesses.Cameras;
using LB_VisionProcesses.Cameras.HRCameras;
using LB_VisionProcesses.Cameras.LBCameras;
using RJCP.IO.Ports;
using System;
using System.Collections.Concurrent;
@@ -100,7 +101,7 @@
                    camera = new HRCamera();
                    break;
                case CameraBrand.LBCamera:
                    //camera = new LBCamera();
                    camera = new LBCamera();
                    break;
                default:
                    return;
LB_SmartVision/VisionForm.Designer.cs
@@ -89,7 +89,7 @@
            // 
            sc_VisionForm.Panel2.Controls.Add(grb_Info);
            sc_VisionForm.Size = new Size(1416, 781);
            sc_VisionForm.SplitterDistance = 596;
            sc_VisionForm.SplitterDistance = 593;
            sc_VisionForm.SplitterWidth = 5;
            sc_VisionForm.TabIndex = 1;
            // 
@@ -108,7 +108,7 @@
            tlp_MainView.RowStyles.Add(new RowStyle(SizeType.Absolute, 60F));
            tlp_MainView.RowStyles.Add(new RowStyle(SizeType.Absolute, 39F));
            tlp_MainView.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tlp_MainView.Size = new Size(1416, 596);
            tlp_MainView.Size = new Size(1416, 593);
            tlp_MainView.TabIndex = 1;
            tlp_MainView.TagString = null;
            // 
@@ -122,7 +122,7 @@
            materialTabControl.MouseState = MaterialSkin.MouseState.HOVER;
            materialTabControl.Name = "materialTabControl";
            materialTabControl.SelectedIndex = 0;
            materialTabControl.Size = new Size(1412, 493);
            materialTabControl.Size = new Size(1412, 490);
            materialTabControl.TabIndex = 0;
            // 
            // tlp_VisionMainOperator
@@ -248,7 +248,7 @@
            grb_Info.MinimumSize = new Size(1, 1);
            grb_Info.Name = "grb_Info";
            grb_Info.Padding = new Padding(0, 40, 0, 0);
            grb_Info.Size = new Size(1416, 180);
            grb_Info.Size = new Size(1416, 183);
            grb_Info.TabIndex = 1;
            grb_Info.Text = "日志显示区:";
            grb_Info.TextAlignment = ContentAlignment.MiddleLeft;
@@ -264,7 +264,7 @@
            rich_Info.Name = "rich_Info";
            rich_Info.Padding = new Padding(2);
            rich_Info.ShowText = false;
            rich_Info.Size = new Size(1416, 140);
            rich_Info.Size = new Size(1416, 143);
            rich_Info.TabIndex = 0;
            rich_Info.TextAlignment = ContentAlignment.MiddleLeft;
            // 
LB_SmartVision/VisionForm.cs
@@ -16,6 +16,7 @@
using LB_VisionProcesses;
using LB_VisionProcesses.Cameras;
using LB_VisionProcesses.Cameras.HRCameras;
using LB_VisionProcesses.Cameras.LBCameras;
using LB_VisionProcesses.Communicators;
using LB_VisionProcesses.Communicators.TCom;
using LB_VisionProcesses.Forms;
@@ -362,7 +363,9 @@
                    }
                    catch { }
                }
                File.WriteAllText(GlobalVar.allLayoutPath, strJson, Encoding.UTF8);
                return true;
            }
            catch { return false; }
LB_SmartVision/VisionForm.resx
@@ -121,24 +121,24 @@
  <data name="theme_VisionForm.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    <value>
        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
        vAAADrwBlbxySQAAA+xJREFUWEftV0loFUkYbvcNFzJi0lWdBEPQruqXKEYdcRgz4AYqeplBwYiXEUVB
        UHAhCEG8iR509OBlmIsOjJ5EBvQSRVHzuvslxjAy8eCG+75GozF+f716L6873fqe2ykffDR59e9/1V8V
        ow99KARtUg72J5aypGNN8xy2yJPWcleylb5gS13HnJdy+KSW6uJx3b8ZA7TKl6PbMPq3SbMsBUcpyf/2
        BP8PDh96kr32BX/rS/4O30789grfO1j/k4LQ6p8POO6XdFgpDNbDSZsn2Bt8u2MpWGdKsCPeBNMm3TZp
        FaUc6/cW20pQEtpsflCllmwxjDbpLKOd9vAZuBPOx5J+86TyMdDbBxsdYLsn+SpUZYQy/imQILLdBIP3
        cxzEU7Dbns3WejXmcNK/NPGHkajabtUiLYO/nyOgXWdRFeUkDmdnWMOg2ACFFwEn8fzfFeaSxlpjIOlT
        EHC0HVm/CstSC13B93sVFaOVszDQpwGuYGtQLipnQDlMyLzH12t2zJ8adH/TbeMbVLYROmmyDvjYRrLK
        aS4Q3Y/gtWjFALtg6KSf4NW02Uj3HwSPzOuw9iAk24sI/p5rm3OV0wyOo+++ww7pzCIViVjvAk+02GyC
        VlWnpUmw2Qggn+AV0eZ/A61oEtYsOttRwjlE5vy4L61KrabQmjBtV3I/JPtRUptcmy9UBuiM+tLc+bHs
        aQ1Rn8rNnEC7Gpvr8KcqF0XoHVCbl0qB8p2OEspS8OZmySZrvwqNtbUDMRm3Yj9kj1uB9NXcwLkfjwyu
        RAhoshuYcHMyGy4DT5T+jKrcjNbJh+yW75QIw62yqhDAvUghwV/Cybrw5UKTDn08GqmTJ9GCx660pscG
        oPoq2MHzlUWjtN8skjZbRsGFdQpiJoBkVVkFnF3tLcCv+7ZZo31mcYZGLY5RL/kCiQrcaRLFTvrikOxc
        YJF2PeZ5ZsTmAkNkCtaiW1YAkcTF1sT4YjXFEM3ekMADz+YztM8AULqlqE5nSL5wor3Zkew51nxU4WnP
        Ij9DlVGLIWCtDhV6FzBWIJH9a3pNaZOGQRsNT6tjWSHB/6LK6OUA/ETJVER/O9dgwcQ7w7XLTG0yjSTO
        Onp7Ny3A92VuuTD0rbcFbXsUMJonaQwnBV8Rniu4y2sGYbEe5emA8cORV6ZGY3n5UNycC9AKvBHZZRh+
        iqxoX9BlRWMZozvLLiSEV5V6HT2Bjz9iX0ftaAWE9sDoBV+UlOufY9FeWTmE5OhdgLH8Kxyvhv5GON3q
        C3NzSvD19C70MTco4JTDZsbtrSzUlLP5DnBV3D745riOp5nr8F/OJcYV65++P2iTfNV/MPoQCcP4AKXR
        FGYxo/VGAAAAAElFTkSuQmCC
        vAAADrwBlbxySQAAA+JJREFUWEftVkuIHGUQbt34iMEoq2S2q3p3yTJsuqpnJ+L6WBRdwaigohfFgEou
        BkVBUPCBCEG8BXNQ48GLeImCehIJxMsqhsSZruod46K4HtSIGjU+4iOr0c1I9fSsM3/PLNtCPO0H36m/
        evz/X11VnreKVRTAHPOZumkY6lFwqURws3BwZ8ywTQnuiCP/+iTCzY1qaUPzdm/Atf3PaHre6XPsjyQM
        2xLGV4XwIyX4QRj+UMK/lPFvJTyhBMeV8IgQvmRJuH4Ko+l5p9UjGBbCJ5RxTgj+VMZmXxKcSAjekHE/
        NNs5DgaTKLinEQYVO4Trf1mkV81wixLUslPmA3bzF2XcKeP+hWY/u3n0fCXcrQwLyjAvjNsb1dI6N05P
        mFAIHlHG73sEypPgGwnhfpn0zzH7jzddcK4Q7kqfKNMI4a9K+MwBDgbdeF04MBWsFYYdQvhbLlBvfhKT
        f+vMtLfG7C0JJXxKGY67WnvCmPAFGRs7z42boul5AzHBfdK6TjdQtzPGk8oos5F/5Y7sfVvPhg+lp+1h
        0yIsxARPmtaN78WEl8eEX+SNclxUhne0glUrNrN9zfMGlPAuZTzaQ99FYfwuDv3ruoLvq5bWaQSvZCfL
        GXUYLwrj240Qxtu2lkSN4FpdWfKZH9jb9RQ1Cq62f9sVOlxUxn3KQXnJ0PO8QxU/jBm1h74v7ZniEG9K
        Hdg/quzvXO709k0Y3u08ucGqWgheX862H4XgxbR47SqU8D1X0EXC2VmGizqDz0xPr0kYH9eO360gNe0b
        jWppozB+1kOQEb5MCLa0C64NoeGrhOGrvH6lhK81GiIvnggmrDLzgvTkvwvDA+5wsU4nhG/m9AUoBD/F
        HFzWN4H0XQn2vF8eXN8Z3FAPYasl59oUYjuB+sTImDB+nhfgYQ39STf4fmu1DHtz+oIUgiM1KkWtwcFw
        sOujVT3hrnaL7UQc+hcL5W+sKIXhw0OVjaW0iwnBc47gqIQ45QY32PKRzv8eTguRYM9SS5YouEEZjv37
        EffbzbjBDdZyxZYQ12EB2qS0bWrJqRVazPDWkojwZbuZrsgZtDJ0iY1g12khEtTicMTvclwn2CKE32YJ
        7G5PORfZ1HtMCH7MOV4BrQ3XCe92+4onk5Nn2PolDAvWXnuOzAwzo6Nnx4Q3SrojwqfKeMxWMpsXWVs+
        2WrfKRdbW1W6Hf0shM/33Y7my4PrleFZIfhAaWjU/e5ivlw+y3S2FySMtynjvcrwsFiLJv/RhPBB2ws1
        hK2WcBLBFf1qawlplwvxaQlxe786OOU4PBWsjSO85mBlQ8n99r/BisSdAas4FfgHpdEUZpwUX7sAAAAA
        SUVORK5CYII=
</value>
  </data>
  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
LB_SmartVisionCameraDevice/PHM6000/PHM6000Sensor.cs
@@ -1,4 +1,4 @@
using LB_SmartVisionCameraSDK;
using LB_SmartVisionCameraSDK;
using LB_SmartVisionCameraSDK.PHM6000;
using LB_SmartVisionCommon;
using Newtonsoft.Json;
@@ -1227,4 +1227,4 @@
            }
        }
    }
}
}
LB_SmartVisionCameraSDK/PHM6000/PHM6000Profiler.cs
@@ -318,8 +318,8 @@
        /// <param name="szModuleType">模块名, char* szModuleType</param>
        /// <param name="szSerialNumber">序列号, char* szSerialNumber</param>
        /// <returns>获取失败返回-1,否则返回0。</returns>
        [DllImport("PHM6000API", CallingConvention = CallingConvention.StdCall, EntryPoint = "GetCameraInformation")]
        public static extern int GetCameraInformation(IntPtr pHandle, int nIndex, IntPtr szModuleType, IntPtr szSerialNumber);
        //[DllImport("PHM6000API", CallingConvention = CallingConvention.StdCall, EntryPoint = "GetCameraInformation")]
        //public static extern int GetCameraInformation(IntPtr pHandle, int nIndex, IntPtr szModuleType, IntPtr szSerialNumber);
        //PHM6000_API(int) GetCameraInformation(void* pHandle, int nIndex, char* szModuleType, char* szSerialNumber);
        /// <summary>
        /// 获取照相机信息
@@ -342,8 +342,8 @@
        /// <param name="szAddress">IP地址字符串, char* szAddress</param>
        /// <param name="nPort">端口号, int* nPort</param>
        /// <returns>获取失败返回-1,否则返回0。</returns>
        [DllImport("PHM6000API", CallingConvention = CallingConvention.StdCall, EntryPoint = "GetCameraAddress")]
        public static extern int GetCameraAddress(IntPtr pHandle, int nIndex, IntPtr szAddress, IntPtr nPort);
        //[DllImport("PHM6000API", CallingConvention = CallingConvention.StdCall, EntryPoint = "GetCameraAddress")]
        //public static extern int GetCameraAddress(IntPtr pHandle, int nIndex, IntPtr szAddress, IntPtr nPort);
        //PHM6000_API(int) GetCameraAddress(void* pHandle, int nIndex, char* szAddress, int* nPort);
        /// <summary>
        /// 得到连接的IP
LB_VisionProcesses/Cameras/2DCameraForm.Designer.cs
@@ -104,18 +104,20 @@
            // 
            cmbBrand.Dock = DockStyle.Fill;
            cmbBrand.FormattingEnabled = true;
            cmbBrand.Location = new Point(53, 3);
            cmbBrand.Location = new Point(66, 4);
            cmbBrand.Margin = new Padding(4);
            cmbBrand.Name = "cmbBrand";
            cmbBrand.Size = new Size(296, 25);
            cmbBrand.Size = new Size(369, 28);
            cmbBrand.TabIndex = 0;
            // 
            // cmbSN
            // 
            cmbSN.Dock = DockStyle.Fill;
            cmbSN.FormattingEnabled = true;
            cmbSN.Location = new Point(53, 3);
            cmbSN.Location = new Point(66, 4);
            cmbSN.Margin = new Padding(4);
            cmbSN.Name = "cmbSN";
            cmbSN.Size = new Size(296, 25);
            cmbSN.Size = new Size(369, 28);
            cmbSN.TabIndex = 1;
            cmbSN.SelectedIndexChanged += cmbSN_SelectedIndexChanged;
            cmbSN.MouseDown += cmbSN_MouseDown;
@@ -124,9 +126,10 @@
            // 
            label1.AutoSize = true;
            label1.Dock = DockStyle.Fill;
            label1.Location = new Point(3, 0);
            label1.Location = new Point(4, 0);
            label1.Margin = new Padding(4, 0, 4, 0);
            label1.Name = "label1";
            label1.Size = new Size(44, 34);
            label1.Size = new Size(54, 42);
            label1.TabIndex = 2;
            label1.Text = "品牌";
            label1.TextAlign = ContentAlignment.MiddleCenter;
@@ -135,9 +138,10 @@
            // 
            label2.AutoSize = true;
            label2.Dock = DockStyle.Fill;
            label2.Location = new Point(3, 0);
            label2.Location = new Point(4, 0);
            label2.Margin = new Padding(4, 0, 4, 0);
            label2.Name = "label2";
            label2.Size = new Size(44, 34);
            label2.Size = new Size(54, 42);
            label2.TabIndex = 3;
            label2.Text = "SN";
            label2.TextAlign = ContentAlignment.MiddleCenter;
@@ -146,9 +150,10 @@
            // 
            btnStartGrab.Dock = DockStyle.Fill;
            btnStartGrab.ForeColor = SystemColors.ControlText;
            btnStartGrab.Location = new Point(91, 3);
            btnStartGrab.Location = new Point(113, 4);
            btnStartGrab.Margin = new Padding(4);
            btnStartGrab.Name = "btnStartGrab";
            btnStartGrab.Size = new Size(82, 28);
            btnStartGrab.Size = new Size(101, 34);
            btnStartGrab.TabIndex = 5;
            btnStartGrab.Text = "连续采集";
            btnStartGrab.UseVisualStyleBackColor = true;
@@ -158,9 +163,10 @@
            // 
            btnCloseGrab.Dock = DockStyle.Fill;
            btnCloseGrab.ForeColor = SystemColors.Desktop;
            btnCloseGrab.Location = new Point(179, 3);
            btnCloseGrab.Location = new Point(222, 4);
            btnCloseGrab.Margin = new Padding(4);
            btnCloseGrab.Name = "btnCloseGrab";
            btnCloseGrab.Size = new Size(82, 28);
            btnCloseGrab.Size = new Size(101, 34);
            btnCloseGrab.TabIndex = 6;
            btnCloseGrab.Text = "关闭采集";
            btnCloseGrab.UseVisualStyleBackColor = true;
@@ -170,9 +176,10 @@
            // 
            btnGrabOnce.Dock = DockStyle.Fill;
            btnGrabOnce.ForeColor = SystemColors.ControlText;
            btnGrabOnce.Location = new Point(3, 3);
            btnGrabOnce.Location = new Point(4, 4);
            btnGrabOnce.Margin = new Padding(4);
            btnGrabOnce.Name = "btnGrabOnce";
            btnGrabOnce.Size = new Size(82, 28);
            btnGrabOnce.Size = new Size(101, 34);
            btnGrabOnce.TabIndex = 7;
            btnGrabOnce.Text = "单张采集";
            btnGrabOnce.UseVisualStyleBackColor = true;
@@ -182,9 +189,10 @@
            // 
            btnOpen.Dock = DockStyle.Fill;
            btnOpen.ForeColor = SystemColors.ControlText;
            btnOpen.Location = new Point(3, 3);
            btnOpen.Location = new Point(4, 4);
            btnOpen.Margin = new Padding(4);
            btnOpen.Name = "btnOpen";
            btnOpen.Size = new Size(82, 28);
            btnOpen.Size = new Size(101, 34);
            btnOpen.TabIndex = 8;
            btnOpen.Text = "打开";
            btnOpen.UseVisualStyleBackColor = true;
@@ -194,9 +202,10 @@
            // 
            btnClose.Dock = DockStyle.Fill;
            btnClose.ForeColor = SystemColors.ControlText;
            btnClose.Location = new Point(91, 3);
            btnClose.Location = new Point(113, 4);
            btnClose.Margin = new Padding(4);
            btnClose.Name = "btnClose";
            btnClose.Size = new Size(82, 28);
            btnClose.Size = new Size(101, 34);
            btnClose.TabIndex = 9;
            btnClose.Text = "关闭";
            btnClose.UseVisualStyleBackColor = true;
@@ -206,9 +215,10 @@
            // 
            label5.AutoSize = true;
            label5.Dock = DockStyle.Fill;
            label5.Location = new Point(3, 0);
            label5.Location = new Point(4, 0);
            label5.Margin = new Padding(4, 0, 4, 0);
            label5.Name = "label5";
            label5.Size = new Size(114, 34);
            label5.Size = new Size(142, 42);
            label5.TabIndex = 15;
            label5.Text = "取图数量:";
            label5.TextAlign = ContentAlignment.MiddleCenter;
@@ -217,9 +227,10 @@
            // 
            lblPicCount.AutoSize = true;
            lblPicCount.Dock = DockStyle.Fill;
            lblPicCount.Location = new Point(123, 0);
            lblPicCount.Location = new Point(154, 0);
            lblPicCount.Margin = new Padding(4, 0, 4, 0);
            lblPicCount.Name = "lblPicCount";
            lblPicCount.Size = new Size(226, 34);
            lblPicCount.Size = new Size(281, 42);
            lblPicCount.TabIndex = 16;
            lblPicCount.Text = "0";
            lblPicCount.TextAlign = ContentAlignment.MiddleLeft;
@@ -227,18 +238,20 @@
            // txtGain
            // 
            txtGain.Dock = DockStyle.Fill;
            txtGain.Location = new Point(53, 3);
            txtGain.Location = new Point(66, 4);
            txtGain.Margin = new Padding(4);
            txtGain.Name = "txtGain";
            txtGain.Size = new Size(296, 23);
            txtGain.Size = new Size(369, 27);
            txtGain.TabIndex = 21;
            txtGain.TextChanged += txtGain_TextChanged;
            // 
            // txtExp
            // 
            txtExp.Dock = DockStyle.Fill;
            txtExp.Location = new Point(53, 3);
            txtExp.Location = new Point(66, 4);
            txtExp.Margin = new Padding(4);
            txtExp.Name = "txtExp";
            txtExp.Size = new Size(296, 23);
            txtExp.Size = new Size(369, 27);
            txtExp.TabIndex = 20;
            txtExp.TextChanged += txtExp_TextChanged;
            // 
@@ -246,9 +259,10 @@
            // 
            label4.AutoSize = true;
            label4.Dock = DockStyle.Fill;
            label4.Location = new Point(3, 0);
            label4.Location = new Point(4, 0);
            label4.Margin = new Padding(4, 0, 4, 0);
            label4.Name = "label4";
            label4.Size = new Size(44, 34);
            label4.Size = new Size(54, 42);
            label4.TabIndex = 19;
            label4.Text = "增益";
            label4.TextAlign = ContentAlignment.MiddleCenter;
@@ -257,9 +271,10 @@
            // 
            label3.AutoSize = true;
            label3.Dock = DockStyle.Fill;
            label3.Location = new Point(3, 0);
            label3.Location = new Point(4, 0);
            label3.Margin = new Padding(4, 0, 4, 0);
            label3.Name = "label3";
            label3.Size = new Size(44, 34);
            label3.Size = new Size(54, 42);
            label3.TabIndex = 18;
            label3.Text = "曝光";
            label3.TextAlign = ContentAlignment.MiddleCenter;
@@ -271,8 +286,10 @@
            groupBox1.Dock = DockStyle.Fill;
            groupBox1.ForeColor = SystemColors.Control;
            groupBox1.Location = new Point(0, 0);
            groupBox1.Margin = new Padding(4);
            groupBox1.Name = "groupBox1";
            groupBox1.Size = new Size(487, 591);
            groupBox1.Padding = new Padding(4);
            groupBox1.Size = new Size(610, 739);
            groupBox1.TabIndex = 17;
            groupBox1.TabStop = false;
            groupBox1.Text = "实时采集";
@@ -280,18 +297,20 @@
            // panel_Picture
            // 
            panel_Picture.Dock = DockStyle.Fill;
            panel_Picture.Location = new Point(3, 19);
            panel_Picture.Location = new Point(4, 24);
            panel_Picture.Margin = new Padding(4);
            panel_Picture.Name = "panel_Picture";
            panel_Picture.Size = new Size(481, 569);
            panel_Picture.Size = new Size(602, 711);
            panel_Picture.TabIndex = 0;
            // 
            // radioButtonSoft
            // 
            radioButtonSoft.AutoSize = true;
            radioButtonSoft.Dock = DockStyle.Fill;
            radioButtonSoft.Location = new Point(3, 123);
            radioButtonSoft.Location = new Point(4, 154);
            radioButtonSoft.Margin = new Padding(4);
            radioButtonSoft.Name = "radioButtonSoft";
            radioButtonSoft.Size = new Size(352, 34);
            radioButtonSoft.Size = new Size(439, 42);
            radioButtonSoft.TabIndex = 23;
            radioButtonSoft.TabStop = true;
            radioButtonSoft.Text = "软触发";
@@ -302,9 +321,10 @@
            // 
            radioButtonHard.AutoSize = true;
            radioButtonHard.Dock = DockStyle.Fill;
            radioButtonHard.Location = new Point(3, 203);
            radioButtonHard.Location = new Point(4, 254);
            radioButtonHard.Margin = new Padding(4);
            radioButtonHard.Name = "radioButtonHard";
            radioButtonHard.Size = new Size(352, 34);
            radioButtonHard.Size = new Size(439, 42);
            radioButtonHard.TabIndex = 24;
            radioButtonHard.TabStop = true;
            radioButtonHard.Text = "硬触发";
@@ -313,7 +333,8 @@
            // splitContainer1
            // 
            splitContainer1.Dock = DockStyle.Fill;
            splitContainer1.Location = new Point(5, 5);
            splitContainer1.Location = new Point(6, 6);
            splitContainer1.Margin = new Padding(4);
            splitContainer1.Name = "splitContainer1";
            // 
            // splitContainer1.Panel1
@@ -323,8 +344,9 @@
            // splitContainer1.Panel2
            // 
            splitContainer1.Panel2.Controls.Add(groupBox1);
            splitContainer1.Size = new Size(855, 591);
            splitContainer1.SplitterDistance = 364;
            splitContainer1.Size = new Size(1070, 739);
            splitContainer1.SplitterDistance = 455;
            splitContainer1.SplitterWidth = 5;
            splitContainer1.TabIndex = 19;
            // 
            // groupBox2
@@ -334,9 +356,11 @@
            groupBox2.Dock = DockStyle.Fill;
            groupBox2.ForeColor = SystemColors.Control;
            groupBox2.Location = new Point(0, 0);
            groupBox2.MinimumSize = new Size(261, 61);
            groupBox2.Margin = new Padding(4);
            groupBox2.MinimumSize = new Size(326, 76);
            groupBox2.Name = "groupBox2";
            groupBox2.Size = new Size(364, 591);
            groupBox2.Padding = new Padding(4);
            groupBox2.Size = new Size(455, 739);
            groupBox2.TabIndex = 0;
            groupBox2.TabStop = false;
            groupBox2.Text = "相机参数";
@@ -360,7 +384,8 @@
            tableLayoutPanel2.Controls.Add(tableLayoutPanel9, 0, 10);
            tableLayoutPanel2.Controls.Add(tableLayoutPanel10, 0, 9);
            tableLayoutPanel2.Dock = DockStyle.Fill;
            tableLayoutPanel2.Location = new Point(3, 19);
            tableLayoutPanel2.Location = new Point(4, 24);
            tableLayoutPanel2.Margin = new Padding(4);
            tableLayoutPanel2.Name = "tableLayoutPanel2";
            tableLayoutPanel2.RowCount = 14;
            tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 7.14301062F));
@@ -377,38 +402,40 @@
            tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 7.14301062F));
            tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 7.143011F));
            tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 7.14086771F));
            tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F));
            tableLayoutPanel2.Size = new Size(358, 569);
            tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 25F));
            tableLayoutPanel2.Size = new Size(447, 711);
            tableLayoutPanel2.TabIndex = 25;
            // 
            // tableLayoutPanel3
            // 
            tableLayoutPanel3.ColumnCount = 2;
            tableLayoutPanel3.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));
            tableLayoutPanel3.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 62F));
            tableLayoutPanel3.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel3.Controls.Add(label1, 0, 0);
            tableLayoutPanel3.Controls.Add(cmbBrand, 1, 0);
            tableLayoutPanel3.Dock = DockStyle.Fill;
            tableLayoutPanel3.Location = new Point(3, 3);
            tableLayoutPanel3.Location = new Point(4, 4);
            tableLayoutPanel3.Margin = new Padding(4);
            tableLayoutPanel3.Name = "tableLayoutPanel3";
            tableLayoutPanel3.RowCount = 1;
            tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel3.Size = new Size(352, 34);
            tableLayoutPanel3.Size = new Size(439, 42);
            tableLayoutPanel3.TabIndex = 0;
            // 
            // tableLayoutPanel4
            // 
            tableLayoutPanel4.ColumnCount = 2;
            tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));
            tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 62F));
            tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel4.Controls.Add(label2, 0, 0);
            tableLayoutPanel4.Controls.Add(cmbSN, 1, 0);
            tableLayoutPanel4.Dock = DockStyle.Fill;
            tableLayoutPanel4.Location = new Point(3, 43);
            tableLayoutPanel4.Location = new Point(4, 54);
            tableLayoutPanel4.Margin = new Padding(4);
            tableLayoutPanel4.Name = "tableLayoutPanel4";
            tableLayoutPanel4.RowCount = 1;
            tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel4.Size = new Size(352, 34);
            tableLayoutPanel4.Size = new Size(439, 42);
            tableLayoutPanel4.TabIndex = 1;
            // 
            // tableLayoutPanel5
@@ -422,11 +449,12 @@
            tableLayoutPanel5.Controls.Add(btnClose, 1, 0);
            tableLayoutPanel5.Controls.Add(btnEdit, 3, 0);
            tableLayoutPanel5.Dock = DockStyle.Fill;
            tableLayoutPanel5.Location = new Point(3, 83);
            tableLayoutPanel5.Location = new Point(4, 104);
            tableLayoutPanel5.Margin = new Padding(4);
            tableLayoutPanel5.Name = "tableLayoutPanel5";
            tableLayoutPanel5.RowCount = 1;
            tableLayoutPanel5.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel5.Size = new Size(352, 34);
            tableLayoutPanel5.Size = new Size(439, 42);
            tableLayoutPanel5.TabIndex = 2;
            // 
            // btnEdit
@@ -434,9 +462,10 @@
            btnEdit.Dock = DockStyle.Fill;
            btnEdit.Enabled = false;
            btnEdit.ForeColor = SystemColors.ControlText;
            btnEdit.Location = new Point(267, 3);
            btnEdit.Location = new Point(331, 4);
            btnEdit.Margin = new Padding(4);
            btnEdit.Name = "btnEdit";
            btnEdit.Size = new Size(82, 28);
            btnEdit.Size = new Size(104, 34);
            btnEdit.TabIndex = 10;
            btnEdit.Text = "编辑";
            btnEdit.UseVisualStyleBackColor = true;
@@ -454,21 +483,22 @@
            tableLayoutPanel6.Controls.Add(btnCloseGrab, 2, 0);
            tableLayoutPanel6.Controls.Add(btnSaveImage, 3, 0);
            tableLayoutPanel6.Dock = DockStyle.Fill;
            tableLayoutPanel6.Location = new Point(3, 163);
            tableLayoutPanel6.Location = new Point(4, 204);
            tableLayoutPanel6.Margin = new Padding(4);
            tableLayoutPanel6.Name = "tableLayoutPanel6";
            tableLayoutPanel6.RowCount = 1;
            tableLayoutPanel6.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel6.Size = new Size(352, 34);
            tableLayoutPanel6.Size = new Size(439, 42);
            tableLayoutPanel6.TabIndex = 24;
            // 
            // btnSaveImage
            // 
            btnSaveImage.Dock = DockStyle.Fill;
            btnSaveImage.ForeColor = SystemColors.Desktop;
            btnSaveImage.Location = new Point(266, 2);
            btnSaveImage.Location = new Point(329, 2);
            btnSaveImage.Margin = new Padding(2);
            btnSaveImage.Name = "btnSaveImage";
            btnSaveImage.Size = new Size(84, 30);
            btnSaveImage.Size = new Size(108, 38);
            btnSaveImage.TabIndex = 8;
            btnSaveImage.Text = "保存图片";
            btnSaveImage.UseVisualStyleBackColor = true;
@@ -477,31 +507,33 @@
            // tableLayoutPanel7
            // 
            tableLayoutPanel7.ColumnCount = 2;
            tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));
            tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 62F));
            tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel7.Controls.Add(label3, 0, 0);
            tableLayoutPanel7.Controls.Add(txtExp, 1, 0);
            tableLayoutPanel7.Dock = DockStyle.Fill;
            tableLayoutPanel7.Location = new Point(3, 283);
            tableLayoutPanel7.Location = new Point(4, 354);
            tableLayoutPanel7.Margin = new Padding(4);
            tableLayoutPanel7.Name = "tableLayoutPanel7";
            tableLayoutPanel7.RowCount = 1;
            tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
            tableLayoutPanel7.Size = new Size(352, 34);
            tableLayoutPanel7.Size = new Size(439, 42);
            tableLayoutPanel7.TabIndex = 25;
            // 
            // tableLayoutPanel8
            // 
            tableLayoutPanel8.ColumnCount = 2;
            tableLayoutPanel8.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));
            tableLayoutPanel8.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 62F));
            tableLayoutPanel8.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel8.Controls.Add(label4, 0, 0);
            tableLayoutPanel8.Controls.Add(txtGain, 1, 0);
            tableLayoutPanel8.Dock = DockStyle.Fill;
            tableLayoutPanel8.Location = new Point(3, 323);
            tableLayoutPanel8.Location = new Point(4, 404);
            tableLayoutPanel8.Margin = new Padding(4);
            tableLayoutPanel8.Name = "tableLayoutPanel8";
            tableLayoutPanel8.RowCount = 1;
            tableLayoutPanel8.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel8.Size = new Size(352, 34);
            tableLayoutPanel8.Size = new Size(439, 42);
            tableLayoutPanel8.TabIndex = 26;
            // 
            // tableLayoutPanel1
@@ -514,19 +546,21 @@
            tableLayoutPanel1.Controls.Add(ckbUpParams, 1, 0);
            tableLayoutPanel1.Controls.Add(ckbRegrab, 2, 0);
            tableLayoutPanel1.Dock = DockStyle.Fill;
            tableLayoutPanel1.Location = new Point(3, 243);
            tableLayoutPanel1.Location = new Point(4, 304);
            tableLayoutPanel1.Margin = new Padding(4);
            tableLayoutPanel1.Name = "tableLayoutPanel1";
            tableLayoutPanel1.RowCount = 1;
            tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel1.Size = new Size(352, 34);
            tableLayoutPanel1.Size = new Size(439, 42);
            tableLayoutPanel1.TabIndex = 29;
            // 
            // btnStartHard
            // 
            btnStartHard.Dock = DockStyle.Fill;
            btnStartHard.Location = new Point(3, 3);
            btnStartHard.Location = new Point(4, 4);
            btnStartHard.Margin = new Padding(4);
            btnStartHard.Name = "btnStartHard";
            btnStartHard.Size = new Size(64, 28);
            btnStartHard.Size = new Size(79, 34);
            btnStartHard.TabIndex = 22;
            btnStartHard.Text = "等待触发";
            btnStartHard.UseVisualStyleBackColor = true;
@@ -536,9 +570,10 @@
            // 
            ckbUpParams.AutoSize = true;
            ckbUpParams.Dock = DockStyle.Fill;
            ckbUpParams.Location = new Point(73, 3);
            ckbUpParams.Location = new Point(91, 4);
            ckbUpParams.Margin = new Padding(4);
            ckbUpParams.Name = "ckbUpParams";
            ckbUpParams.Size = new Size(134, 28);
            ckbUpParams.Size = new Size(167, 34);
            ckbUpParams.TabIndex = 23;
            ckbUpParams.Text = "是否每次写入参数";
            ckbUpParams.UseVisualStyleBackColor = true;
@@ -547,9 +582,10 @@
            // 
            ckbRegrab.AutoSize = true;
            ckbRegrab.Dock = DockStyle.Fill;
            ckbRegrab.Location = new Point(213, 3);
            ckbRegrab.Location = new Point(266, 4);
            ckbRegrab.Margin = new Padding(4);
            ckbRegrab.Name = "ckbRegrab";
            ckbRegrab.Size = new Size(136, 28);
            ckbRegrab.Size = new Size(169, 34);
            ckbRegrab.TabIndex = 24;
            ckbRegrab.Text = "是否失败重新取图";
            ckbRegrab.UseVisualStyleBackColor = true;
@@ -557,25 +593,27 @@
            // tableLayoutPanel12
            // 
            tableLayoutPanel12.ColumnCount = 2;
            tableLayoutPanel12.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120F));
            tableLayoutPanel12.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 150F));
            tableLayoutPanel12.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel12.Controls.Add(lblCapTime, 1, 0);
            tableLayoutPanel12.Controls.Add(label7, 0, 0);
            tableLayoutPanel12.Dock = DockStyle.Fill;
            tableLayoutPanel12.Location = new Point(3, 523);
            tableLayoutPanel12.Location = new Point(4, 654);
            tableLayoutPanel12.Margin = new Padding(4);
            tableLayoutPanel12.Name = "tableLayoutPanel12";
            tableLayoutPanel12.RowCount = 1;
            tableLayoutPanel12.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel12.Size = new Size(352, 43);
            tableLayoutPanel12.Size = new Size(439, 53);
            tableLayoutPanel12.TabIndex = 31;
            // 
            // lblCapTime
            // 
            lblCapTime.AutoSize = true;
            lblCapTime.Dock = DockStyle.Fill;
            lblCapTime.Location = new Point(123, 0);
            lblCapTime.Location = new Point(154, 0);
            lblCapTime.Margin = new Padding(4, 0, 4, 0);
            lblCapTime.Name = "lblCapTime";
            lblCapTime.Size = new Size(226, 43);
            lblCapTime.Size = new Size(281, 53);
            lblCapTime.TabIndex = 16;
            lblCapTime.Text = "0ms";
            lblCapTime.TextAlign = ContentAlignment.MiddleLeft;
@@ -584,9 +622,10 @@
            // 
            label7.AutoSize = true;
            label7.Dock = DockStyle.Fill;
            label7.Location = new Point(3, 0);
            label7.Location = new Point(4, 0);
            label7.Margin = new Padding(4, 0, 4, 0);
            label7.Name = "label7";
            label7.Size = new Size(114, 43);
            label7.Size = new Size(142, 53);
            label7.TabIndex = 15;
            label7.Text = "取图时间:";
            label7.TextAlign = ContentAlignment.MiddleCenter;
@@ -594,16 +633,17 @@
            // tableLayoutPanel11
            // 
            tableLayoutPanel11.ColumnCount = 2;
            tableLayoutPanel11.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120F));
            tableLayoutPanel11.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 150F));
            tableLayoutPanel11.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel11.Controls.Add(label5, 0, 0);
            tableLayoutPanel11.Controls.Add(lblPicCount, 1, 0);
            tableLayoutPanel11.Dock = DockStyle.Fill;
            tableLayoutPanel11.Location = new Point(3, 483);
            tableLayoutPanel11.Location = new Point(4, 604);
            tableLayoutPanel11.Margin = new Padding(4);
            tableLayoutPanel11.Name = "tableLayoutPanel11";
            tableLayoutPanel11.RowCount = 1;
            tableLayoutPanel11.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel11.Size = new Size(352, 34);
            tableLayoutPanel11.Size = new Size(439, 42);
            tableLayoutPanel11.TabIndex = 30;
            // 
            // cmbImagesPath
@@ -612,9 +652,10 @@
            cmbImagesPath.Dock = DockStyle.Fill;
            cmbImagesPath.ForeColor = SystemColors.ControlText;
            cmbImagesPath.FormattingEnabled = true;
            cmbImagesPath.Location = new Point(3, 443);
            cmbImagesPath.Location = new Point(4, 554);
            cmbImagesPath.Margin = new Padding(4);
            cmbImagesPath.Name = "cmbImagesPath";
            cmbImagesPath.Size = new Size(352, 25);
            cmbImagesPath.Size = new Size(439, 28);
            cmbImagesPath.TabIndex = 0;
            cmbImagesPath.SelectedIndexChanged += cmbImagesPath_SelectedIndexChanged;
            cmbImagesPath.MouseHover += cmbImagesPath_MouseHover;
@@ -629,20 +670,22 @@
            tableLayoutPanel9.Controls.Add(btnAddImages, 1, 0);
            tableLayoutPanel9.Controls.Add(btnLocalGrab, 2, 0);
            tableLayoutPanel9.Dock = DockStyle.Fill;
            tableLayoutPanel9.Location = new Point(3, 403);
            tableLayoutPanel9.Location = new Point(4, 504);
            tableLayoutPanel9.Margin = new Padding(4);
            tableLayoutPanel9.Name = "tableLayoutPanel9";
            tableLayoutPanel9.RowCount = 1;
            tableLayoutPanel9.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel9.Size = new Size(352, 34);
            tableLayoutPanel9.Size = new Size(439, 42);
            tableLayoutPanel9.TabIndex = 27;
            // 
            // ckbLocalTest
            // 
            ckbLocalTest.AutoSize = true;
            ckbLocalTest.Dock = DockStyle.Fill;
            ckbLocalTest.Location = new Point(3, 3);
            ckbLocalTest.Location = new Point(4, 4);
            ckbLocalTest.Margin = new Padding(4);
            ckbLocalTest.Name = "ckbLocalTest";
            ckbLocalTest.Size = new Size(111, 28);
            ckbLocalTest.Size = new Size(138, 34);
            ckbLocalTest.TabIndex = 0;
            ckbLocalTest.Text = "本地取图";
            ckbLocalTest.UseVisualStyleBackColor = true;
@@ -651,9 +694,10 @@
            // 
            btnAddImages.Dock = DockStyle.Fill;
            btnAddImages.ForeColor = SystemColors.Desktop;
            btnAddImages.Location = new Point(120, 3);
            btnAddImages.Location = new Point(150, 4);
            btnAddImages.Margin = new Padding(4);
            btnAddImages.Name = "btnAddImages";
            btnAddImages.Size = new Size(111, 28);
            btnAddImages.Size = new Size(138, 34);
            btnAddImages.TabIndex = 1;
            btnAddImages.Text = "添加图片";
            btnAddImages.UseVisualStyleBackColor = true;
@@ -663,9 +707,10 @@
            // 
            btnLocalGrab.Dock = DockStyle.Fill;
            btnLocalGrab.ForeColor = SystemColors.Desktop;
            btnLocalGrab.Location = new Point(237, 3);
            btnLocalGrab.Location = new Point(296, 4);
            btnLocalGrab.Margin = new Padding(4);
            btnLocalGrab.Name = "btnLocalGrab";
            btnLocalGrab.Size = new Size(112, 28);
            btnLocalGrab.Size = new Size(139, 34);
            btnLocalGrab.TabIndex = 2;
            btnLocalGrab.Text = "本地取图";
            btnLocalGrab.UseVisualStyleBackColor = true;
@@ -674,25 +719,27 @@
            // tableLayoutPanel10
            // 
            tableLayoutPanel10.ColumnCount = 2;
            tableLayoutPanel10.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));
            tableLayoutPanel10.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 62F));
            tableLayoutPanel10.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel10.Controls.Add(label6, 0, 0);
            tableLayoutPanel10.Controls.Add(txtTimeout, 1, 0);
            tableLayoutPanel10.Dock = DockStyle.Fill;
            tableLayoutPanel10.Location = new Point(3, 363);
            tableLayoutPanel10.Location = new Point(4, 454);
            tableLayoutPanel10.Margin = new Padding(4);
            tableLayoutPanel10.Name = "tableLayoutPanel10";
            tableLayoutPanel10.RowCount = 1;
            tableLayoutPanel10.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel10.Size = new Size(352, 34);
            tableLayoutPanel10.Size = new Size(439, 42);
            tableLayoutPanel10.TabIndex = 32;
            // 
            // label6
            // 
            label6.AutoSize = true;
            label6.Dock = DockStyle.Fill;
            label6.Location = new Point(3, 0);
            label6.Location = new Point(4, 0);
            label6.Margin = new Padding(4, 0, 4, 0);
            label6.Name = "label6";
            label6.Size = new Size(44, 34);
            label6.Size = new Size(54, 42);
            label6.TabIndex = 0;
            label6.Text = "超时";
            label6.TextAlign = ContentAlignment.MiddleCenter;
@@ -700,9 +747,10 @@
            // txtTimeout
            // 
            txtTimeout.Dock = DockStyle.Fill;
            txtTimeout.Location = new Point(53, 3);
            txtTimeout.Location = new Point(66, 4);
            txtTimeout.Margin = new Padding(4);
            txtTimeout.Name = "txtTimeout";
            txtTimeout.Size = new Size(296, 23);
            txtTimeout.Size = new Size(369, 27);
            txtTimeout.TabIndex = 1;
            // 
            // theme_2DCameraForm
@@ -715,11 +763,12 @@
            theme_2DCameraForm.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
            theme_2DCameraForm.Image = (Image)resources.GetObject("theme_2DCameraForm.Image");
            theme_2DCameraForm.Location = new Point(0, 0);
            theme_2DCameraForm.Margin = new Padding(4);
            theme_2DCameraForm.Name = "theme_2DCameraForm";
            theme_2DCameraForm.Padding = new Padding(10, 70, 10, 9);
            theme_2DCameraForm.Padding = new Padding(12, 88, 12, 11);
            theme_2DCameraForm.RoundCorners = true;
            theme_2DCameraForm.Sizable = true;
            theme_2DCameraForm.Size = new Size(885, 680);
            theme_2DCameraForm.Size = new Size(1106, 850);
            theme_2DCameraForm.SmartBounds = true;
            theme_2DCameraForm.StartPosition = FormStartPosition.WindowsDefaultLocation;
            theme_2DCameraForm.TabIndex = 20;
@@ -736,7 +785,8 @@
            controlBox1.EnableMaximizeButton = false;
            controlBox1.EnableMinimizeButton = false;
            controlBox1.ForeColor = Color.FromArgb(155, 155, 155);
            controlBox1.Location = new Point(785, 18);
            controlBox1.Location = new Point(981, 18);
            controlBox1.Margin = new Padding(4);
            controlBox1.MaximizeHoverColor = Color.FromArgb(74, 74, 74);
            controlBox1.MinimizeHoverColor = Color.FromArgb(63, 63, 65);
            controlBox1.Name = "controlBox1";
@@ -750,22 +800,24 @@
            panel_2DCameraForm.Controls.Add(splitContainer1);
            panel_2DCameraForm.Dock = DockStyle.Fill;
            panel_2DCameraForm.EdgeColor = Color.FromArgb(32, 41, 50);
            panel_2DCameraForm.Location = new Point(10, 70);
            panel_2DCameraForm.Location = new Point(12, 88);
            panel_2DCameraForm.Margin = new Padding(4);
            panel_2DCameraForm.Name = "panel_2DCameraForm";
            panel_2DCameraForm.Padding = new Padding(5);
            panel_2DCameraForm.Size = new Size(865, 601);
            panel_2DCameraForm.Padding = new Padding(6);
            panel_2DCameraForm.Size = new Size(1082, 751);
            panel_2DCameraForm.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            panel_2DCameraForm.TabIndex = 20;
            panel_2DCameraForm.Text = "panel2";
            // 
            // CameraForm
            // 
            AutoScaleDimensions = new SizeF(96F, 96F);
            AutoScaleDimensions = new SizeF(120F, 120F);
            AutoScaleMode = AutoScaleMode.Dpi;
            ClientSize = new Size(885, 680);
            ClientSize = new Size(1106, 850);
            Controls.Add(theme_2DCameraForm);
            FormBorderStyle = FormBorderStyle.None;
            MinimumSize = new Size(261, 61);
            Margin = new Padding(4);
            MinimumSize = new Size(326, 76);
            Name = "CameraForm";
            Text = "2D相机设置界面";
            TransparencyKey = Color.Fuchsia;
LB_VisionProcesses/Cameras/2DCameraForm.cs
@@ -1,6 +1,8 @@
using HalconDotNet;
using LB_SmartVisionCameraDevice.PHM6000;
using LB_VisionControl;
using LB_VisionProcesses.Cameras.HRCameras;
using LB_VisionProcesses.Cameras.LBCameras;
using MVSDK_Net;
using Newtonsoft.Json.Linq;
using OpenCvSharp;
@@ -164,7 +166,7 @@
                        camera = new HRCamera();
                        break;
                    case CameraBrand.LBCamera:
                        //camera = new LBCamera();
                        camera = new LBCamera();
                        break;
                    default:
                        Debug.WriteLine("未知品牌");
@@ -240,7 +242,7 @@
                switch (brand)
                {
                    case CameraBrand.LBCamera:
                        //camera = new LBCamera();
                        camera = new LBCamera();
                        break;
                    case CameraBrand.HRCamera:
                        camera = new HRCamera();
@@ -313,7 +315,19 @@
                PropertyGrid pg = new PropertyGrid();
                pg.Dock = DockStyle.Fill;
                pg.SelectedObject = new CameraAdvancedSettings(camera);
                if (camera is LBCamera phmCamera)
                {
                    pg.SelectedObject = phmCamera.GetSensorConfig();
                    pg.PropertyValueChanged += (s, ev) =>
                    {
                        phmCamera.UpdateSensorConfig((PHM6000SensorConfig)pg.SelectedObject);
                    };
                }
                else
                {
                    pg.SelectedObject = new CameraAdvancedSettings(camera);
                }
                editForm.Controls.Add(pg);
                editForm.ShowDialog();
LB_VisionProcesses/Cameras/LBCameras/LBCamera.cs
@@ -1,9 +1,15 @@
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using LB_SmartVisionCameraSDK.PHM6000;
using LB_VisionProcesses.Cameras;
using LB_SmartVisionCommon;
using LB_SmartVisionCameraDevice.PHM6000;
namespace LB_VisionProcesses.Cameras.LBCameras
{
@@ -11,124 +17,350 @@
    /// LB3D工业相机实现类
    /// 基于PHM6000系列封装
    /// </summary>
    internal class LBCamera : BaseCamera
    public class LBCamera : BaseCamera
    {
        public override bool AutoBalanceWhite()
        private IntPtr _cameraHandle = IntPtr.Zero;
        private PHM6000SensorConfig _sensorConfig;
        private AcquisitionCallbackZA _acquisitionCallback;
        private AcquisitionCompletedCallback _acquisitionCompletedCallback;
        private bool _isConnected = false;
        // 图像缓冲
        private List<byte[]> _lineDataBuffer = new List<byte[]>();
        private readonly object _bufferLock = new object();
        private int _currentLineCount = 0;
        public LBCamera()
        {
            return true;
            Brand = CameraBrand.LBCamera;
            _sensorConfig = new PHM6000SensorConfig();
        }
        #region ICamera Implementation
        public override bool InitDevice(string sn, object handle = null)
        {
            IntPtr tempHandle = IntPtr.Zero;
            try
            {
                SN = sn;
                // 1. 创建临时句柄用于发现设备
                tempHandle = PHM6000Profiler.CreateCameraEntry();
                if (tempHandle == IntPtr.Zero) return false;
                // 2. 发现相机
                int cameraCount = PHM6000Profiler.DiscoverCameras(tempHandle);
                if (cameraCount <= 0)
                {
                    PHM6000Profiler.DestroyCameraEntry(tempHandle);
                    return false;
                }
                string targetIp = string.Empty;
                int targetPort = 0;
                bool found = false;
                // 3. 遍历相机寻找匹配的SN
                for (int i = 0; i < cameraCount; i++)
                {
                    byte[] moduleTypeBytes = new byte[64];
                    byte[] serialNumberBytes = new byte[64];
                    if (PHM6000Profiler.GetCameraInformation(tempHandle, i, moduleTypeBytes, serialNumberBytes) == 0)
                    {
                        string currentSn = Encoding.UTF8.GetString(serialNumberBytes).TrimEnd('\0');
                        // 如果传入的 sn 是 IP 地址,则直接尝试匹配 IP
                        // 或者匹配序列号
                        if (currentSn == sn || sn.Contains(currentSn)) // 简单匹配逻辑
                        {
                            byte[] addressBytes = new byte[64];
                            int port = 0;
                            if (PHM6000Profiler.GetCameraAddress(tempHandle, i, addressBytes, ref port) == 0)
                            {
                                targetIp = Encoding.UTF8.GetString(addressBytes).TrimEnd('\0');
                                targetPort = port;
                                found = true;
                                break;
                            }
                        }
                    }
                }
                // 销毁临时句柄
                PHM6000Profiler.DestroyCameraEntry(tempHandle);
                tempHandle = IntPtr.Zero;
                if (!found)
                {
                    // 如果没找到但 sn 本身看起来像 IP,尝试直接连接(兼容旧逻辑)
                    if (System.Net.IPAddress.TryParse(sn, out _))
                    {
                        targetIp = sn;
                        targetPort = 5577; // 默认端口
                    }
                    else
                    {
                        AsyncLogHelper.Error($"LBCamera: 未找到SN为 {sn} 的相机");
                        return false;
                    }
                }
                // 4. 创建正式相机句柄并连接
                _cameraHandle = PHM6000Profiler.CreateCameraEntry();
                if (_cameraHandle == IntPtr.Zero) return false;
                var addr = Encoding.ASCII.GetBytes(targetIp);
                int result = PHM6000Profiler.ConnectToCamera(_cameraHandle, addr, targetPort);
                if (result == 0)
                {
                    _isConnected = true;
                    // 加载相机当前参数到 _sensorConfig
                    SyncConfigFromCamera();
                    // 初始化回调
                    _acquisitionCallback = new AcquisitionCallbackZA(OnLineReceived);
                    _acquisitionCompletedCallback = new AcquisitionCompletedCallback(OnAcquisitionCompleted);
                    PHM6000Profiler.SetAcquisitionCallbackZA(_cameraHandle, _acquisitionCallback, IntPtr.Zero);
                    PHM6000Profiler.RegisterAcquisitionCompletedCallback(_cameraHandle, _acquisitionCompletedCallback, IntPtr.Zero);
                    return true;
                }
            }
            catch (Exception ex)
            {
                AsyncLogHelper.Error($"LBCamera: InitDevice异常 - {ex.Message}");
                if (tempHandle != IntPtr.Zero) PHM6000Profiler.DestroyCameraEntry(tempHandle);
            }
            return false;
        }
        public override bool CloseDevice()
        {
            return true;
        }
        public override bool GetExpouseTime(out double value)
        {
            value = 0;
            return true;
        }
        public override bool GetGain(out double gain)
        {
            gain = 0;
            return true;
        }
        public override bool GetLineStatus(IOLines line, out LineStatus lineStatus)
        {
            lineStatus = LineStatus.Hight;
            if (_isConnected && _cameraHandle != IntPtr.Zero)
            {
                StopGrabbing();
                PHM6000Profiler.DestroyCameraEntry(_cameraHandle);
                _cameraHandle = IntPtr.Zero;
                _isConnected = false;
            }
            return true;
        }
        public override List<string> GetListEnum()
        {
            return new List<string>();
            List<string> cameraList = new List<string>();
            IntPtr tempHandle = IntPtr.Zero;
            try
            {
                tempHandle = PHM6000Profiler.CreateCameraEntry();
                if (tempHandle != IntPtr.Zero)
                {
                    int count = PHM6000Profiler.DiscoverCameras(tempHandle);
                    for (int i = 0; i < count; i++)
                    {
                        byte[] moduleTypeBytes = new byte[64];
                        byte[] serialNumberBytes = new byte[64];
                        if (PHM6000Profiler.GetCameraInformation(tempHandle, i, moduleTypeBytes, serialNumberBytes) == 0)
                        {
                            string sn = Encoding.UTF8.GetString(serialNumberBytes).TrimEnd('\0');
                            string type = Encoding.UTF8.GetString(moduleTypeBytes).TrimEnd('\0');
                            // 格式参考:PHM6000[SN123456]
                            if (!string.IsNullOrEmpty(sn))
                            {
                                cameraList.Add(sn);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                AsyncLogHelper.Error($"LBCamera: GetListEnum异常 - {ex.Message}");
            }
            finally
            {
                if (tempHandle != IntPtr.Zero)
                    PHM6000Profiler.DestroyCameraEntry(tempHandle);
            }
            return cameraList;
        }
        public override bool GetTriggerDelay(out double delay)
        public override bool StartGrabbing()
        {
            delay = 0;
            return true;
            if (!_isConnected) return false;
            lock (_bufferLock)
            {
                _lineDataBuffer.Clear();
                _currentLineCount = 0;
            }
            // 设置采集模式:1=扫描模式,1=连续模式
            PHM6000Profiler.SetAcquisitionMode(_cameraHandle, 1, 1);
            int result = PHM6000Profiler.StartAcquisition(_cameraHandle, 0, 0, 0.0);
            if (result == 0)
            {
                isGrabbing = true;
                return true;
            }
            return false;
        }
        public override bool GetTriggerFliter(out double flitertime)
        public override bool StopGrabbing()
        {
            flitertime = 0;
            return true;
        }
        public override bool GetTriggerMode(out TriggerMode mode, out TriggerSource source)
        {
            mode = TriggerMode.On;
            source = TriggerSource.Line0;
            return true;
        }
        public override bool GetTriggerPolarity(out TriggerPolarity polarity)
        {
            polarity = TriggerPolarity.RisingEdge;
            return true;
        }
        public override bool InitDevice(string SN, object Handle = null)
        {
            return true;
        }
        public override bool SetExpouseTime(double value)
        {
            return true;
        }
        public override bool SetGain(double gain)
        {
            return true;
        }
        public override bool SetLineMode(IOLines line, LineMode mode)
        {
            return true;
        }
        public override bool SetLineStatus(IOLines line, LineStatus linestatus)
        {
            return true;
        }
        public override bool SetTriggerDelay(double delay)
        {
            return true;
        }
        public override bool SetTriggerFliter(double flitertime)
        {
            return true;
        }
        public override bool SetTriggerMode(TriggerMode mode, TriggerSource triggerEnum = TriggerSource.Line0)
        {
            return true;
        }
        public override bool SetTriggerPolarity(TriggerPolarity polarity)
        {
            if (!_isConnected) return true;
            PHM6000Profiler.StopAcquisition(_cameraHandle);
            isGrabbing = false;
            return true;
        }
        public override bool SoftTrigger()
        {
            // 线扫相机通常不需要传统软触发,但在某些模式下可模拟
            return true;
        }
        public override bool StartGrabbing()
        #region 参数设置映射
        public override bool SetExpouseTime(double value) => SetParam(EnumNameId.ExposureTime, (float)value);
        public override bool GetExpouseTime(out double value) { float v; bool r = GetParam(EnumNameId.ExposureTime, out v); value = v; return r; }
        public override bool SetGain(double gain) => SetParam(EnumNameId.AnalogGain, (float)gain);
        public override bool GetGain(out double gain) { float v; bool r = GetParam(EnumNameId.AnalogGain, out v); gain = v; return r; }
        // 其他接口占位实现
        public override bool SetTriggerMode(TriggerMode mode, TriggerSource triggerEnum = TriggerSource.Line0) => true;
        public override bool GetTriggerMode(out TriggerMode mode, out TriggerSource source) { mode = TriggerMode.Off; source = TriggerSource.Software; return true; }
        public override bool SetTriggerPolarity(TriggerPolarity polarity) => true;
        public override bool GetTriggerPolarity(out TriggerPolarity polarity) { polarity = TriggerPolarity.RisingEdge; return true; }
        public override bool SetTriggerFliter(double flitertime) => true;
        public override bool GetTriggerFliter(out double flitertime) { flitertime = 0; return true; }
        public override bool SetTriggerDelay(double delay) => true;
        public override bool GetTriggerDelay(out double delay) { delay = 0; return true; }
        public override bool SetLineMode(IOLines line, LineMode mode) => true;
        public override bool SetLineStatus(IOLines line, LineStatus linestatus) => true;
        public override bool GetLineStatus(IOLines line, out LineStatus lineStatus) { lineStatus = LineStatus.Low; return true; }
        public override bool AutoBalanceWhite() => true;
        public PHM6000SensorConfig GetSensorConfig()
        {
            return true;
            SyncConfigFromCamera();
            return _sensorConfig;
        }
        public override bool StopGrabbing()
        public void UpdateSensorConfig(PHM6000SensorConfig config)
        {
            return true;
            _sensorConfig = config;
            // 简单示例:设置曝光和增益
            SetExpouseTime(config.ExposureTime);
            SetGain((double)config.AnalogGain);
            // 更多参数同步逻辑应在此处实现
        }
        #endregion
        #endregion
        #region Private Callback & Helpers
        private void OnLineReceived(IntPtr pInstance, IntPtr buffer, int points)
        {
            // 实时回调处理:累积行数据
            if (!isGrabbing) return;
            int lineSize = points * Marshal.SizeOf(typeof(LBPointZA));
            byte[] lineData = new byte[lineSize];
            Marshal.Copy(buffer, lineData, 0, lineSize);
            lock (_bufferLock)
            {
                _lineDataBuffer.Add(lineData);
                _currentLineCount++;
            }
        }
        private void OnAcquisitionCompleted(IntPtr pInstance, int nOption)
        {
            // nOption: 0=一批数据结束, 1=全部完成, 2=点云就绪
            if (nOption == 1 || nOption == 0)
            {
                GenerateIntensityMap();
            }
        }
        private void GenerateIntensityMap()
        {
            if (_cameraHandle == IntPtr.Zero) return;
            int width = 0;
            int height = 0;
            // 直接从 SDK 获取合并后的强度数据指针 (unsigned char*)
            IntPtr pIntensity = PHM6000Profiler.GetIntensityData(_cameraHandle, ref width, ref height);
            if (pIntensity == IntPtr.Zero || width <= 0 || height <= 0) return;
            try
            {
                Bitmap bmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed);
                // 设置灰度调色板
                ColorPalette palette = bmp.Palette;
                for (int i = 0; i < 256; i++) palette.Entries[i] = Color.FromArgb(i, i, i);
                bmp.Palette = palette;
                BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
                // 高性能内存拷贝
                int size = width * height;
                byte[] managedData = new byte[size];
                Marshal.Copy(pIntensity, managedData, 0, size);
                Marshal.Copy(managedData, 0, bmpData.Scan0, size);
                bmp.UnlockBits(bmpData);
                // 触发事件通知 UI 更新亮度图
                ImageGrabbed?.Invoke(this, new CameraEventArgs(SN, bmp));
            }
            catch (Exception ex)
            {
                AsyncLogHelper.Error($"LBCamera: 生成亮度图异常 - {ex.Message}");
            }
        }
        private void SyncConfigFromCamera()
        {
            // 从相机读取所有参数并填充到 _sensorConfig
            foreach (EnumNameId id in Enum.GetValues(typeof(EnumNameId)))
            {
                int iVal = 0; double dVal = 0; int eVal = 0;
                if (PHM6000Profiler.GetProfilerParameter(_cameraHandle, (int)id, ref iVal, ref dVal, ref eVal) == 0)
                {
                    // 实际项目中应使用反射将值写回 _sensorConfig
                }
            }
        }
        private bool SetParam(EnumNameId id, float value)
        {
            if (!_isConnected) return false;
            return PHM6000Profiler.SetProfilerParameter(_cameraHandle, (int)id, 0, value, 0) == 0;
        }
        private bool GetParam(EnumNameId id, out float value)
        {
            value = 0;
            if (!_isConnected) return false;
            int iVal = 0; double dVal = 0; int eVal = 0;
            if (PHM6000Profiler.GetProfilerParameter(_cameraHandle, (int)id, ref iVal, ref dVal, ref eVal) == 0)
            {
                value = (float)dVal;
                return true;
            }
            return false;
        }
        #endregion
    }
}