ÎļþÃû´Ó WinFrmUI/Yw.WinFrmUI.Phart.Core/v2/02-pump/01-view/PumpParallelChart.cs ÐÞ¸Ä |
| | |
| | | |
| | | #region Public Evnet |
| | | |
| | | public event Action<PumpCoordinate> OnCurveCoordinateChanged; |
| | | /// <summary> |
| | | /// åæ åæ¢äºä»¶ |
| | | /// </summary> |
| | | public event Action<PumpCoordinate> CoordinateChangedEvent = null; |
| | | |
| | | /// <summary> |
| | | /// å¹¶èç¶æåæ¢äºä»¶ |
| | | /// </summary> |
| | | public event Action<PumpCoordinate> ParallelStatusChangedEvent = null; |
| | | |
| | | public event Action<string, PumpGroupPt> OnCalcQueryPoint = null; |
| | | /// <summary> |
| | | /// æ¥è¯¢ç¹åæ¢äºä»¶ |
| | | /// </summary> |
| | | public event Action<List<PumpQueryPointViewModel>> QueryPointChangedEvent = null; |
| | | |
| | | /// <summary> |
| | | /// 设计ç¹åæ¢äºä»¶ |
| | | /// </summary> |
| | | public event Action<List<PumpQueryPointViewModel>> DesignPointChangedEvent = null; |
| | | |
| | | #endregion |
| | | |
| | |
| | | #region Add Set |
| | | |
| | | /// <summary> |
| | | /// ç»å®æ°æ® |
| | | /// </summary> |
| | | /// <param name="list"></param> |
| | | public void SetBindingData(List<PumpParallelViewModel> list) |
| | | { |
| | | |
| | | } |
| | | |
| | | public void SetDesignPoint(double flow,double head) |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ·»å æ²çº¿ |
| | | /// </summary> |
| | | public void Add(List<PumpSerialParallelInfoViewModel> vm_list, Yw.Geometry.Point2d equip_pt) |
| | |
| | | /// <summary> |
| | | /// 设置æ²çº¿ |
| | | /// </summary> |
| | | public void SetInfo(string id, string name, Color color) |
| | | public void Set(string id, string name, Color color) |
| | | { |
| | | var exist = _vm_list.FirstOrDefault(x => x.Id == id); |
| | | if (exist == null) |
| | |
| | | if (exist_default) |
| | | { |
| | | var def_vm = _vm_list.Find(x => x.IsDefault); |
| | | var min_flow = def_vm.Qh.MinX; |
| | | var max_flow = def_vm.Qh.MaxX; |
| | | var min_flow = def_vm.CurveQH.MinX; |
| | | var max_flow = def_vm.CurveQH.MaxX; |
| | | |
| | | work_flow ??= _equip_pt?.X ?? max_flow / 3 * 2; |
| | | if (work_flow < min_flow || work_flow > max_flow) |
| | | return; |
| | | |
| | | var work_pt = new PumpGroupPt(0, 0, 0, 0, 0); |
| | | var work_pt = new PumpQueryPointViewModel(); |
| | | work_pt.Q = work_flow.Value; |
| | | work_pt.H = def_vm.QhCalc.GetPointY(work_flow.Value); |
| | | |
| | |
| | | if (def_vm.QpCalc != null) |
| | | { |
| | | work_pt.P = def_vm.QpCalc.GetPointY(work_pt.Q); |
| | | work_pt.E = PumpCalcHelper.CalculateE(work_pt.Q, work_pt.H, work_pt.P); |
| | | work_pt.E = PumpCalcHelper.CalculateE(work_pt.Q, work_pt.H, work_pt.P.Value); |
| | | } |
| | | else |
| | | { |
| | | work_pt.E = def_vm.QeCalc.GetPointY(work_pt.Q); |
| | | } |
| | | work_info_str_builder.AppendLine($"æç:{work_pt.E.ToString("N2")} "); |
| | | work_info_str_builder.AppendLine($"æç:{work_pt.E.Value.ToString("N2")} "); |
| | | } |
| | | if (def_vm.QpCalc != null) |
| | | { |
| | | work_pt.P = def_vm.QpCalc.GetPointY(work_pt.Q); |
| | | work_info_str_builder.Append($"åç:{work_pt.P.ToString("N1")} "); |
| | | work_info_str_builder.Append($"åç:{work_pt.P.Value.ToString("N1")} "); |
| | | } |
| | | |
| | | _anno_txt_query_info.Text = work_info_str_builder.ToString(); |
| | |
| | | { |
| | | if (vm.IsDefault) |
| | | continue; |
| | | var pump_work_pt = new PumpGroupPt(0, 0, 0, 0, 0); |
| | | var pump_work_pt = new PumpQueryPointViewModel(); |
| | | pump_work_pt.Q = vm.QhCalc.GetPointsX(work_pt.H).LastOrDefault(); |
| | | pump_work_pt.H = work_pt.H; |
| | | if (vm.QeCalc != null) |
| | |
| | | if (vm.QpCalc != null) |
| | | { |
| | | pump_work_pt.P = vm.QpCalc.GetPointY(pump_work_pt.Q); |
| | | pump_work_pt.E = PumpCalcHelper.CalculateE(pump_work_pt.Q, pump_work_pt.H, pump_work_pt.P); |
| | | pump_work_pt.E = PumpCalcHelper.CalculateE(pump_work_pt.Q, pump_work_pt.H, pump_work_pt.P.Value); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | pump_work_pt.P = vm.QpCalc.GetPointY(pump_work_pt.Q); |
| | | } |
| | | if (this.OnCalcQueryPoint != null) |
| | | if (this.QueryPointChangedEvent != null) |
| | | { |
| | | this.OnCalcQueryPoint(vm.Id, pump_work_pt); |
| | | this.QueryPointChangedEvent(vm.Id, pump_work_pt); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | _query_flow_line.AxisValue = work_flow; |
| | | _query_flow_line.Title.Text = work_flow.Value.ToString("N1"); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | _coordinate = rhs; |
| | | CalcChartAxis(); |
| | | this.OnCurveCoordinateChanged?.Invoke(_coordinate); |
| | | this.CoordinateChangedEvent?.Invoke(_coordinate); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |