| | |
| | | using DevExpress.XtraEditors; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using Yw.Geometry; |
| | | using System.Data; |
| | | using Yw.Pump; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI.Phart; |
| | |
| | | vm.Id = _pumpInfo.Code; |
| | | vm.Name = _pumpInfo.Name; |
| | | vm.CurveName = $"额定曲线({_pumpInfo.RatedHz}hz)"; |
| | | vm.RatedQ = _pumpInfo.RatedQ ?? 0; |
| | | vm.RatedH = _pumpInfo.RatedH ?? 0; |
| | | vm.RatedQ = _pumpInfo.RatedQ; |
| | | vm.RatedH = _pumpInfo.RatedH; |
| | | vm.RatedP = _pumpInfo.RatedP; |
| | | vm.RatedN = _pumpInfo.RatedN ?? 0; |
| | | vm.RatedN = _pumpInfo.RatedN; |
| | | vm.RatedHz = _pumpInfo.RatedHz; |
| | | vm.Color = Color.Black; |
| | | |
| | |
| | | var qh_pts = curveqh.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | if (qh_pts != null && qh_pts.Count > 3) |
| | | { |
| | | vm.CurveQH = new CubicSpline2d(qh_pts); |
| | | vm.CurveQH = qh_pts; |
| | | } |
| | | } |
| | | |
| | |
| | | var qp_pts = curveqp.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | if (qp_pts != null && qp_pts.Count > 3) |
| | | { |
| | | vm.CurveQP = new CubicSpline2d(qp_pts); |
| | | vm.CurveQP = qp_pts; |
| | | } |
| | | } |
| | | |
| | |
| | | var qepts = curveqe.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | if (qepts != null && qepts.Count > 3) |
| | | { |
| | | vm.CurveQE = new CubicSpline2d(qepts); |
| | | vm.CurveQE = qepts; |
| | | } |
| | | } |
| | | |
| | |
| | | vmItem.Name = "运行"; |
| | | vmItem.Hz = Math.Round(_pumpInfo.RatedHz * _pumpInfo.SpeedRatio, 1); |
| | | vmItem.Color = Color.Blue; |
| | | if (_pumpInfo.RatedN.HasValue) |
| | | { |
| | | vmItem.N = Math.Round(_pumpInfo.RatedN.Value * _pumpInfo.SpeedRatio, 1); |
| | | } |
| | | vmItem.N = Math.Round(_pumpInfo.RatedN * _pumpInfo.SpeedRatio, 1); |
| | | var calcuResult = _allCalcuResultVisualDict?.GetValue(_pumpInfo.Code) as HydroCalcuPumpResult; |
| | | if (calcuResult != null) |
| | | { |
| | |
| | | |
| | | if (vm.CurveQH != null) |
| | | { |
| | | var qh_pts = vm.CurveQH.GetPointList(20); |
| | | var qh_pts = vm.CurveQH; |
| | | var qh_run_pts = qh_pts.GetQHPointListByN(vm.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQH = new CubicSpline2d(qh_run_pts); |
| | | vmItem.CurveQH = qh_run_pts; |
| | | } |
| | | |
| | | if (vm.CurveQP != null) |
| | | { |
| | | var qp_pts = vm.CurveQP.GetPointList(20); |
| | | var qp_pts = vm.CurveQP; |
| | | var qp_run_pts = qp_pts.GetQPPointListByN(vm.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQP = new CubicSpline2d(qp_run_pts); |
| | | vmItem.CurveQP = qp_pts; |
| | | } |
| | | |
| | | if (vm.CurveQE != null) |
| | | { |
| | | var qe_pts = vm.CurveQE.GetPointList(20); |
| | | var qe_pts = vm.CurveQE; |
| | | var qe_run_pts = qe_pts.GetQEPointListByN(vm.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQE = new CubicSpline2d(qe_run_pts); |
| | | vmItem.CurveQE = qe_run_pts; |
| | | } |
| | | } |
| | | |
| | |
| | | vm.Id = _pumpInfo.Code; |
| | | vm.Name = _pumpInfo.Name; |
| | | vm.CurveName = $"额定曲线({_pumpInfo.RatedHz}hz)"; |
| | | vm.RatedQ = _pumpInfo.RatedQ ?? 0; |
| | | vm.RatedH = _pumpInfo.RatedH ?? 0; |
| | | vm.RatedQ = _pumpInfo.RatedQ; |
| | | vm.RatedH = _pumpInfo.RatedH; |
| | | vm.RatedP = _pumpInfo.RatedP; |
| | | vm.RatedN = _pumpInfo.RatedN ?? 0; |
| | | vm.RatedN = _pumpInfo.RatedN; |
| | | vm.RatedHz = _pumpInfo.RatedHz; |
| | | vm.Color = Color.Black; |
| | | |
| | |
| | | var qh_pts = curveqh.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | if (qh_pts != null && qh_pts.Count > 3) |
| | | { |
| | | vm.CurveQH = new CubicSpline2d(qh_pts); |
| | | vm.CurveQH = qh_pts; |
| | | } |
| | | } |
| | | |
| | |
| | | var qp_pts = curveqp.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | if (qp_pts != null && qp_pts.Count > 3) |
| | | { |
| | | vm.CurveQP = new CubicSpline2d(qp_pts); |
| | | vm.CurveQP = qp_pts; |
| | | } |
| | | } |
| | | |
| | | var curveqe = _hydroInfo.Curves?.Find(x => x.Code == _pumpInfo.CurveQE); |
| | | if (curveqe != null) |
| | | { |
| | | var qepts = curveqe.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | if (qepts != null && qepts.Count > 3) |
| | | var qe_pts = curveqe.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | if (qe_pts != null && qe_pts.Count > 3) |
| | | { |
| | | vm.CurveQE = new CubicSpline2d(qepts); |
| | | vm.CurveQE = qe_pts; |
| | | } |
| | | } |
| | | |
| | |
| | | vmItem.Name = working.Name; |
| | | vmItem.Hz = workingPumpInfo.CurrentHz; |
| | | vmItem.Color = HydroPumpCurveColorHelper.GetRandomColor(_allWorkingList.IndexOf(working)); |
| | | if (_pumpInfo.RatedN.HasValue) |
| | | if (_pumpInfo.RatedN > 0) |
| | | { |
| | | var speedRatio = workingPumpInfo.CurrentHz / _pumpInfo.RatedHz; |
| | | vmItem.N = Math.Round(_pumpInfo.RatedN.Value * speedRatio, 1); |
| | | vmItem.N = Math.Round(_pumpInfo.RatedN * speedRatio, 1); |
| | | } |
| | | vmItem.CurveName = $"{working.Name}({vmItem.Hz}hz)"; |
| | | if (_allWorkingCalcuResultDict == null) |
| | |
| | | |
| | | if (vm.CurveQH != null) |
| | | { |
| | | var qh_pts = vm.CurveQH.GetPointList(20); |
| | | var qh_pts = vm.CurveQH; |
| | | var qh_run_pts = qh_pts.GetQHPointListByN(vm.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQH = new CubicSpline2d(qh_run_pts); |
| | | vmItem.CurveQH = qh_run_pts; |
| | | } |
| | | |
| | | if (vm.CurveQP != null) |
| | | { |
| | | var qp_pts = vm.CurveQP.GetPointList(20); |
| | | var qp_pts = vm.CurveQP; |
| | | var qp_run_pts = qp_pts.GetQPPointListByN(vm.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQP = new CubicSpline2d(qp_run_pts); |
| | | vmItem.CurveQP = qp_run_pts; |
| | | } |
| | | |
| | | if (vm.CurveQE != null) |
| | | { |
| | | var qe_pts = vm.CurveQE.GetPointList(20); |
| | | var qe_pts = vm.CurveQE; |
| | | var qe_run_pts = qe_pts.GetQEPointListByN(vm.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQE = new CubicSpline2d(qe_run_pts); |
| | | vmItem.CurveQE = qe_run_pts; |
| | | } |
| | | } |
| | | } |