Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0
| | |
| | | { |
| | | InitData(pump_mian_id, null); |
| | | } |
| | | |
| | | } |
| | | |
| | | private Yw.Geometry.CubicSpline2d _qh, _qe, _qp; |
| | | private Yw.Geometry.Point2d _work_pt; |
| | | private double _rated_speed; |
| | | private double _rated_speed=50; |
| | | |
| | | private async void InitData(long pump_main_id, Yw.Geometry.Point2d work_pt) |
| | | { |
| | |
| | | var qe = new Yw.Geometry.CubicSpline2d(points_qe); |
| | | var qp = new Yw.Geometry.CubicSpline2d(points_qp); |
| | | |
| | | InitChart(qh, qe, qp, work_pt, pump_main.RatedSpeed); |
| | | InitChart(qh, qe, qp, work_pt, pump_main.RatedSpeed, pump_main.RatedSpeed, 50); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="qh">流量扬程线</param> |
| | | /// <param name="qe">流量效率线</param> |
| | | /// <param name="qp">流量功率线</param> |
| | | /// <param name="work_pt">工作点</param> |
| | | /// <param name="rated_spped">额定转速</param> |
| | | /// <param name="current_speed">当前转速</param> |
| | | /// <param name="current_hz">当前频率</param> |
| | | public void InitChart( |
| | | Yw.Geometry.CubicSpline2d qh, |
| | | Yw.Geometry.CubicSpline2d qe, |
| | | Yw.Geometry.CubicSpline2d qp, |
| | | Yw.Geometry.Point2d work_pt, |
| | | double rated_speed) |
| | | double rated_spped, |
| | | double current_speed, |
| | | double current_hz) |
| | | { |
| | | _qh = qh; |
| | | _qe = qe; |
| | | _qp = qp; |
| | | _work_pt = work_pt; |
| | | _rated_speed = rated_speed; |
| | | _rated_speed = rated_spped; |
| | | |
| | | this.pumpPerformCompareChart1.SetBindingData(_qh, _qe, _qp); |
| | | if (work_pt != null) |
| | | { |
| | | var calc_speed = PumpCalcHelper.GetSimuValue(qh, work_pt, rated_speed); |
| | | var calc_hz = calc_speed / rated_speed * 50; |
| | | var calc_hz = PumpCalcHelper.GetSimuValue(qh, work_pt, _rated_speed); |
| | | calc_hz = Math.Round(calc_hz, 1); |
| | | this.pumpPerformCompareInfoCtrl1.SetDesignPoint(work_pt, calc_hz); |
| | | } |
| | | |
| | | var vm_vs = new Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel(); |
| | | vm_vs.Id = Guid.NewGuid().ToString(); |
| | | vm_vs.Name = rated_speed.ToString(); |
| | | vm_vs.RatedSpeed = rated_speed; |
| | | vm_vs.CurrentSpeed = rated_speed; |
| | | vm_vs.CurrentHz = 50; |
| | | vm_vs.Name = current_hz.ToString(); |
| | | vm_vs.RatedSpeed = _rated_speed; |
| | | vm_vs.CurrentSpeed = current_speed; |
| | | vm_vs.CurrentHz = current_hz; |
| | | vm_vs.Qh = _qh; |
| | | vm_vs.Qe = _qe; |
| | | vm_vs.Qp = _qp; |
| | |
| | | } |
| | | _axisYQE.SetAxisRange(_coordinate_paras.CoordMinE, _coordinate_paras.CoordMinE + _coordinate_paras.GridNumberY * _coordinate_paras.CoordSpaceE); |
| | | _axisYQP.SetAxisRange(_coordinate_paras.CoordMinP, _coordinate_paras.CoordMinP + _coordinate_paras.GridNumberY * _coordinate_paras.CoordSpaceP); |
| | | |
| | | |
| | | //_axisYQE.SetAxisRange(_coordinate_paras.CoordMinE-_coordinate_paras.CoordMinP, _coordinate_paras.CoordMinE + _coordinate_paras.GridNumberY * _coordinate_paras.CoordSpaceE); |
| | | //_axisYQP.SetAxisRange(_coordinate_paras.DispMinP(), _coordinate_paras.CoordMinP + _coordinate_paras.GridNumberY * _coordinate_paras.CoordSpaceP); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | _qh_pt_list = points; |
| | | foreach (Yw.Geometry.Point2d pt in _qh_pt_list) |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(pt.X, pt.Y)); |
| | | { |
| | | var x = Math.Round(pt.X, 2); |
| | | var y = Math.Round(pt.Y, 2); |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(x, y)); |
| | | } |
| | | } |
| | | break; |
| | | case Yw.Pump.eCurveType.QE: |
| | | { |
| | | _qe_pt_list = points; |
| | | foreach (Yw.Geometry.Point2d pt in _qe_pt_list) |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(pt.X, pt.Y)); |
| | | { |
| | | var x = Math.Round(pt.X, 2); |
| | | var y = Math.Round(pt.Y, 2); |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(x, y)); |
| | | } |
| | | } |
| | | break; |
| | | case Yw.Pump.eCurveType.QP: |
| | | { |
| | | _qp_pt_list = points; |
| | | foreach (Yw.Geometry.Point2d pt in _qp_pt_list) |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(pt.X, pt.Y)); |
| | | { |
| | | var x = Math.Round(pt.X, 2); |
| | | var y = Math.Round(pt.Y, 2); |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(x, y)); |
| | | } |
| | | |
| | | } |
| | | break; |
| | | } |
| | |
| | | case Yw.Pump.eCurveType.QH: |
| | | { |
| | | foreach (Yw.Geometry.Point2d pt in _qh_pt_list) |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(pt.X, pt.Y)); |
| | | { |
| | | var x = Math.Round(pt.X, 2); |
| | | var y = Math.Round(pt.Y, 2); |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(x, y)); |
| | | } |
| | | } |
| | | break; |
| | | case Yw.Pump.eCurveType.QE: |
| | | { |
| | | foreach (Yw.Geometry.Point2d pt in _qe_pt_list) |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(pt.X, pt.Y)); |
| | | { |
| | | var x = Math.Round(pt.X, 2); |
| | | var y = Math.Round(pt.Y, 2); |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(x, y)); |
| | | } |
| | | } |
| | | break; |
| | | case Yw.Pump.eCurveType.QP: |
| | | { |
| | | foreach (Yw.Geometry.Point2d pt in _qp_pt_list) |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(pt.X, pt.Y)); |
| | | { |
| | | var x = Math.Round(pt.X, 2); |
| | | var y = Math.Round(pt.Y, 2); |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(x, y)); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | |
| | | Yw.Geometry.CubicSpline2d qh = null, qe = null, qp = null; |
| | | |
| | | qh = new Yw.Geometry.CubicSpline2d(curve_qh.FeatCurve.GetPointList()); |
| | | if (qe != null) |
| | | if (curve_qe != null) |
| | | qe = new Yw.Geometry.CubicSpline2d(curve_qe.FeatCurve.GetPointList()); |
| | | if (qp != null) |
| | | if (curve_qp != null) |
| | | qp = new Yw.Geometry.CubicSpline2d(curve_qp.FeatCurve.GetPointList()); |
| | | |
| | | this.curveExpressEditCtrl1.SetBindingData(qh, qe, qp); |
| | |
| | | _fitCurvePoints.Clear(); |
| | | _pt_ql_list = points; |
| | | foreach (Yw.Geometry.Point2d pt in _pt_ql_list) |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(pt.X, pt.Y)); |
| | | |
| | | { |
| | | var x = Math.Round(pt.X, 2); |
| | | var y = Math.Round(pt.Y, 2); |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(x,y)); |
| | | } |
| | | this.bindingSource1.ResetBindings(false); |
| | | } |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | this.curveExpressEditCtrl1.SetBindingData(ql); |
| | | } |
| | | |
| | |
| | | namespace Yw.WinFrmUI.Phart |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.DataAccess.Native.Json; |
| | | using DevExpress.Diagram.Core.Shapes; |
| | | |
| | | namespace Yw.WinFrmUI.Phart |
| | | { |
| | | /// <summary> |
| | | /// |
| | |
| | | |
| | | var validGridNumH = 6; |
| | | var coordinate_paras = new PumpCoordinate(); |
| | | coordinate_paras.GridNumberX = 10; |
| | | coordinate_paras.GridNumberY = 18; |
| | | coordinate_paras.GridNumberX = 10;//10 |
| | | coordinate_paras.GridNumberY = 18;//18 |
| | | CalcCoordinateQ(minQ, maxQ, ref coordinate_paras, coordinate_paras.GridNumberX); |
| | | CalcCoordinateH(minH, maxH, validGridNumH, ref coordinate_paras, out double disMinH, out double disMaxH); |
| | | |
| | |
| | | |
| | | if (maxE > minE + 0.01) |
| | | CalcCoordinateE(minE, maxE, ref coordinate_paras); |
| | | |
| | | |
| | | return coordinate_paras; |
| | | } |
| | | |
| | |
| | | /// <param name="coordinate_paras">坐标Model</param> |
| | | public static void CalcCoordinateP(double minP, double maxP, double disMaxH, int downGridNum, ref PumpCoordinate coordinate_paras) |
| | | { |
| | | int default_num = 5; |
| | | int default_num = 7; |
| | | int spaceNum = coordinate_paras.StartLineNoH - default_num - downGridNum; |
| | | if (spaceNum < 3) |
| | | spaceNum = 3; |
| | |
| | | stratLineNoP--; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | coordinate_paras.CoordSpaceP = coordSpaceP; |
| | | coordinate_paras.EndLineNoP = endLineNoP; |
| | | coordinate_paras.StartLineNoP = stratLineNoP; |
| | |
| | | if (coordinate_paras.StartLineNoP < downGridNum) |
| | | { |
| | | int diff_num = downGridNum - coordinate_paras.StartLineNoP; |
| | | |
| | | coordinate_paras.EndLineNoP += diff_num; |
| | | coordinate_paras.StartLineNoP += diff_num; |
| | | } |
| | | |
| | | |
| | | coordinate_paras.CoordMinH = GetByPlacesLength(disMaxH - (double)coordinate_paras.EndLineNoH * coordinate_paras.CoordSpaceH, 3); |
| | | coordinate_paras.CoordMinH = GetByPlacesLength(disMaxH - (double)coordinate_paras.EndLineNoH * coordinate_paras.CoordSpaceH, 3); |
| | | coordinate_paras.CoordMinP = GetByPlacesLength(disMaxP - (double)coordinate_paras.EndLineNoP * coordinate_paras.CoordSpaceP, 3); |
| | | |
| | | |
| | | if (minP > 0 && minP < 10) |
| | | { |
| | | coordinate_paras.StartLineNoP = 0; |
| | | coordinate_paras.EndLineNoP = endLineNoP; |
| | | coordinate_paras.CoordSpaceP = coordSpaceP; |
| | | coordinate_paras.CoordMinP = Math.Floor(minP); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |