From 8a8983dd2053b631c559b257b1501d740bedf4a5 Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期五, 20 九月 2024 16:09:12 +0800
Subject: [PATCH] 优化匹配界面

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ValveMatchingCtrl.cs |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ValveMatchingCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ValveMatchingCtrl.cs
index ab4586e..1b3430c 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ValveMatchingCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ValveMatchingCtrl.cs
@@ -10,18 +10,25 @@
             this.gridView1.OptionsView.ShowGroupPanel = false;
         }
 
-        private BLL.AdaptingManage _adaptingBll;
-
         private List<ValveMatchingViewModel> _allBindingList = null;
 
-        public List<ValveMatchingViewModel> SetBindingData(List<ValveMatchingViewModel> inputs)
+        public void SetBindingData(List<ValveMatchingViewModel> valveMatchingViewModels)
         {
+            if (_allBindingList != null)
+            {
+                _allBindingList = valveMatchingViewModels;
+                this.valveMatchingViewModelBindingSource.DataSource = _allBindingList;
+            }
+        }
+
+        public List<ValveMatchingViewModel> SetMatching(List<ValveMatchingViewModel> inputs, List<ValveMainVmo> alllist)
+        {
+            if (inputs == null)
+                return null;
             var finishList = new List<ValveMatchingViewModel>();
-            _adaptingBll = new BLL.AdaptingManage();
-            var alllist = _adaptingBll.GetAll().Result;
             foreach (var item in inputs)
             {
-                var result = AsstesAutoMatchingHelper.AutoMatching(item, alllist);
+                var result = AsstesAutoMatchingHelper.ValveMatching(item, alllist);
                 if (result != null)
                 {
                     finishList.Add(result);
@@ -31,7 +38,6 @@
                 }
             }
             _allBindingList = finishList;
-            this.valveMatchingViewModelBindingSource.DataSource = _allBindingList;
             this.valveMatchingViewModelBindingSource.ResetBindings(false);
             return finishList;
         }

--
Gitblit v1.9.3