From 4446901f8ecde9b6e593d871465e89662ad58965 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期四, 05 十二月 2024 10:06:58 +0800 Subject: [PATCH] 修改单独匹配命名 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/17-compressor/CompressorSingleMatchingCtrl.cs | 133 ++++++++++++++++++-------------------------- 1 files changed, 54 insertions(+), 79 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/17-compressor/CompressorSingleMatchingCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/17-compressor/CompressorSingleMatchingCtrl.cs index b2625c0..c6ead10 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/17-compressor/CompressorSingleMatchingCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/17-compressor/CompressorSingleMatchingCtrl.cs @@ -24,7 +24,7 @@ { public long? Dbid { get; set; } public long? Curveid { get; set; } - // public Vmo.XhsCompressorMainPhartMappingExtensions Curveinfo { get; set; } + // public Vmo.XhsCompressorMainPhartMappingExtensions Curveinfo { get; set; } } private List<CompressorSingleMatchingViewModel> _allBindingList = null; @@ -32,7 +32,7 @@ private BLL.AssetsCompressorMain _CompressorBll = null; private List<PhartViewModel> _allPhartList = null; - //private readonly Lazy<BLL.XhsCompressorMainPhartMappingExtensions> _bll_ex = new(); + private readonly Lazy<BLL.AssetsCompressorCoefficient> _bll_ex = new(); private HydroCompressorMatchingViewModel _pumpMatchingViewModel; @@ -66,93 +66,68 @@ //闃�闂ㄥ瀷鍙峰垪琛ㄩ�夋嫨椤瑰垏鎹簨浠� private async void gridView2_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { - /* _allPhartList = new List<PhartViewModel>(); - var vm = this.gridView3.GetCurrentViewModel(_allBindingList); - if (vm != null) - { - if (vm.SeriesType == HStation.Assets.eCompressorType.GPV || vm.SeriesType == HStation.Assets.eCompressorType.TCV) - { - layoutControlGroup2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; - } - else - { - layoutControlGroup2.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; - } - _pumpMatchingViewModel.MatchingDbId = vm.ID.ToString(); - _pumpMatchingViewModel.MatchingModelType = vm.Name.ToString(); - - var list = await _bll_ex.Value.GetByCompressorMainID(vm.ID); - if (list != null && list.Any()) - { - foreach (var item in list) - { - _allPhartList.Add(new PhartViewModel { ID = item.ID, OtherName = item.OtherName, Importance = item.Importance, SortCode = item.SortCode }); - } - } - } - if (_pumpMatchingViewModel.MatchingCurveDbId != null) - { - for (int i = 0; i < _allPhartList.Count; i++) - { - if (_allBindingList[i].ID.ToString() == _pumpMatchingViewModel.MatchingCurveDbId) - { - gridView1.FocusedRowHandle = i; - } - } - } - this.gridControl1.DataSource = _allPhartList; - this.gridView1.FocusInvalidRow();*/ + _allPhartList = new List<PhartViewModel>(); + var vm = this.gridView3.GetCurrentViewModel(_allBindingList); + if (vm != null) + { + _pumpMatchingViewModel.MatchingDbId = vm.ID.ToString(); + _pumpMatchingViewModel.MatchingModelType = vm.Name.ToString(); + /* _pumpMatchingViewModel.MatchingMinorLoss = vm.Coefficient; + _pumpMatchingViewModel.MatchingMaterial = vm.Material; + _pumpMatchingViewModel.MatchingCompressorType = (eCompressorType?)vm.SeriesType; + _pumpMatchingViewModel.MatchingCompressorSetting = vm.CompressorSetting;*/ + var list = await _bll_ex.Value.GetByMainID(vm.ID); + if (list != null && list.Any()) + { + foreach (var item in list) + { + _allPhartList.Add(new PhartViewModel { ID = item.ID }); + } + } + } + if (_pumpMatchingViewModel.MatchingCurveDbId != null) + { + for (int i = 0; i < _allPhartList.Count; i++) + { + if (_allBindingList[i].ID.ToString() == _pumpMatchingViewModel.MatchingCurveDbId) + { + gridView1.FocusedRowHandle = i; + } + } + } + this.gridControl1.DataSource = _allPhartList; + this.gridView1.FocusInvalidRow(); } //鏌ョ湅鏇茬嚎 private async void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { - /* if (e.Column == this.ColShowChart) - { - var vm = this.gridView1.GetCurrentViewModel(_allPhartList); + if (e.Column == this.ColShowChart) + { + var vm = this.gridView1.GetCurrentViewModel(_allPhartList); - var vmo = await _bll_ex.Value.GetByID(vm.ID); - if (vmo != null) - { - var dlg = new CompressorChartShowDlg(); - dlg.InitChart(vmo); - dlg.ShowDialog(); - } - return; - }*/ + var vmo = await _bll_ex.Value.GetByID(vm.ID); + if (vmo != null) + { + var dlg = new CompressorChartShowDlg(); + dlg.InitChart(vmo.MinorLossCurve); + dlg.ShowDialog(); + } + 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.CompressorQL); - var graph_ol = vmo.Diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.CompressorOL); - 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 HydroCurvePointViewModel(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 HydroCurvePointViewModel(item.X, item.Y)); - } - _pumpMatchingViewModel.MatchingCurveOL = _currentCurvePoint; - } - }*/ + 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(); + } } } } \ No newline at end of file -- Gitblit v1.9.3