From 39d2183cdaf8ce1ee77e36fed5a447b2d8d897a1 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期五, 20 九月 2024 16:33:59 +0800
Subject: [PATCH] 增加input

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/XhsProjectSimulationCorePage.cs |   91 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 87 insertions(+), 4 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/XhsProjectSimulationCorePage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/XhsProjectSimulationCorePage.cs
index bb1af71..5a61518 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/XhsProjectSimulationCorePage.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -254,14 +254,99 @@
                 return;
             }
             _hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(id);
-            //this.xhsProjectSimulationPropertyCtrl1.SetBindingData(_hydroInfo);
+            //this.xhsProjectSimulationPropertyCtrl1.SetMatching(_hydroInfo);
             TipFormHelper.ShowSucceed("淇濆瓨鎴愬姛锛�");
         }
 
         //鑷姩鍖归厤
         private void barBtnAllAutoMatching_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-            var dlg = new AssetsAutoMatchingMainDlg(new AssetsAutoMatchingInputViewModel());
+            if (_hydroInfo == null)
+            {
+                return;
+            }
+            var input = new AssetsAutoMatchingInputViewModel();
+            input.PumpMatchingModels = _hydroInfo.Pumps?.Select(x => new PumpMatchingViewModel()
+            {
+                ID = x.ID,
+                Code = x.Code,
+                Name = x.Name,
+                DbID = x.DbId,
+                DbLocked = x.DbLocked,
+                //ChartDbID=_hydroInfo.Curves?.Find(t=>t.Code==x.CurveQH)?.DbId,杩欓噷涓嶆槸long CurveDbId
+                ModelType = x.ModelType,
+                RatedP = x.RatedP,
+                RatedH = x.RatedH,
+                RatedN = x.RatedN,
+                RatedQ = x.RatedQ,
+            }).ToList();
+            input.ElbowsMatchingModels = _hydroInfo.Elbows?.Select(x => new ElbowsMatchingViewModel()
+            {
+                ID = x.ID,
+                Name = x.Name,
+                Code = x.Code,
+                // Dbid=x.DbId,杩欓噷鏄痵tring DbId
+                DbLocked = x.DbLocked,
+                ModelType = x.ModelType,
+                Caliber = x.Caliber,
+                Material = x.Material
+            }).ToList();
+            input.ThreeLinkMatchingModels = _hydroInfo.Threelinks?.Select(x => new ThreeLinkMatchingViewModel()
+            {
+                ID = x.ID,
+                Name = x.Name,
+                Code = x.Code,
+                // Dbid=x.DbId,杩欓噷鏄痵tring DbId
+                DbLocked = x.DbLocked,
+                ModelType = x.ModelType,
+                Caliber = x.Caliber,
+                Material = x.Material
+            }).ToList();
+            input.FourLinkMatchingModels = _hydroInfo.Fourlinks?.Select(x => new FourLinkMatchingViewModel()
+            {
+                ID = x.ID,
+                Name = x.Name,
+                Code = x.Code,
+                // Dbid=x.DbId,杩欓噷鏄痵tring DbId
+                DbLocked = x.DbLocked,
+                ModelType = x.ModelType,
+                Caliber = x.Caliber,
+                Material = x.Material
+            }).ToList();
+            //鏋勯�犲嚱鏁版湁闂
+            //input.PipeLineMatchingModels = _hydroInfo.Pipes?.Select(x => new PipeLineMatchingViewModel()
+            //{
+            //    ID = x.ID,
+            //    Name = x.Name,
+            //    Code = x.Code,
+            //    // Dbid=x.DbId,杩欓噷鏄痵tring DbId
+            //    DbLocked = x.DbLocked,
+            //    ModelType = x.ModelType,
+            //    Caliber = x.Diameter.ToString(),//杩欓噷鏄暟鍊�
+            //    Material = x.Material
+            //}).ToList();
+
+            input.ValveMatchingModels = _hydroInfo.Pipes?.Select(x => new ValveMatchingViewModel()
+            {
+                ID = x.ID,
+                Name = x.Name,
+                Code = x.Code,
+                // Dbid=x.DbId,杩欓噷鏄痵tring DbId
+                DbLocked = x.DbLocked,
+                ModelType = x.ModelType,
+                Caliber = x.Diameter.ToString(),//杩欓噷鏄暟鍊�
+                Material = x.Material//鎬庝箞娌℃湁闃�闂ㄧ被鍨�
+            }).ToList();
+
+            //鏃㈢劧鍏ュ弬鍜屽嚭鍙傚凡缁忎繚鎸佷竴鑷翠簡锛屽氨涓嶈兘鍙仛InputViewModel浜嗭紝鏈夋涔�
+            //杩欓噷鍙互鍏堟槸绐椾綋锛岃皟璇曞ソ锛屽悗闈㈡敼鎴愭帶浠�
+            var dlg = new AssetsAutoMatchingMainDlg();
+            dlg.SetBindingData(input);
+            // dlg.SetBindingData();
+            dlg.RelaodEvent += (rhs) =>
+            {
+                return false;
+            };
             dlg.ShowDialog();
         }
 
@@ -291,7 +376,5 @@
             await this.xhsProjectSimulationBimfaceCtrl1.SetSelectedComponents(new List<string>() { parter.Code });
             ShowProperty();
         }
-
-
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3