From 97e1e604737e70a9df2e83897d3bbf68292d0d72 Mon Sep 17 00:00:00 2001 From: Shuxia Ning <NingShuxia0927@outlook.com> Date: 星期四, 19 十二月 2024 20:21:52 +0800 Subject: [PATCH] 代码修改 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/02-pump/01-pumpsinglematching/SimulationPumpSingleMatchingDlg.cs | 163 +++++++++++++++++++++++++++--------------------------- 1 files changed, 82 insertions(+), 81 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/02-pump/01-pumpsinglematching/SimulationPumpSingleMatchingDlg.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/02-pump/01-pumpsinglematching/SimulationPumpSingleMatchingDlg.cs index 4ecc11f..725748a 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/02-pump/01-pumpsinglematching/SimulationPumpSingleMatchingDlg.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/02-pump/01-pumpsinglematching/SimulationPumpSingleMatchingDlg.cs @@ -20,7 +20,7 @@ public string OtherName { get; set; } public int Importance { get; set; } public int SortCode { get; set; } - public PhartDiagramExGraphListVmo Diagram { get; set; } + // public PhartDiagramExGraphListVmo Diagram { get; set; } } private HydroPumpMatchingViewModel _pump_matching_vm = null; @@ -64,42 +64,42 @@ private void barBtnOK_ItemClick(object sender, ItemClickEventArgs e) { - var pump_mian = this.gridViewPumpMain.GetCurrentViewModel(_pump_mian_vm_list); - if (pump_mian == null) - { - TipFormHelper.ShowError("娉靛瀷鍙蜂负绌�"); - return; - } - var phart = this.gridViewCurve.GetCurrentViewModel(_phart_vm_list); - if (phart == null) - { - TipFormHelper.ShowError("娉靛瀷鍙锋洸绾夸负绌�"); - return; - } + /* var pump_mian = this.gridViewPumpMain.GetCurrentViewModel(_pump_mian_vm_list); + if (pump_mian == null) + { + TipFormHelper.ShowError("娉靛瀷鍙蜂负绌�"); + return; + } + var phart = this.gridViewCurve.GetCurrentViewModel(_phart_vm_list); + if (phart == null) + { + TipFormHelper.ShowError("娉靛瀷鍙锋洸绾夸负绌�"); + return; + } - var diagram = phart.Diagram; - if (!OutPtList - (diagram, - out List<Yw.Geometry.Point2d> qh_pt_list, - out List<Yw.Geometry.Point2d> qe_pt_list, - out List<Yw.Geometry.Point2d> qp_pt_list - )) - { - return; - } - _pump_matching_vm.MatchingDbId = pump_mian.ID.ToString(); - _pump_matching_vm.MatchingModelType = pump_mian.Name.ToString(); - _pump_matching_vm.MatchingRatedH = pump_mian.RatedHead; - _pump_matching_vm.MatchingRatedN = pump_mian.RatedSpeed; - _pump_matching_vm.MatchingRatedP = pump_mian.RatedPower; - _pump_matching_vm.MatchingRatedQ = pump_mian.RatedFlow; + var diagram = phart.Diagram; + if (!OutPtList + (diagram, + out List<Yw.Geometry.Point2d> qh_pt_list, + out List<Yw.Geometry.Point2d> qe_pt_list, + out List<Yw.Geometry.Point2d> qp_pt_list + )) + { + return; + } + _pump_matching_vm.MatchingDbId = pump_mian.ID.ToString(); + _pump_matching_vm.MatchingModelType = pump_mian.Name.ToString(); + _pump_matching_vm.MatchingRatedH = pump_mian.RatedHead; + _pump_matching_vm.MatchingRatedN = pump_mian.RatedSpeed; + _pump_matching_vm.MatchingRatedP = pump_mian.RatedPower; + _pump_matching_vm.MatchingRatedQ = pump_mian.RatedFlow; - _pump_matching_vm.MatchingCurveDbId = phart.ID.ToString(); - _pump_matching_vm.MatchingCurveQH = qh_pt_list.Select(x => new HydroCurvePointViewModel(x.X, x.Y)).ToList(); - _pump_matching_vm.MatchingCurveQE = qe_pt_list?.Select(x => new HydroCurvePointViewModel(x.X, x.Y)).ToList(); - _pump_matching_vm.MatchingCurveQP = qp_pt_list?.Select(x => new HydroCurvePointViewModel(x.X, x.Y)).ToList(); + _pump_matching_vm.MatchingCurveDbId = phart.ID.ToString(); + _pump_matching_vm.MatchingCurveQH = qh_pt_list.Select(x => new HydroCurvePointViewModel(x.X, x.Y)).ToList(); + _pump_matching_vm.MatchingCurveQE = qe_pt_list?.Select(x => new HydroCurvePointViewModel(x.X, x.Y)).ToList(); + _pump_matching_vm.MatchingCurveQP = qp_pt_list?.Select(x => new HydroCurvePointViewModel(x.X, x.Y)).ToList(); - this.ReloadDataEvent?.Invoke(_pump_matching_vm); + this.ReloadDataEvent?.Invoke(_pump_matching_vm);*/ this.Close(); } @@ -119,7 +119,7 @@ vm.OtherName = item.OtherName; vm.Importance = item.Importance; vm.SortCode = item.SortCode; - vm.Diagram = item.Diagram; + // vm.Diagram = item.Diagram; _phart_vm_list.Add(vm); } } @@ -139,57 +139,58 @@ return; } - var diagram = phart.Diagram; - if (!OutPtList - (diagram, - out List<Yw.Geometry.Point2d> qh_pt_list, - out List<Yw.Geometry.Point2d> qe_pt_list, - out List<Yw.Geometry.Point2d> qp_pt_list - )) - { - this.xtrPerform2dChart1.InitialChartData(); - return; - } + /* var diagram = phart.Diagram; + if (!OutPtList + (diagram, + out List<Yw.Geometry.Point2d> qh_pt_list, + out List<Yw.Geometry.Point2d> qe_pt_list, + out List<Yw.Geometry.Point2d> qp_pt_list + )) + { + this.xtrPerform2dChart1.InitialChartData(); + return; + } - var cubic_spline_qh = new Yw.Geometry.CubicSpline2d(qh_pt_list); - var cubic_spline_qe = new Yw.Geometry.CubicSpline2d(qe_pt_list); - var cubic_spline_qp = new Yw.Geometry.CubicSpline2d(qp_pt_list); - var disp_paras = diagram.DispParas; - var is_calc_disp_paras = string.IsNullOrWhiteSpace(disp_paras); - this.xtrPerform2dChart1.SetBindingData(cubic_spline_qh, cubic_spline_qe, cubic_spline_qp, disp_paras, is_calc_disp_paras); + var cubic_spline_qh = new Yw.Geometry.CubicSpline2d(qh_pt_list); + var cubic_spline_qe = new Yw.Geometry.CubicSpline2d(qe_pt_list); + var cubic_spline_qp = new Yw.Geometry.CubicSpline2d(qp_pt_list); + var disp_paras = diagram.DispParas; + var is_calc_disp_paras = string.IsNullOrWhiteSpace(disp_paras); + this.xtrPerform2dChart1.SetBindingData(cubic_spline_qh, cubic_spline_qe, cubic_spline_qp, disp_paras, is_calc_disp_paras);*/ } - private bool OutPtList( - PhartDiagramExGraphListVmo diagram, - out List<Yw.Geometry.Point2d> qh_pt_list, - out List<Yw.Geometry.Point2d> qe_pt_list, - out List<Yw.Geometry.Point2d> qp_pt_list - ) - { - qh_pt_list = null; - qe_pt_list = null; - qp_pt_list = null; + /* private bool OutPtList( + // PhartDiagramExGraphListVmo diagram, + out List<Yw.Geometry.Point2d> qh_pt_list, + out List<Yw.Geometry.Point2d> qe_pt_list, + out List<Yw.Geometry.Point2d> qp_pt_list + ) + { + qh_pt_list = null; + qe_pt_list = null; + qp_pt_list = null; - var graph_qh = diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.PumpQH); - var graph_qe = diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.PumpQE); - var graph_qp = diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.PumpQP); - if (graph_qh == null) - { - this.xtrPerform2dChart1.InitialChartData(); - return false; - } + var graph_qh = diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.QH); + var graph_qe = diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.QE); + var graph_qp = diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.QP); + if (graph_qh == null) + { + this.xtrPerform2dChart1.InitialChartData(); + return false; + } - qh_pt_list = PhartPerformCurveHelper.GetFeatPointList(graph_qh.GraphType, graph_qh.GeometryInfo, 100, null); - if (graph_qe != null) - { - qe_pt_list = PhartPerformCurveHelper.GetFeatPointList(graph_qe.GraphType, graph_qe.GeometryInfo, 100, null); - } - if (graph_qp != null) - { - qp_pt_list = PhartPerformCurveHelper.GetFeatPointList(graph_qp.GraphType, graph_qp.GeometryInfo, 100, null); - } + qh_pt_list = PhartPerformCurveHelper.GetFeatPointList(graph_qh.GraphType, graph_qh.GeometryInfo, 100, null); + if (graph_qe != null) + { + qe_pt_list = PhartPerformCurveHelper.GetFeatPointList(graph_qe.GraphType, graph_qe.GeometryInfo, 100, null); + } + if (graph_qp != null) + { + qp_pt_list = PhartPerformCurveHelper.GetFeatPointList(graph_qp.GraphType, graph_qp.GeometryInfo, 100, null); + } - return true; - } + return true; + } + */ } } \ No newline at end of file -- Gitblit v1.9.3