From 2d0e557f3a406e7c144677f04ec6fce5e5590a15 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期二, 19 十一月 2024 16:44:07 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/01-calculate/PumpCalcHelper.cs | 270 +++++++++++++++++++++++++++--------------------------- 1 files changed, 135 insertions(+), 135 deletions(-) diff --git a/WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/01-calculate/PumpCalcHelper.cs b/WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/01-calculate/PumpCalcHelper.cs index 022e110..25c961e 100644 --- a/WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/01-calculate/PumpCalcHelper.cs +++ b/WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/01-calculate/PumpCalcHelper.cs @@ -984,43 +984,43 @@ /// <summary> /// 璁$畻鍔熺巼 /// </summary> - /// <param name="pt_qh_list">娴侀噺鎵▼鐐�</param> - /// <param name="pt_qe_list">娴侀噺鏁堢巼鐐�</param> + /// <param name="qh_pt_list">娴侀噺鎵▼鐐�</param> + /// <param name="qe_pt_list">娴侀噺鏁堢巼鐐�</param> /// <returns>娴侀噺鍔熺巼鐐�</returns> - public static List<Yw.Geometry.Point2d> CalculateP(List<Yw.Geometry.Point2d> pt_qh_list, List<Yw.Geometry.Point2d> pt_qe_list) + public static List<Yw.Geometry.Point2d> CalculateP(List<Yw.Geometry.Point2d> qh_pt_list, List<Yw.Geometry.Point2d> qe_pt_list) { - if (pt_qh_list == null || pt_qh_list.Count() <= 2) + if (qh_pt_list == null || qh_pt_list.Count() <= 2) return null; - bool is_x_start_0 = pt_qh_list.First().X > 500 || pt_qh_list.First().X > pt_qh_list.Last().X * 0.2; - return CalculateP(pt_qh_list, pt_qe_list, Constant.WaterDensity, -1, is_x_start_0); + bool is_x_start_0 = qh_pt_list.First().X > 500 || qh_pt_list.First().X > qh_pt_list.Last().X * 0.2; + return CalculateP(qh_pt_list, qe_pt_list, Constant.WaterDensity, -1, is_x_start_0); } /// <summary> /// 璁$畻鍔熺巼 /// </summary> - /// <param name="pt_qh_list">娴侀噺鎵▼鐐�</param> - /// <param name="pt_qe_list">娴侀噺鏁堢巼鐐�</param> + /// <param name="qh_pt_list">娴侀噺鎵▼鐐�</param> + /// <param name="qe_pt_list">娴侀噺鏁堢巼鐐�</param> /// <param name="midu">姘寸殑瀵嗗害</param> /// <param name="zeroPower">娴侀噺涓�0鏃剁殑鍔熺巼</param> /// <param name="is_x_start_0">娴侀噺鏄惁涓�0</param> /// <returns></returns> public static List<Yw.Geometry.Point2d> CalculateP( - List<Yw.Geometry.Point2d> pt_qh_list, - List<Yw.Geometry.Point2d> pt_qe_list, + List<Yw.Geometry.Point2d> qh_pt_list, + List<Yw.Geometry.Point2d> qe_pt_list, double midu, double zeroPower, bool is_x_start_0) { - if (pt_qh_list == null || pt_qh_list.Count < 3) + if (qh_pt_list == null || qh_pt_list.Count < 3) return null; - if (pt_qe_list == null || pt_qe_list.Count < 3) + if (qe_pt_list == null || qe_pt_list.Count < 3) return null; - var curve_qh = new Yw.Geometry.CubicSpline2d(pt_qh_list); - var curve_qe = new Yw.Geometry.CubicSpline2d(pt_qe_list); + var curve_qh = new Yw.Geometry.CubicSpline2d(qh_pt_list); + var curve_qe = new Yw.Geometry.CubicSpline2d(qe_pt_list); - var cubic_spline_qp = CalculateP(curve_qh, curve_qe, midu, zeroPower, is_x_start_0); - return cubic_spline_qp.GetPointList(pt_qe_list.Count()); + var qp = CalculateP(curve_qh, curve_qe, midu, zeroPower, is_x_start_0); + return qp.GetPointList(qe_pt_list.Count()); } /// <summary> @@ -1038,17 +1038,17 @@ if (curve_qh == null || curve_qe == null) return null; int point_count = 16;//鐐逛笉鑳藉お澶� - var pt_qh_list = curve_qh.GetPointList(point_count); - if (pt_qh_list == null || pt_qh_list.Count < 3) + var qh_pt_list = curve_qh.GetPointList(point_count); + if (qh_pt_list == null || qh_pt_list.Count < 3) return null; - var pt_qe_list = curve_qe.GetPointList(point_count); - if (pt_qe_list == null || pt_qe_list.Count < 3) + var qe_pt_list = curve_qe.GetPointList(point_count); + if (qe_pt_list == null || qe_pt_list.Count < 3) return null; - List<Yw.Geometry.Point2d> pt_qp_list = new List<Yw.Geometry.Point2d>(); + List<Yw.Geometry.Point2d> qp_pt_list = new List<Yw.Geometry.Point2d>(); //闂磋窛 - double minQ = Math.Max(pt_qh_list.First().X, pt_qe_list.First().X); - double maxQ = Math.Min(pt_qh_list.Last().X, pt_qe_list.Last().X); + double minQ = Math.Max(qh_pt_list.First().X, qe_pt_list.First().X); + double maxQ = Math.Min(qh_pt_list.Last().X, qe_pt_list.Last().X); // double Q, H, E, P; @@ -1059,7 +1059,7 @@ { for (int i = 5; i < point_count; i++)//鍓嶉潰鍑犱釜鐐逛笉瑕� { - Q = pt_qe_list.First().X + space * i; + Q = qe_pt_list.First().X + space * i; E = curve_qe.GetPointY(Q); H = curve_qh.GetPointY(Q); if (H < 0.1 || E < 0.5) @@ -1082,28 +1082,28 @@ { P = Math.Round(P, 0); } - pt_qp_list.Add(new Yw.Geometry.Point2d(Q, P)); + qp_pt_list.Add(new Yw.Geometry.Point2d(Q, P)); } - pt_qp_list = pt_qp_list.GetFitPointList(point_count); - if (pt_qp_list == null) + qp_pt_list = qp_pt_list.GetFitPointList(point_count); + if (qp_pt_list == null) return null; if (zeroPower > 0.1) { - pt_qp_list.Insert(0, new Yw.Geometry.Point2d(0, zeroPower)); + qp_pt_list.Insert(0, new Yw.Geometry.Point2d(0, zeroPower)); } else { - if (pt_qp_list[0].Y >= pt_qp_list[1].Y) + if (qp_pt_list[0].Y >= qp_pt_list[1].Y) { - pt_qp_list[0].Y = pt_qp_list[1].Y * 0.95; + qp_pt_list[0].Y = qp_pt_list[1].Y * 0.95; } - double startP = Yw.Geometry.LineHelper.GetYbyX(pt_qp_list[0].X, pt_qp_list[0].Y, pt_qp_list[1].X, pt_qp_list[1].Y, 0); + double startP = Yw.Geometry.LineHelper.GetYbyX(qp_pt_list[0].X, qp_pt_list[0].Y, qp_pt_list[1].X, qp_pt_list[1].Y, 0); if (startP < 0.001) - startP = pt_qp_list[0].Y; + startP = qp_pt_list[0].Y; if (startP < 2) { @@ -1122,17 +1122,17 @@ startP = Math.Round(startP, 0); } - pt_qp_list.Insert(0, new Yw.Geometry.Point2d(0, startP)); + qp_pt_list.Insert(0, new Yw.Geometry.Point2d(0, startP)); } - return new Yw.Geometry.CubicSpline2d(pt_qp_list); + return new Yw.Geometry.CubicSpline2d(qp_pt_list); } else { for (int i = 0; i < point_count; i++)//鍓嶉潰鍑犱釜鐐逛笉瑕� { - Q = pt_qe_list.First().X + space * i; + Q = qe_pt_list.First().X + space * i; E = curve_qe.GetPointY(Q); H = curve_qh.GetPointY(Q); if (H < 0.1 || E < 0.5) @@ -1155,14 +1155,14 @@ { P = Math.Round(P, 0); } - pt_qp_list.Add(new Yw.Geometry.Point2d(Q, P)); + qp_pt_list.Add(new Yw.Geometry.Point2d(Q, P)); } - pt_qp_list = pt_qp_list.GetFitPointList(point_count); - if (pt_qp_list == null) + qp_pt_list = qp_pt_list.GetFitPointList(point_count); + if (qp_pt_list == null) return null; - return new Yw.Geometry.CubicSpline2d(pt_qp_list); + return new Yw.Geometry.CubicSpline2d(qp_pt_list); } } @@ -1171,23 +1171,23 @@ #region 璁$畻鏁堢巼 - public static Yw.Geometry.CubicSpline2d CalculateE(Yw.Geometry.CubicSpline2d cubic_spline_qh, Yw.Geometry.CubicSpline2d cubic_spline_qp) + public static Yw.Geometry.CubicSpline2d CalculateE(Yw.Geometry.CubicSpline2d qh, Yw.Geometry.CubicSpline2d qp) { - return CalculateE(cubic_spline_qh, cubic_spline_qp, Constant.WaterDensity); + return CalculateE(qh, qp, Constant.WaterDensity); } - public static Yw.Geometry.CubicSpline2d CalculateE(Yw.Geometry.CubicSpline2d cubic_spline_qh, Yw.Geometry.CubicSpline2d cubic_spline_qp, bool is_x_start_0) + public static Yw.Geometry.CubicSpline2d CalculateE(Yw.Geometry.CubicSpline2d qh, Yw.Geometry.CubicSpline2d qp, bool is_x_start_0) { - return CalculateE(cubic_spline_qh, cubic_spline_qp, Constant.WaterDensity, is_x_start_0); + return CalculateE(qh, qp, Constant.WaterDensity, is_x_start_0); } - public static Yw.Geometry.CubicSpline2d CalculateE(Yw.Geometry.CubicSpline2d cubic_spline_qh, Yw.Geometry.CubicSpline2d cubic_spline_qp, double midu) + public static Yw.Geometry.CubicSpline2d CalculateE(Yw.Geometry.CubicSpline2d qh, Yw.Geometry.CubicSpline2d qp, double midu) { - if (cubic_spline_qh == null) + if (qh == null) return null; bool is_x_start_0 = true; - if (cubic_spline_qh.MinX > 500 || cubic_spline_qh.MinX > cubic_spline_qh.MaxX * 0.1) + if (qh.MinX > 500 || qh.MinX > qh.MaxX * 0.1) { is_x_start_0 = false; } @@ -1196,73 +1196,73 @@ is_x_start_0 = true; } - return CalculateE(cubic_spline_qh, cubic_spline_qp, midu, is_x_start_0); + return CalculateE(qh, qp, midu, is_x_start_0); } - public static Yw.Geometry.CubicSpline2d CalculateE(Yw.Geometry.CubicSpline2d cubic_spline_qh, Yw.Geometry.CubicSpline2d cubic_spline_qp, double midu, bool is_x_start_0) + public static Yw.Geometry.CubicSpline2d CalculateE(Yw.Geometry.CubicSpline2d qh, Yw.Geometry.CubicSpline2d qp, double midu, bool is_x_start_0) { - if (cubic_spline_qh == null) + if (qh == null) return null; - if (cubic_spline_qp == null) + if (qp == null) return null; int point_count = 12; - List<Yw.Geometry.Point2d> pt_qe_list = new List<Yw.Geometry.Point2d>(); - List<Yw.Geometry.Point2d> pt_qp_list = cubic_spline_qp.GetPointList(point_count); + List<Yw.Geometry.Point2d> qe_pt_list = new List<Yw.Geometry.Point2d>(); + List<Yw.Geometry.Point2d> qp_pt_list = qp.GetPointList(point_count); double Q, H, Eff, Power; - var fitCurve = new Yw.Geometry.CubicSpline2d(cubic_spline_qh); - for (int i = 0; i < pt_qp_list.Count; i++) + var fitCurve = new Yw.Geometry.CubicSpline2d(qh); + for (int i = 0; i < qp_pt_list.Count; i++) { - Q = pt_qp_list[i].X; - Power = pt_qp_list[i].Y; + Q = qp_pt_list[i].X; + Power = qp_pt_list[i].Y; H = fitCurve.GetPointY(Q); Eff = CalculateE(Q, H, Power, midu); - pt_qe_list.Add(new Yw.Geometry.Point2d(Q, Eff)); + qe_pt_list.Add(new Yw.Geometry.Point2d(Q, Eff)); } //淇濊瘉Q=0鏃�,Eff=0; if (is_x_start_0) { - pt_qe_list[0] = new Yw.Geometry.Point2d(0, 0); - pt_qe_list = pt_qe_list.GetFitPointList(); - pt_qe_list = pt_qe_list.AmendByZeroPointY(pt_qe_list[3].X, 0); - return new Yw.Geometry.CubicSpline2d(pt_qe_list); + qe_pt_list[0] = new Yw.Geometry.Point2d(0, 0); + qe_pt_list = qe_pt_list.GetFitPointList(); + qe_pt_list = qe_pt_list.AmendByZeroPointY(qe_pt_list[3].X, 0); + return new Yw.Geometry.CubicSpline2d(qe_pt_list); } else { - return new Yw.Geometry.CubicSpline2d(pt_qe_list); + return new Yw.Geometry.CubicSpline2d(qe_pt_list); } } public static List<Yw.Geometry.Point2d> CalculateEpoint( - Yw.Geometry.CubicSpline2d cubic_spline_qh, - Yw.Geometry.CubicSpline2d cubic_spline_qp, + Yw.Geometry.CubicSpline2d qh, + Yw.Geometry.CubicSpline2d qp, int point_count, double midu) { - if (cubic_spline_qh == null) + if (qh == null) return null; - if (cubic_spline_qp == null) + if (qp == null) return null; - List<Yw.Geometry.Point2d> pt_qe_list = new List<Yw.Geometry.Point2d>(); - List<Yw.Geometry.Point2d> pt_qp_list = cubic_spline_qp.GetPointList(point_count); + List<Yw.Geometry.Point2d> qe_pt_list = new List<Yw.Geometry.Point2d>(); + List<Yw.Geometry.Point2d> qp_pt_list = qp.GetPointList(point_count); double Q, H, Eff, Power; - var fitCurve = cubic_spline_qh.Copy(); - for (int i = 0; i < pt_qp_list.Count; i++) + var fitCurve = qh.Copy(); + for (int i = 0; i < qp_pt_list.Count; i++) { - Q = pt_qp_list[i].X; - Power = pt_qp_list[i].Y; + Q = qp_pt_list[i].X; + Power = qp_pt_list[i].Y; H = fitCurve.GetPointY(Q); Eff = CalculateE(Q, H, Power, midu); - pt_qe_list.Add(new Yw.Geometry.Point2d(Q, Eff)); + qe_pt_list.Add(new Yw.Geometry.Point2d(Q, Eff)); } bool is_x_start_0 = true; - if (pt_qe_list.First().X > 500 || pt_qe_list.First().X > pt_qe_list.Last().X * 0.1) + if (qe_pt_list.First().X > 500 || qe_pt_list.First().X > qe_pt_list.Last().X * 0.1) { is_x_start_0 = false; } @@ -1274,73 +1274,73 @@ //淇濊瘉Q=0鏃�,Eff=0; if (is_x_start_0) { - pt_qe_list[0] = new Yw.Geometry.Point2d(0, 0); - pt_qe_list = pt_qe_list.GetFitPointList(); - return pt_qe_list.AmendByZeroPointY(pt_qe_list[3].X, 0); + qe_pt_list[0] = new Yw.Geometry.Point2d(0, 0); + qe_pt_list = qe_pt_list.GetFitPointList(); + return qe_pt_list.AmendByZeroPointY(qe_pt_list[3].X, 0); } else { - return pt_qe_list.GetFitPointList(); + return qe_pt_list.GetFitPointList(); } } /// <summary> /// 娉ㄦ剰姝ゆ柟娉� 杩斿洖鐨勭偣娌℃湁鎷熷悎 /// </summary> - /// <param name="pt_qh_list"></param> - /// <param name="pt_qp_list"></param> + /// <param name="qh_pt_list"></param> + /// <param name="qp_pt_list"></param> /// <param name="midu"></param> /// <param name="is_x_start_0"></param> /// <returns></returns> public static List<Yw.Geometry.Point2d> CalculateE_AlignPointP( - List<Yw.Geometry.Point2d> pt_qh_list, - List<Yw.Geometry.Point2d> pt_qp_list, + List<Yw.Geometry.Point2d> qh_pt_list, + List<Yw.Geometry.Point2d> qp_pt_list, double midu, bool is_x_start_0) { - if (pt_qh_list == null || pt_qh_list.Count < 3) + if (qh_pt_list == null || qh_pt_list.Count < 3) return null; - if (pt_qp_list == null || pt_qp_list.Count < 3) + if (qp_pt_list == null || qp_pt_list.Count < 3) return null; - List<Yw.Geometry.Point2d> pt_qe_list = new List<Yw.Geometry.Point2d>(); + List<Yw.Geometry.Point2d> qe_pt_list = new List<Yw.Geometry.Point2d>(); - if (pt_qh_list.IsEqualValueX(pt_qp_list)) + if (qh_pt_list.IsEqualValueX(qp_pt_list)) { //x閮戒竴鑷� - for (int i = 0; i < pt_qp_list.Count; i++) + for (int i = 0; i < qp_pt_list.Count; i++) { double Q, H, Eff, Power; - Q = pt_qp_list[i].X; - Power = pt_qp_list[i].Y; - H = pt_qh_list[i].Y; + Q = qp_pt_list[i].X; + Power = qp_pt_list[i].Y; + H = qh_pt_list[i].Y; Eff = CalculateE(Q, H, Power, midu); - pt_qe_list.Add(new Yw.Geometry.Point2d(Q, Eff)); + qe_pt_list.Add(new Yw.Geometry.Point2d(Q, Eff)); } } else { - var fitCurve_QP = new Yw.Geometry.CubicSpline2d(pt_qp_list); - var fitCurve_QH = new Yw.Geometry.CubicSpline2d(pt_qh_list); - for (int i = 0; i < pt_qp_list.Count; i++) + var fitCurve_QP = new Yw.Geometry.CubicSpline2d(qp_pt_list); + var fitCurve_QH = new Yw.Geometry.CubicSpline2d(qh_pt_list); + for (int i = 0; i < qp_pt_list.Count; i++) { double Q, H, Eff, Power; - Q = pt_qp_list[i].X; + Q = qp_pt_list[i].X; Power = fitCurve_QP.GetPointY(Q); H = fitCurve_QH.GetPointY(Q); Eff = CalculateE(Q, H, Power, midu); - pt_qe_list.Add(new Yw.Geometry.Point2d(Q, Eff)); + qe_pt_list.Add(new Yw.Geometry.Point2d(Q, Eff)); } } - //pt_qe_list = FitHelper.GetPointListByExtend(pt_qe_list); + //qe_pt_list = FitHelper.GetPointListByExtend(qe_pt_list); //淇濊瘉Q=0鏃�,Eff=0; if (is_x_start_0) { - pt_qe_list[0] = new Yw.Geometry.Point2d(0, 0); + qe_pt_list[0] = new Yw.Geometry.Point2d(0, 0); } - return pt_qe_list; + return qe_pt_list; } #endregion @@ -1351,39 +1351,39 @@ /// <summary> /// 璁$畻鏁堢巼 瀵瑰叾鍔熺巼 /// </summary> - public static List<Yw.Geometry.Point2d> CalculateELineByP(List<Yw.Geometry.Point2d> pt_qh_list, List<Yw.Geometry.Point2d> pt_qp_list, bool is_x_start_0) + public static List<Yw.Geometry.Point2d> CalculateELineByP(List<Yw.Geometry.Point2d> qh_pt_list, List<Yw.Geometry.Point2d> qp_pt_list, bool is_x_start_0) { - if (pt_qh_list == null || pt_qh_list.Count < 3) + if (qh_pt_list == null || qh_pt_list.Count < 3) { return null; } - if (pt_qp_list == null || pt_qp_list.Count < 3) + if (qp_pt_list == null || qp_pt_list.Count < 3) { return null; } List<Yw.Geometry.Point2d> list = new List<Yw.Geometry.Point2d>(); - if (pt_qh_list.IsEqualValueX(pt_qp_list)) + if (qh_pt_list.IsEqualValueX(qp_pt_list)) { - for (int i = 0; i < pt_qp_list.Count; i++) + for (int i = 0; i < qp_pt_list.Count; i++) { - double x = pt_qp_list[i].X; - double y = pt_qp_list[i].Y; - double y2 = pt_qh_list[i].Y; + double x = qp_pt_list[i].X; + double y = qp_pt_list[i].Y; + double y2 = qh_pt_list[i].Y; double y3 = CalculateE(x, y2, y, Constant.WaterDensity); list.Add(new Yw.Geometry.Point2d(x, y3)); } } else { - var cubic_spline_qp = new Yw.Geometry.CubicSpline2d(pt_qp_list); - var cubic_spline_qh = new Yw.Geometry.CubicSpline2d(pt_qh_list); - for (int j = 0; j < pt_qp_list.Count; j++) + var qp = new Yw.Geometry.CubicSpline2d(qp_pt_list); + var qh = new Yw.Geometry.CubicSpline2d(qh_pt_list); + for (int j = 0; j < qp_pt_list.Count; j++) { - double x2 = pt_qp_list[j].X; - double fit_pointY = cubic_spline_qp.GetPointY(x2); - double fit_pointY2 = cubic_spline_qh.GetPointY(x2); + double x2 = qp_pt_list[j].X; + double fit_pointY = qp.GetPointY(x2); + double fit_pointY2 = qh.GetPointY(x2); double y4 = CalculateE(x2, fit_pointY2, fit_pointY, Constant.WaterDensity); list.Add(new Yw.Geometry.Point2d(x2, y4)); } @@ -1401,26 +1401,26 @@ /// <summary> /// 璁$畻鏁堢巼 瀵瑰叾鏁堢巼 /// </summary> - public static List<Yw.Geometry.Point2d> CalculateP_AlignPointE(List<Yw.Geometry.Point2d> pt_qh_list, List<Yw.Geometry.Point2d> pt_qe_list, double midu, double ref_zero_power, bool is_x_start_0) + public static List<Yw.Geometry.Point2d> CalculateP_AlignPointE(List<Yw.Geometry.Point2d> qh_pt_list, List<Yw.Geometry.Point2d> qe_pt_list, double midu, double ref_zero_power, bool is_x_start_0) { - if (pt_qh_list == null || pt_qh_list.Count < 3) + if (qh_pt_list == null || qh_pt_list.Count < 3) { return null; } - if (pt_qe_list == null || pt_qe_list.Count < 3) + if (qe_pt_list == null || qe_pt_list.Count < 3) { return null; } List<Yw.Geometry.Point2d> list = new List<Yw.Geometry.Point2d>(); - if (pt_qh_list.IsEqualValueX(pt_qe_list)) + if (qh_pt_list.IsEqualValueX(qe_pt_list)) { - for (int i = 0; i < pt_qe_list.Count(); i++) + for (int i = 0; i < qe_pt_list.Count(); i++) { - double x = pt_qe_list[i].X; - double y = pt_qe_list[i].Y; - double y2 = pt_qh_list[i].Y; + double x = qe_pt_list[i].X; + double y = qe_pt_list[i].Y; + double y2 = qh_pt_list[i].Y; if (!(y2 < 0.1) && !(y < 0.5)) { double num = CalculateP(x, y2, y, midu); @@ -1431,13 +1431,13 @@ } else { - var cubic_spline_qe = new Yw.Geometry.CubicSpline2d(pt_qe_list); - var cubic_spline_qh = new Yw.Geometry.CubicSpline2d(pt_qh_list); - for (int j = 0; j < pt_qe_list.Count(); j++) + var qe = new Yw.Geometry.CubicSpline2d(qe_pt_list); + var qh = new Yw.Geometry.CubicSpline2d(qh_pt_list); + for (int j = 0; j < qe_pt_list.Count(); j++) { - double x2 = pt_qe_list[j].X; - double fit_pointY = cubic_spline_qe.GetPointY(x2); - double fit_pointY2 = cubic_spline_qh.GetPointY(x2); + double x2 = qe_pt_list[j].X; + double fit_pointY = qe.GetPointY(x2); + double fit_pointY2 = qh.GetPointY(x2); if (!(fit_pointY2 < 0.09) && !(fit_pointY < 0.5)) { double num2 = CalculateP(x2, fit_pointY2, fit_pointY, midu); @@ -1539,8 +1539,8 @@ { var sect_pt = new Yw.Geometry.Point2d(0, 0); if (cubic_spline == null) - return sect_pt; - var pt_list = cubic_spline.GetPointListByXRatioRange(1,1.2, 50); + return sect_pt; + var pt_list = cubic_spline.GetPointListByXRatioRange(1, 1.2, 50); return GetSectPointParabola(pt_list, simular_pt); } @@ -1563,7 +1563,7 @@ double x; for (int i = 0; i < CurvePoints.Count - 1; i++) { - LineHelper.GetKandB(CurvePoints[i], CurvePoints[i + 1], out b, out c); + LineHelper.GetKandB(CurvePoints[i], CurvePoints[i + 1], out b, out c); /*瑙f柟绋� * y=ax @@ -1571,7 +1571,7 @@ */ if (Math.Abs(a - b) < 0.001) continue; - + x = c / (a - b); if (UtilsHelper.IsMiddle(CurvePoints[i].X, CurvePoints[i + 1].X, x)) { @@ -1590,7 +1590,7 @@ { return ParabolaCurveHelper.GetSectPoint(pt_list, simular_pt, 0); } - + public static Yw.Geometry.Point2d GetSectPointLine(this Yw.Geometry.CubicSpline2d cubic_spline, Yw.Geometry.Point2d simular_pt) { Yw.Geometry.Point2d sect_pt = new Yw.Geometry.Point2d(0, 0); @@ -1637,11 +1637,11 @@ x = x + space; y = 0; var y_pt_list = pt_list.GetInterPointsY(x); - if (y_pt_list==null|| !y_pt_list.Any()) + if (y_pt_list == null || !y_pt_list.Any()) { break; } - y = y_pt_list.Last(); + y = y_pt_list.Last(); k = y / Math.Pow(x, index); } while (k > fixK); @@ -1650,7 +1650,7 @@ return sect_pt; } - + //ratioIgnore:浣滅敤 褰搒imular_pt瓒呭嚭鑼冨洿鏃�,鎵╁ぇ鐨勫�嶆暟 public static Yw.Geometry.Point2d GetSectPointGeneral(this Yw.Geometry.CubicSpline2d cubic_spline, Yw.Geometry.Point2d simular_pt, double index, double ratioIgnore) { -- Gitblit v1.9.3