| | |
| | | } |
| | | |
| | | start_head ??= _coordinate.DispMinH(); |
| | | |
| | | var equip_line_reated = Yw.Geometry.EquipCurveHelper.CalcEquipCurve(_operation_vm.CurveQH, _equip_pt, start_head.Value, out Yw.Geometry.Point2d sect_pt_rated); |
| | | if (equip_line_reated == null || sect_pt_rated == null) |
| | | return; |
| | | |
| | | _equip_line = equip_line_reated; |
| | | _equip_sect_pt = sect_pt_rated; |
| | | |
| | | double flow_rated = 0, head_rated = 0; |
| | | double? eff_rated = null, power_rated = null; |
| | | flow_rated = sect_pt_rated.X; |
| | | head_rated = _operation_vm.CurveQH.GetPointY(flow_rated); |
| | | if (_operation_vm.CurveQP != null) |
| | | { |
| | | power_rated = _operation_vm.CurveQP.GetPointY(flow_rated); |
| | | eff_rated = PumpCalcHelper.CalculateE(flow_rated, head_rated, power_rated.Value); |
| | | } |
| | | else if (_operation_vm.CurveQE != null) |
| | | { |
| | | eff_rated = _operation_vm.CurveQE.GetPointY(flow_rated); |
| | | power_rated = PumpCalcHelper.CalculateP(flow_rated, head_rated, eff_rated.Value); |
| | | } |
| | | |
| | | |
| | | var design_pt_list = new List<PumpDesignPointViewModel>(); |
| | | |
| | | var design_pt_rated = new PumpDesignPointViewModel(); |
| | | design_pt_rated.Id = _operation_vm.Id + "额定"; |
| | | design_pt_rated.Name = _operation_vm.Name+"(额定)"; |
| | | design_pt_rated.Q = flow_rated; |
| | | design_pt_rated.H = head_rated; |
| | | design_pt_rated.E = eff_rated; |
| | | design_pt_rated.P = power_rated; |
| | | design_pt_rated.Hz = _operation_vm.RatedHz; |
| | | design_pt_rated.N = _operation_vm.RatedN; |
| | | design_pt_list.Add(design_pt_rated); |
| | | |
| | | if (_operation_vm.CurrentStatus) |
| | | { |
| | | var equip_line = Yw.Geometry.EquipCurveHelper.CalcEquipCurve(_operation_vm.CurrentCurveQH, _equip_pt, start_head.Value, out Yw.Geometry.Point2d sect_pt); |
| | | var equip_line = Yw.Geometry.EquipCurveHelper.CalcEquipCurve(_operation_vm.CurveQH, _equip_pt, start_head.Value, out Yw.Geometry.Point2d sect_pt); |
| | | if (equip_line == null || sect_pt == null) |
| | | return; |
| | | |
| | | _equip_line = equip_line; |
| | | _equip_sect_pt = sect_pt; |
| | | |
| | | double flow = 0, head = 0; |
| | | double? eff = null, power = null; |
| | | flow = sect_pt.X; |
| | | head = _operation_vm.CurrentCurveQH.GetPointY(flow); |
| | | if (_operation_vm.CurrentCurveQP != null) |
| | | head = _operation_vm.CurveQH.GetPointY(flow); |
| | | if (_operation_vm.CurveQP != null) |
| | | { |
| | | power = _operation_vm.CurrentCurveQP.GetPointY(flow); |
| | | power = _operation_vm.CurveQP.GetPointY(flow); |
| | | eff = PumpCalcHelper.CalculateE(flow, head, power.Value); |
| | | } |
| | | else if (_operation_vm.CurrentCurveQE != null) |
| | | else if (_operation_vm.CurveQE != null) |
| | | { |
| | | eff = _operation_vm.CurrentCurveQE.GetPointY(flow); |
| | | eff = _operation_vm.CurveQE.GetPointY(flow); |
| | | power = PumpCalcHelper.CalculateP(flow, head, eff.Value); |
| | | } |
| | | |
| | | var design_pt = new PumpDesignPointViewModel(); |
| | | design_pt.Id = _operation_vm.Id; |
| | | design_pt.Name = _operation_vm.Name; |
| | | design_pt.Q = flow; |
| | | design_pt.H = head; |
| | | design_pt.E = eff; |
| | | design_pt.P = power; |
| | | design_pt.Hz = _operation_vm.CurrentHz; |
| | | design_pt.N = _operation_vm.CurrentN; |
| | | design_pt_list.Add(design_pt); |
| | | var design_pt_list = new List<PumpDesignPointViewModel> |
| | | { |
| | | new() { |
| | | Id = _operation_vm.Id + "额定", |
| | | Name = _operation_vm.Name + "(额定)", |
| | | Q = flow, |
| | | H = head, |
| | | E = eff, |
| | | P = power, |
| | | Hz = _operation_vm.RatedHz, |
| | | N = _operation_vm.RatedN |
| | | } |
| | | }; |
| | | |
| | | if (_operation_vm.CurrentStatus) |
| | | { |
| | | var current_equip_line = Yw.Geometry.EquipCurveHelper.CalcEquipCurve(_operation_vm.CurrentCurveQH, _equip_pt, start_head.Value, out Yw.Geometry.Point2d current_sect_pt); |
| | | if ( current_sect_pt == null) |
| | | return; |
| | | double current_flow = 0, current_head = 0; |
| | | double? current_eff = null, current_power = null; |
| | | current_flow = current_sect_pt.X; |
| | | current_head = _operation_vm.CurrentCurveQH.GetPointY(current_flow); |
| | | if (_operation_vm.CurrentCurveQP != null) |
| | | { |
| | | current_power = _operation_vm.CurrentCurveQP.GetPointY(current_flow); |
| | | current_eff = PumpCalcHelper.CalculateE(current_flow, current_head, current_power.Value); |
| | | } |
| | | else if (_operation_vm.CurrentCurveQE != null) |
| | | { |
| | | current_eff = _operation_vm.CurrentCurveQE.GetPointY(current_flow); |
| | | current_power = PumpCalcHelper.CalculateP(current_flow, current_head, current_eff.Value); |
| | | } |
| | | |
| | | design_pt_list.Add(new() |
| | | { |
| | | Id = _operation_vm.Id, |
| | | Name = _operation_vm.Name, |
| | | Q = current_flow, |
| | | H = current_head, |
| | | E = current_eff, |
| | | P = current_power, |
| | | Hz = _operation_vm.CurrentHz, |
| | | N = _operation_vm.CurrentN |
| | | }); |
| | | |
| | | } |
| | | |
| | | this.DesignPointChangedEvent?.Invoke(design_pt_list); |
| | |
| | | this.chartControl1.BeginInit(); |
| | | this.chartControl1.Series.Clear(); |
| | | |
| | | var annotationCount = this.chartControl1.AnnotationRepository.Count; |
| | | for (int i = annotationCount - 1; i > 0; i--) |
| | | var annotation_count = this.chartControl1.AnnotationRepository.Count; |
| | | for (int i = annotation_count - 1; i > 0; i--) |
| | | { |
| | | if (i == 0) |
| | | break; |
| | |
| | | |
| | | if (_operation_vm!=null) |
| | | { |
| | | CreateRatedLineSeries(_operation_vm); |
| | | CreateLineSeries(_operation_vm); |
| | | if (_operation_vm.CurrentStatus) |
| | | { |
| | | CreateWorkingLineSeries(_operation_vm); |
| | | CreateCurrentLineSeries(_operation_vm); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (_operation_vm == null) |
| | | return; |
| | | Yw.Geometry.CubicSpline2d qh = null, qe = null, qp = null; |
| | | |
| | | x_flow ??= _equip_pt?.X ?? _max_flow *0.8; |
| | | if (x_flow < _operation_vm.CurrentCurveQH.MinX || x_flow > _operation_vm.CurrentCurveQH.MaxX) |
| | | return; |
| | | var query_pt_list = new List<PumpQueryPointViewModel>(); |
| | | |
| | | double flow = 0, head = 0; |
| | | double? eff = null, power = null; |
| | | |
| | | flow = x_flow.Value; |
| | | head = _operation_vm.CurveQH.GetPointY(flow); |
| | | if (_operation_vm.CurveQP != null) |
| | | { |
| | | power = _operation_vm.CurveQP.GetPointY(flow); |
| | | eff = PumpCalcHelper.CalculateE(flow, head, power.Value); |
| | | } |
| | | else if (_operation_vm.CurveQE != null) |
| | | { |
| | | eff = _operation_vm.CurveQE.GetPointY(flow); |
| | | power = PumpCalcHelper.CalculateP(flow, head, eff.Value); |
| | | } |
| | | |
| | | query_pt_list.Add(new PumpQueryPointViewModel |
| | | { |
| | | Id = _operation_vm.Id, |
| | | Name = _operation_vm.Name + "额定", |
| | | Q = flow, |
| | | H = head, |
| | | E = eff, |
| | | P = power, |
| | | Hz = _operation_vm.RatedHz, |
| | | N = _operation_vm.RatedN |
| | | }); |
| | | |
| | | if (_operation_vm.CurrentStatus) |
| | | { |
| | | x_flow ??= _current_equip_sect_pt?.X ?? _operation_vm.CurrentCurveQH.MaxX / 3 * 2; |
| | | if (x_flow < _operation_vm.CurrentCurveQH.MinX || x_flow > _operation_vm.CurrentCurveQH.MaxX) |
| | | return; |
| | | |
| | | qh = _operation_vm.CurrentCurveQH; |
| | | qe = _operation_vm.CurrentCurveQE; |
| | | qp = _operation_vm.CurrentCurveQP; |
| | | } |
| | | else |
| | | flow = x_flow.Value; |
| | | head = _operation_vm.CurrentCurveQH.GetPointY(flow); |
| | | if (_operation_vm.CurrentCurveQP != null) |
| | | { |
| | | x_flow ??= _equip_sect_pt?.X ?? _operation_vm.CurveQH.MaxX / 3 * 2; |
| | | if (x_flow < _operation_vm.CurveQH.MinX || x_flow > _operation_vm.CurveQH.MaxX) |
| | | return; |
| | | qh = _operation_vm.CurveQH; |
| | | qe = _operation_vm.CurveQE; |
| | | qp = _operation_vm.CurveQP; |
| | | power = _operation_vm.CurrentCurveQP.GetPointY(flow); |
| | | eff = PumpCalcHelper.CalculateE(flow, head, power.Value); |
| | | } |
| | | |
| | | _anno_txt_query_info.Visible = true; |
| | | |
| | | var work_pt = new PumpQueryPointViewModel(); |
| | | work_pt.Q = x_flow.Value; |
| | | work_pt.H = qh.GetPointY(x_flow.Value); |
| | | else if (_operation_vm.CurrentCurveQE != null) |
| | | { |
| | | eff = _operation_vm.CurrentCurveQE.GetPointY(flow); |
| | | power = PumpCalcHelper.CalculateP(flow, head, eff.Value); |
| | | } |
| | | query_pt_list.Add(new PumpQueryPointViewModel() |
| | | { |
| | | Id = _operation_vm.Id, |
| | | Name = _operation_vm.Name, |
| | | Q = flow, |
| | | H = head, |
| | | E = eff, |
| | | P = power, |
| | | Hz = _operation_vm.CurrentHz, |
| | | N = _operation_vm.CurrentN |
| | | }); |
| | | } |
| | | |
| | | var work_info_str_builder = new StringBuilder(); |
| | | work_info_str_builder.AppendLine($"流量:{work_pt.Q.ToString("N1")} "); |
| | | work_info_str_builder.AppendLine($"扬程:{work_pt.H.ToString("N1")} "); |
| | | if (qe != null) |
| | | { |
| | | if (qp != null) |
| | | { |
| | | work_pt.P = qp.GetPointY(work_pt.Q); |
| | | work_pt.E = PumpCalcHelper.CalculateE(work_pt.Q, work_pt.H, work_pt.P.Value); |
| | | } |
| | | else |
| | | { |
| | | work_pt.E = qe.GetPointY(work_pt.Q); |
| | | } |
| | | work_info_str_builder.AppendLine($"效率:{work_pt.E.Value.ToString("N2")} "); |
| | | } |
| | | if (qp != null) |
| | | { |
| | | work_pt.P = qp.GetPointY(work_pt.Q); |
| | | work_info_str_builder.Append($"功率:{work_pt.P.Value.ToString("N1")} "); |
| | | } |
| | | work_info_str_builder.AppendLine($"流量:{flow:N2} "); |
| | | work_info_str_builder.AppendLine($"扬程:{head:N2} "); |
| | | if (eff.HasValue) |
| | | work_info_str_builder.AppendLine($"效率:{eff:N2} "); |
| | | if (power.HasValue) |
| | | work_info_str_builder.Append($"功率:{power:N2}"); |
| | | |
| | | _query_flow_line.AxisValue = x_flow; |
| | | _query_flow_line.Title.Text = $"{x_flow:N1}"; |
| | | |
| | | _anno_txt_query_info.Text = work_info_str_builder.ToString(); |
| | | _anno_txt_query_info.AutoSize = true; |
| | | _anno_txt_query_info.Visible = true; |
| | | |
| | | _query_flow_line.AxisValue = x_flow; |
| | | _query_flow_line.Title.Text = x_flow.Value.ToString("N1"); |
| | | this.QueryPointChangedEvent?.Invoke(query_pt_list); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 创建额定线系列 |
| | | /// </summary> |
| | | private void CreateRatedLineSeries(PumpOperationViewModel vm) |
| | | private void CreateLineSeries(PumpOperationViewModel vm) |
| | | { |
| | | var series_qh = new DevExpress.XtraCharts.Series(); |
| | | series_qh.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical; |
| | |
| | | series_qh.ShowInLegend = false; |
| | | series_qh.CrosshairEnabled = DefaultBoolean.False; |
| | | series_qh.Tag = vm.Id.ToString() + "nr"; |
| | | series_qh.ShowInLegend = true; |
| | | series_qh.LegendTextPattern = vm.Name; |
| | | |
| | | |
| | |
| | | /// <summary> |
| | | /// 创建工况线系列 |
| | | /// </summary> |
| | | private void CreateWorkingLineSeries(PumpOperationViewModel vm) |
| | | private void CreateCurrentLineSeries(PumpOperationViewModel vm) |
| | | { |
| | | var series_qh = new DevExpress.XtraCharts.Series(); |
| | | series_qh.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical; |
| | |
| | | series_qh.ShowInLegend = false; |
| | | series_qh.CrosshairEnabled = DefaultBoolean.False; |
| | | series_qh.Tag = vm.Id.ToString(); |
| | | series_qh.ShowInLegend = true; |
| | | series_qh.LegendTextPattern = vm.Name; |
| | | |
| | | |
| | |
| | | _rightClickObj = null; |
| | | } |
| | | } |
| | | else if (e.Button == MouseButtons.Right) |
| | | { |
| | | if (hitInfo.InConstantLine) |
| | | { |
| | | this.popMenuLine.ShowPopup(MousePosition); |
| | | } |
| | | else |
| | | { |
| | | //this.popMenuChart.ShowPopup(MousePosition); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private void chartControl1_MouseMove(object sender, MouseEventArgs e) |
| | |
| | | /// </summary> |
| | | public void SetQeVisible(bool visible) |
| | | { |
| | | //if (!_initial_data) |
| | | // return; |
| | | this.barCekCurveQEVisible.Checked = visible; |
| | | } |
| | | |