From 9c8743941f556a486ba2cc5bcb8a7a6ec1079d0a Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期四, 26 九月 2024 11:55:07 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/PipeLineMatchingCtrl.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/PipeLineMatchingCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/PipeLineMatchingCtrl.cs index f688acf..6540935 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/PipeLineMatchingCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/PipeLineMatchingCtrl.cs @@ -9,5 +9,63 @@ this.gridView1.OptionsView.ShowDetailButtons = true; this.gridView1.OptionsView.ShowGroupPanel = false; } + + private List<PipeLineFormViewModel> _allBindingList = new List<PipeLineFormViewModel>(); + + /// <summary> + /// 鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<string> RowClickEvent; + + public void SetBindingData(List<PipeLineMatchingViewModel> pipeLineMatchingViewModels) + { + if (pipeLineMatchingViewModels != null) + { + foreach (var item in pipeLineMatchingViewModels) + { + _allBindingList.Add(new PipeLineFormViewModel(item)); + } + this.pipeLineFormViewModelBindingSource.DataSource = _allBindingList; + } + } + + public List<PipeLineMatchingViewModel> SetMatching(List<PipeLineMatchingViewModel> inputs, List<PipeLineManageVmo> alllist) + { + if (inputs == null) + { + return null; + } + var finishList = new List<PipeLineMatchingViewModel>(); + foreach (var item in inputs) + { + var result = AssetsMatchingHelper.MatchingPipes(item, alllist); + if (result != null) + { + finishList.Add(result); + } + else + { + finishList.Add(item); + } + } + _allBindingList.Clear(); + foreach (var item in finishList) + { + _allBindingList.Add(new PipeLineFormViewModel(item)); + } + this.pipeLineFormViewModelBindingSource.ResetBindings(false); + return finishList; + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) + { + var row = this.gridView1.GetCurrentViewModel(_allBindingList); + if (row == null) + { + return; + } + this.RowClickEvent?.Invoke(row.Code); + } } } \ No newline at end of file -- Gitblit v1.9.3