From e8df282b9b5de43250164efa2cb55a19de267c0b Mon Sep 17 00:00:00 2001
From: C3032 <C3032@BC3032>
Date: 星期二, 06 一月 2026 14:22:22 +0800
Subject: [PATCH] 3D相机功能实现和参数界面扩展,通过将 PHM6000SensorConfig 绑定到 PropertyGrid,用户可以直接在界面上调整所有 3D 参数
---
LB_SmartVision/VisionForm.cs | 82 ++++++++++++++++++++++++++--------------
1 files changed, 53 insertions(+), 29 deletions(-)
diff --git a/LB_SmartVision/VisionForm.cs b/LB_SmartVision/VisionForm.cs
index efa9ff0..971f1cb 100644
--- a/LB_SmartVision/VisionForm.cs
+++ b/LB_SmartVision/VisionForm.cs
@@ -40,7 +40,7 @@
{
public partial class VisionForm : Form
{
- AllProcessesPage AllProcessesPage = new AllProcessesPage();
+ AllProcessesPage AllProcessesPages = new AllProcessesPage();
CamerasEditPage CamerasEditPage = new CamerasEditPage();
CommunicatorsEditPage CommunicatorsEditPage = new CommunicatorsEditPage();
SettingEditPage SettingEditPage = new SettingEditPage();
@@ -66,7 +66,9 @@
//鏈�寮�濮嬪氨娓呯┖鎵�鏈塗ab椤�
materialTabControl.TabPages.Clear();
- materialTabControl.Controls.Add(AllProcessesPage);
+ AllProcessesPages.controlsPanel.Dock = DockStyle.Fill;
+ materialTabControl.Controls.Add(AllProcessesPages);
+
CamerasEditPage.LogInfo += LogInfo;
materialTabControl.Controls.Add(new MyPage(CamerasEditPage));
@@ -90,7 +92,6 @@
{
//materialTabControl.TabPages[i].Font= new Font("Microsoft YaHei UI", 18F, FontStyle.Regular, GraphicsUnit.Point, 0);
}
-
materialTabSelector.BaseTabControl = materialTabControl;
//materialTabSelector.Font = new Font("Microsoft YaHei UI", 18F, FontStyle.Regular, GraphicsUnit.Point, 0);
}
@@ -241,7 +242,7 @@
{
return;
}
- string strInfo = DateTime.Now.ToString("[yyyy:MM:HH:mm:ss:fff] ");
+ string strInfo = DateTime.Now.ToString("[yyyy:MM:dd:HH:mm:ss:fff] ");
strInfo += strLog;
if (infoType != LogInfoType.NOSHOW)
{
@@ -257,19 +258,30 @@
switch (infoType)
{
case LogInfoType.INFO:
- this.rich_Info.SelectionColor = Color.Wheat;
- break;
+ {
+ this.rich_Info.SelectionColor = Color.Wheat;
+ AsyncLogHelper.Info(strLog);
+ break;
+ }
case LogInfoType.WARN:
- this.rich_Info.SelectionColor = Color.LightGoldenrodYellow;
- break;
+ {
+ this.rich_Info.SelectionColor = Color.Yellow;
+ AsyncLogHelper.Warn(strLog);
+ break;
+ }
case LogInfoType.PASS:
- this.rich_Info.SelectionColor = Color.Green;
- break;
+ {
+ this.rich_Info.SelectionColor = Color.Green;
+ AsyncLogHelper.Info(strLog);
+ break;
+ }
case LogInfoType.ERROR:
- this.rich_Info.SelectionColor = Color.Red;
- break;
+ {
+ this.rich_Info.SelectionColor = Color.Red;
+ AsyncLogHelper.Error(strLog);
+ break;
+ }
}
-
// 鏇存柊 UI 鎺т欢锛屾瘮濡傛樉绀烘帴鏀跺埌鐨勬秷鎭�
this.rich_Info.AppendText(strInfo);
this.rich_Info.AppendText("\r\n");
@@ -281,32 +293,43 @@
{
if (this.rich_Info.Lines.Length > 1000)
+ {
this.rich_Info.Clear();
-
+ }
// 濡傛灉宸茬粡鍦� UI 绾跨▼涓婏紝鐩存帴鏇存柊 UI
switch (infoType)
{
case LogInfoType.INFO:
- this.rich_Info.SelectionColor = Color.Wheat;
- break;
+ {
+ this.rich_Info.SelectionColor = Color.Wheat;
+ AsyncLogHelper.Info(strLog);
+ break;
+ }
case LogInfoType.WARN:
- this.rich_Info.SelectionColor = Color.Yellow;
- break;
+ {
+ this.rich_Info.SelectionColor = Color.Yellow;
+ AsyncLogHelper.Warn(strLog);
+ break;
+ }
case LogInfoType.PASS:
- this.rich_Info.SelectionColor = Color.Green;
- break;
+ {
+ this.rich_Info.SelectionColor = Color.Green;
+ AsyncLogHelper.Info(strLog);
+ break;
+ }
case LogInfoType.ERROR:
- this.rich_Info.SelectionColor = Color.Red;
- break;
+ {
+ this.rich_Info.SelectionColor = Color.Red;
+ AsyncLogHelper.Error(strLog);
+ break;
+ }
}
-
this.rich_Info.AppendText(strInfo);
this.rich_Info.AppendText("\r\n");
this.rich_Info.SelectionStart = this.rich_Info.Text.Length;
this.rich_Info.ScrollToCaret();
}
}
- AsyncLogHelper.Info(strLog);
}
public static bool SaveAllLayout()
@@ -501,9 +524,9 @@
{
XmlConfigurator.Configure(new System.IO.FileInfo("log4net.config"));
string[] paths = {
- @"鐢熶骇鏃ュ織\Run_Log",
- @"鐢熶骇鏃ュ織\Debug_Log",
- @"鐢熶骇鏃ュ織\Error_Log",
+ @"鐢熶骇鏃ュ織\Run",
+ @"鐢熶骇鏃ュ織\Debug",
+ @"鐢熶骇鏃ュ織\Error",
@"鐢熶骇鏃ュ織\Fatal",
@"鐢熶骇鏃ュ織\Warn",
};
@@ -611,6 +634,7 @@
}
com_ProductName.Items.Add("鏂板");
com_ProductName.Text = GlobalVar.strProductName;
+ this.WindowState = FormWindowState.Maximized;
}
public void SaveAllSetting()
@@ -1424,12 +1448,12 @@
{
string title = layout.Title;
string strImagePath = layout.SaveImageDir;
- if (!AllProcessesPage.dicProcessControls.ContainsKey(title))
+ if (!AllProcessesPages.dicProcessControls.ContainsKey(title))
{
continue;
}
RunBll.GetImage(layout, out InputImage, out RecordImage);
- AllProcessesPage.dicProcessControls[title].ShowHoImage(RecordImage);
+ AllProcessesPages.dicProcessControls[title].ShowHoImage(RecordImage);
if (!string.IsNullOrEmpty(layout.SaveImageDir))
{
string fileNameHead = layout.SaveImageHead;
--
Gitblit v1.9.3