| | |
| | | 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.WinFrmUI.Phart; |
| | | |
| | |
| | | var vm = new PumpOperationViewModel(); |
| | | vm.Id = state.Code; |
| | | vm.Name = state.Name; |
| | | vm.RatedQ = state.Vmo.RatedQ.HasValue ? state.Vmo.RatedQ.Value : 0; |
| | | vm.RatedH = state.Vmo.RatedH.HasValue ? state.Vmo.RatedH.Value : 0; |
| | | vm.RatedQ = state.Vmo.RatedQ; |
| | | vm.RatedH = state.Vmo.RatedH; |
| | | vm.RatedP = state.Vmo.RatedP; |
| | | vm.RatedN = state.Vmo.RatedN.HasValue ? state.Vmo.RatedN.Value : 0; |
| | | vm.RatedN = state.Vmo.RatedN; |
| | | vm.RatedHz = state.Vmo.RatedHz; |
| | | vm.CurrentHz = state.CurrentHz; |
| | | vm.CurrentN = Math.Round(state.CurrentHz / state.Vmo.RatedHz * vm.RatedN, 1); |
| | |
| | | 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 qh_current_pts = qh_pts.GetQHPointListByN(state.Vmo.RatedHz, state.CurrentHz); |
| | | vm.CurrentCurveQH = new CubicSpline2d(qh_current_pts); |
| | | vm.CurrentCurveQH = qh_current_pts; |
| | | } |
| | | } |
| | | |
| | | var curveqp = state.HydroInfo.Curves?.Find(x => x.Code == state.Vmo.CurveQP); |
| | | if (curveqp != null) |
| | | { |
| | | var qppts = curveqp.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | if (qppts != null && qppts.Count > 3) |
| | | 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(qppts); |
| | | var sqppts = qppts.GetQHPointListByN(state.Vmo.RatedHz, state.CurrentHz); |
| | | vm.CurrentCurveQP = new CubicSpline2d(sqppts); |
| | | vm.CurveQP = qp_pts; |
| | | var qp_current_pts = qp_pts.GetQPPointListByN(state.Vmo.RatedHz, state.CurrentHz); |
| | | vm.CurrentCurveQP = qp_current_pts; |
| | | } |
| | | } |
| | | |
| | | var curveqe = state.HydroInfo.Curves?.Find(x => x.Code == state.Vmo.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); |
| | | var sqepts = qepts.GetQHPointListByN(state.Vmo.RatedHz, state.CurrentHz); |
| | | vm.CurrentCurveQE = new CubicSpline2d(sqepts); |
| | | vm.CurveQE = qe_pts; |
| | | var qe_current_pts = qe_pts.GetQEPointListByN(state.Vmo.RatedHz, state.CurrentHz); |
| | | vm.CurrentCurveQE = qe_current_pts; |
| | | } |
| | | } |
| | | |