From a5f3c47ee959183e3059fc6672b4b07f99eb9c1a Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期三, 06 十一月 2024 15:28:58 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/PumpParallelAnalyDlg.cs | 78 ++++++++++++++++++++++++++++++++------ 1 files changed, 65 insertions(+), 13 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/PumpParallelAnalyDlg.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/PumpParallelAnalyDlg.cs index 55de50d..05c0bb0 100644 --- a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/PumpParallelAnalyDlg.cs +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/PumpParallelAnalyDlg.cs @@ -1,5 +1,6 @@ 锘縰sing System.Data; using Yw.Geometry; +using Yw.WinFrmUI.Phart; namespace HStation.WinFrmUI.PhartRelation { @@ -120,16 +121,55 @@ var qp_pt_list = x.CurveQP.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); vm.Qp = new CubicSpline2d(qp_pt_list); } + vm.CalcuQ = x.CalcuQ; vm.CalcuH = x.CalcuH; vm.Color = GetRandomColor(i); vm.Calc(); vm_list.Add(vm); + if (!x.RunStatus) + continue; + + if (!x.CalcuQ.HasValue || !x.CalcuH.HasValue) + continue; + var calc_flow = x.CalcuQ.Value; + var calc_head = x.CalcuH.Value; + + var max_flow = vm.Qh.MaxX; + var max_flow_head = vm.Qh.GetPointY(max_flow); + + var min_flow = vm.Qh.MinX; + var min_flow_head = vm.Qh.GetPointY(min_flow); + + if (max_flow_head < calc_head && min_flow_head > calc_head) + continue; + + var extend_ratio = 1m; + var extend_success = false; + for (decimal num = 0.01m; num <= 5; num += 0.01m) + { + extend_ratio += num; + var ex_pt_list = qh_pt_list.GetExpandFitPointList((double)extend_ratio); + var ex_x_array = ex_pt_list.GetInterPointsX(calc_head); + if (ex_x_array != null && ex_x_array.Any()) + { + extend_success = true; + vm.ExtendRatio = Math.Round((double)extend_ratio * 100, 1); + vm.Calc(); + break; + } + } + if (!extend_success) + { + + } } + this.pumpParallelInfoCtrl1.SetBindingData(vm_list, null); var run_list = this.pumpParallelInfoCtrl1.GetRunList(); - var msg = SetParallel(run_list); + var msg = SetParallel(run_list); + this.pumpSerialParallelChart.SetQeVisible(false); if (!string.IsNullOrEmpty(msg)) { return msg; @@ -168,6 +208,7 @@ Set(list); this.barInfo.Caption = $"<b><color=red>{msg}</color></b>"; return msg; + } @@ -189,25 +230,36 @@ line_name = "骞惰仈鏇茬嚎"; calc_bol = helper.CalculateParallel(out calc_pt_qh_list, out calc_pt_qe_list, out calc_pt_qp_list); - if (!calc_bol || calc_pt_qh_list.Count < 3) + if (!calc_bol || calc_pt_qh_list.Count < 4) { return default; } + double total_flow = list.Sum(x => x.CalcuQ ?? 0); + double total_head = list.Average(x => x.CalcuH ?? 0); + + var qh = new Yw.Geometry.CubicSpline2d(calc_pt_qh_list); + var qe = new Yw.Geometry.CubicSpline2d(calc_pt_qe_list); + var qp = new Yw.Geometry.CubicSpline2d(calc_pt_qp_list); + var vm_sp = new Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel(); vm_sp.Id = _parallel_id; vm_sp.Name = line_name; - vm_sp.Qh = new Yw.Geometry.CubicSpline2d(calc_pt_qh_list); - vm_sp.Qe = new Yw.Geometry.CubicSpline2d(calc_pt_qe_list); - vm_sp.Qp = new Yw.Geometry.CubicSpline2d(calc_pt_qp_list); - vm_sp.QhCalc = vm_sp.Qh; - vm_sp.QeCalc = vm_sp.Qe; - vm_sp.QpCalc = vm_sp.Qp; + vm_sp.Qh = qh; + vm_sp.Qe = qe; + vm_sp.Qp = qp; + + vm_sp.QhCalc = qh; + vm_sp.QeCalc = qe; + vm_sp.QpCalc = qp; + + vm_sp.CalcuH = total_head; + vm_sp.CalcuQ = total_flow ; + + vm_sp.Color = Color.Black; vm_sp.IsBp = true; - vm_sp.IsDefault = true; - - var pt_list = vm_sp.Qp.GetPointList(12); + vm_sp.IsDefault = true; return vm_sp; } @@ -229,9 +281,9 @@ total_flow = Math.Round(total_flow, 1); total_head = Math.Round(total_head, 1); this.pumpParallelInfoCtrl1.SetDesignPoint(total_flow, total_head); - this.pumpSerialParallelChart.CalcWorkPointByQ(total_flow); + this.pumpSerialParallelChart.CalcWorkPointByQ(total_flow); } - + } -- Gitblit v1.9.3