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/VisionForm.cs |   75 +++++++++++++++++++++++++------------
 1 files changed, 51 insertions(+), 24 deletions(-)

diff --git a/LB_SmartVision/VisionForm.cs b/LB_SmartVision/VisionForm.cs
index 343d396..6bf83db 100644
--- a/LB_SmartVision/VisionForm.cs
+++ b/LB_SmartVision/VisionForm.cs
@@ -3,6 +3,7 @@
 using LB_SmartVision.Forms.Pages;
 using LB_SmartVision.Forms.Pages.CameraPage;
 using LB_SmartVision.Forms.Pages.CommunicatorPage;
+using LB_SmartVision.Forms.Pages.HistoricalData;
 using LB_SmartVision.Forms.Pages.MESPage;
 using LB_SmartVision.Forms.Pages.MotionControlPage;
 using LB_SmartVision.Forms.Pages.ProcessPage;
@@ -15,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;
@@ -42,6 +44,7 @@
     {
         AllProcessesPage AllProcessesPages = new AllProcessesPage();
         CamerasEditPage CamerasEditPage = new CamerasEditPage();
+        HistoricalDataEditPage HistoricalDataEditPage = new HistoricalDataEditPage();        
         CommunicatorsEditPage CommunicatorsEditPage = new CommunicatorsEditPage();
         SettingEditPage SettingEditPage = new SettingEditPage();
         MESEditPage MESEditPage = new MESEditPage();
@@ -69,6 +72,8 @@
             AllProcessesPages.controlsPanel.Dock = DockStyle.Fill;
             materialTabControl.Controls.Add(AllProcessesPages);
 
+            HistoricalDataEditPage.LogInfo += LogInfo;
+            materialTabControl.Controls.Add(new MyPage(HistoricalDataEditPage));
 
             CamerasEditPage.LogInfo += LogInfo;
             materialTabControl.Controls.Add(new MyPage(CamerasEditPage));
@@ -242,7 +247,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)
             {
@@ -258,19 +263,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");
@@ -282,32 +298,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()
@@ -502,9 +529,9 @@
         {
             XmlConfigurator.Configure(new System.IO.FileInfo("log4net.config"));
             string[] paths = {
-            @"鐢熶骇鏃ュ織\Run_Log",
-            @"鐢熶骇鏃ュ織\Debug_Log",
-            @"鐢熶骇鏃ュ織\Error_Log",
+            @"鐢熶骇鏃ュ織\Run",
+            @"鐢熶骇鏃ュ織\Debug",
+            @"鐢熶骇鏃ュ織\Error",
             @"鐢熶骇鏃ュ織\Fatal",
             @"鐢熶骇鏃ュ織\Warn",
             };

--
Gitblit v1.9.3