From a9bc7819f4f7e66159a93e955944728c25ba3e53 Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期三, 07 一月 2026 14:10:11 +0800
Subject: [PATCH] 优化相机管理和界面布局 - 在 `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
---
LB_SmartVision/Forms/Pages/CommunicatorPage/CommunicatorForm.cs | 47 ++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 42 insertions(+), 5 deletions(-)
diff --git a/LB_SmartVision/Forms/Pages/CommunicatorPage/CommunicatorForm.cs b/LB_SmartVision/Forms/Pages/CommunicatorPage/CommunicatorForm.cs
index c582b42..08c07a7 100644
--- a/LB_SmartVision/Forms/Pages/CommunicatorPage/CommunicatorForm.cs
+++ b/LB_SmartVision/Forms/Pages/CommunicatorPage/CommunicatorForm.cs
@@ -1,4 +1,5 @@
锘縰sing LB_VisionProcesses.Communicators;
+using LB_VisionProcesses.Communicators.SiemensS7;
using LB_VisionProcesses.Communicators.TCom;
using ReaLTaiizor.Forms;
using RJCP.IO.Ports;
@@ -6,13 +7,19 @@
namespace LB_SmartVision.Forms.Pages.CommunicatorPage
{
- public partial class CommunicatorForm : MaterialForm
+ public partial class CommunicatorForm : Form
{
BaseCommunicator communicator { get; set; }
public CommunicatorForm()
{
InitializeComponent();
+ cmbType.Items.Clear();
+
+ if (communicator != null && !string.IsNullOrEmpty(communicator.CommunicatorConnections["鍨嬪彿"]?.ToString()))
+ {
+ cmbType.Items.Add(communicator.CommunicatorConnections["鍨嬪彿"]?.ToString());
+ }
}
public CommunicatorForm(BaseCommunicator communicator, string name)
@@ -24,6 +31,14 @@
cmbIP.Enabled = false;
txtIP.Enabled = false;
txtPort.Enabled = false;
+
+
+ lblType.Visible = false;
+ lblAddress.Visible = false;
+ cmbType.Visible = false;
+ txtAddress.Visible = false;
+
+
this.Text = name;
if (communicator is UARTPort)
@@ -39,28 +54,50 @@
txtIP.Visible = false;
cmbIP.Visible = true;
+ lblType.Visible = false;
+ lblAddress.Visible = false;
+ cmbType.Visible = false;
+ txtAddress.Visible = false;
+
lblIP.Text = "COM鍙�";
lblPort.Text = "娉㈢壒鐜�";
}
else if (communicator is TCPClient || communicator is TCPServer)
{
txtIP.Text = communicator.CommunicatorConnections["鍦板潃"]?.ToString();
- txtPort.Text = communicator.CommunicatorConnections["绔彛"]?.ToString();
+ txtPort.SelectedText = communicator.CommunicatorConnections["绔彛"]?.ToString();
txtIP.Visible = true;
cmbIP.Visible = false;
+
+ lblType.Visible = false;
+ lblAddress.Visible = false;
+ cmbType.Visible = false;
+ txtAddress.Visible = false;
lblIP.Text = "鍦板潃";
lblPort.Text = "绔彛";
}
- else if (communicator is LocalMonitor)
+ else if (communicator is SiemensLBS7)
{
txtIP.Text = communicator.CommunicatorConnections["鍦板潃"]?.ToString();
txtPort.Text = communicator.CommunicatorConnections["绔彛"]?.ToString();
+ cmbType.Items.Clear();
+
+ if (!string.IsNullOrEmpty(communicator.CommunicatorConnections["鍨嬪彿"]?.ToString()))
+ {
+ cmbType.Items.Add(communicator.CommunicatorConnections["鍨嬪彿"]?.ToString());
+ }
+ cmbType.Text = communicator.CommunicatorConnections["鍨嬪彿"]?.ToString();
txtIP.Visible = true;
cmbIP.Visible = false;
- lblIP.Text = "鐩戞帶鏂囦欢";
- lblPort.Text = "鍐欏叆鏂囦欢";
+ lblType.Visible = true;
+ lblAddress.Visible = true;
+ cmbType.Visible = true;
+ txtAddress.Visible = true;
+
+ lblIP.Text = "IP";
+ lblPort.Text = "妲�";
}
this.communicator = communicator;
--
Gitblit v1.9.3