From 833c76cfe3e33a8225051405623711ffceccff2e Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期一, 19 一月 2026 16:50:21 +0800
Subject: [PATCH] 合并冲突

---
 LB_SmartVision/VisionForm.cs |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 57 insertions(+), 1 deletions(-)

diff --git a/LB_SmartVision/VisionForm.cs b/LB_SmartVision/VisionForm.cs
index 7b5d3c5..2b0d895 100644
--- a/LB_SmartVision/VisionForm.cs
+++ b/LB_SmartVision/VisionForm.cs
@@ -634,7 +634,15 @@
             {
                 LogInfo("鍏ㄥ眬鍙橀噺鍔犺浇澶辫触", LogInfoType.ERROR);
             }
-
+            GlobalVar.dicMotionControlData.Clear();
+            if (LoadMotionControlDatas(GlobalVar.allMotionControlDataPath))
+            {
+                LogInfo("杩愬姩鎺у埗鍙傛暟鍔犺浇鎴愬姛", LogInfoType.PASS);
+            }
+            else
+            {
+                LogInfo("杩愬姩鎺у埗鍙傛暟鍔犺浇澶辫触", LogInfoType.ERROR);
+            }
             //鍔犺浇娴佺▼
             GlobalVar.dicProcesses.Clear();
             if (LoadAllProcess(GlobalVar.allProcessConnectionStringPath))
@@ -700,6 +708,54 @@
             SaveAllProcessSetting();
             SaveAllLayout();
             SaveAllCsv();
+            SaveMotionControlDatas();
+        }
+        public bool LoadMotionControlDatas(string alMotionControlDataPath)
+        {
+            try
+            {
+                GlobalVar.dicMotionControlData = ConfigManager<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>.LoadConfig<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>(alMotionControlDataPath);
+            }
+            catch
+            {
+                return false;
+            }
+            return true;
+        }
+        public bool SaveMotionControlDatas()
+        {
+            try
+            {
+                ConcurrentDictionary<string, List<string>> removeCameraSN = new ConcurrentDictionary<string, List<string>>();
+                foreach (var item in GlobalVar.dicMotionControlData.Keys)
+                {
+                    List<string> list = new List<string>();
+                    foreach (var itemSN in GlobalVar.dicMotionControlData[item].Keys)
+                    {
+                        if (!GlobalVar.dicCameras.Keys.Contains(itemSN))
+                        {
+                            list.Add(itemSN);
+                        }
+                    }
+                    if (list.Count > 0)
+                    {
+                        removeCameraSN.TryAdd(item, list);
+                    }
+                }
+                foreach (var item in removeCameraSN.Keys)
+                {
+                    foreach (var itemSN in removeCameraSN[item])
+                    {
+                        GlobalVar.dicMotionControlData[item].Keys.Remove(itemSN);
+                    }
+                }
+                ConfigManager<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>.SaveConfig<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>(GlobalVar.dicMotionControlData, GlobalVar.allMotionControlDataPath);
+            }
+            catch
+            {
+                return false;
+            }
+            return true;
         }
 
         public bool LoadAllCameras(string allCamerasConnectionStringPath)

--
Gitblit v1.9.3