From 53ca1ab0c4a3d35fea83e4dd3dcde40e93428df5 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期一, 11 十一月 2024 17:21:12 +0800 Subject: [PATCH] 细化资产表 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/03-valve/01-valvesinglematching/ValveSingleMatchingForm.cs | 65 ++++++++++++++++++++++---------- 1 files changed, 44 insertions(+), 21 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/03-valve/01-valvesinglematching/ValveSingleMatchingForm.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/03-valve/01-valvesinglematching/ValveSingleMatchingForm.cs index ea80723..8f69326 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/03-valve/01-valvesinglematching/ValveSingleMatchingForm.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/03-valve/01-valvesinglematching/ValveSingleMatchingForm.cs @@ -1,5 +1,4 @@ -锘縰sing HStation.WinFrmUI.Basic; -using HStation.WinFrmUI.PhartRelation; +锘縰sing HStation.WinFrmUI.PhartRelation; using HStation.WinFrmUI.Xhs; namespace HStation.WinFrmUI @@ -37,6 +36,8 @@ private ValveMatchingViewModel _pumpMatchingViewModel; + private List<CurvePointMatchingViewModel> _currentCurvePoint; + public async void SetBindingData(ValveMatchingViewModel valveMatchingViewModel) { _pumpMatchingViewModel = valveMatchingViewModel; @@ -48,7 +49,7 @@ _allBindingList.Add(new ValveSingleMatchingViewModel(Main)); } - this.searchControl1.Text = valveMatchingViewModel.ModelType; + this.searchControl1.Text = _pumpMatchingViewModel.ModelType; for (int i = 0; i < _allBindingList.Count; i++) { if (long.TryParse(valveMatchingViewModel.DbId, out long dbID)) @@ -60,6 +61,7 @@ } } this.valveSingleMatchingViewModelBindingSource.DataSource = _allBindingList; + _currentCurvePoint = new List<CurvePointMatchingViewModel>(); } //闃�闂ㄥ瀷鍙峰垪琛ㄩ�夋嫨椤瑰垏鎹簨浠� @@ -69,7 +71,7 @@ var vm = this.gridView3.GetCurrentViewModel(_allBindingList); if (vm != null) { - if (vm.SeriesType == HStation.Assets.eValveType.GPV) + if (vm.SeriesType == HStation.Assets.eValveType.GPV || vm.SeriesType == HStation.Assets.eValveType.TCV) { layoutControlGroup2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; } @@ -107,6 +109,7 @@ } } this.gridControl1.DataSource = _allPhartList; + this.gridView1.FocusInvalidRow(); } //鏌ョ湅鏇茬嚎 @@ -115,27 +118,47 @@ if (e.Column == this.ColShowChart) { var vm = this.gridView1.GetCurrentViewModel(_allPhartList); - if (vm != null) + + var vmo = await _bll_ex.Value.GetByID(vm.ID); + if (vmo != null) { - var vmo = await _bll_ex.Value.GetByID(vm.ID); - if (vmo != null) - { - _pumpMatchingViewModel.MatchingCurveDbId = vm.ID.ToString(); - var graph_ql = vmo.Diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.ValveQL); - if (graph_ql != null) - { - var points_qh = PhartPerformCurveHelper.GetFeatPointList(graph_ql.GraphType, graph_ql.GeometryInfo, 100, null); - _pumpMatchingViewModel.MatchingCurveQL = new List<CurvePointMatchingViewModel>(); - foreach (var item in points_qh) - { - _pumpMatchingViewModel.MatchingCurveQL.Add(new CurvePointMatchingViewModel(item.X, item.Y)); - } - } - } var dlg = new ValveChartShowDlg(); dlg.InitChart(vmo); dlg.ShowDialog(); - return; + } + return; + } + } + + private async void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) + { + var vm = this.gridView1.GetCurrentViewModel(_allPhartList); + _currentCurvePoint.Clear(); + if (vm == null) + return; + var vmo = await _bll_ex.Value.GetByID(vm.ID); + if (vmo != null) + { + _pumpMatchingViewModel.MatchingCurveDbId = vm.ID.ToString(); + var graph_ql = vmo.Diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.ValveQL); + var graph_ol = vmo.Diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.ValveOL); + if (graph_ql != null) + { + var points_qh = PhartPerformCurveHelper.GetFeatPointList(graph_ql.GraphType, graph_ql.GeometryInfo, 100, null); + foreach (var item in points_qh) + { + _currentCurvePoint.Add(new CurvePointMatchingViewModel(item.X, item.Y)); + } + _pumpMatchingViewModel.MatchingCurveQL = _currentCurvePoint; + } + if (graph_ol != null) + { + var points_qh = PhartPerformCurveHelper.GetFeatPointList(graph_ol.GraphType, graph_ol.GeometryInfo, 100, null); + foreach (var item in points_qh) + { + _currentCurvePoint.Add(new CurvePointMatchingViewModel(item.X, item.Y)); + } + _pumpMatchingViewModel.MatchingCurveOL = _currentCurvePoint; } } } -- Gitblit v1.9.3