| | |
| | | using DevExpress.Utils; |
| | | using DevExpress.Utils.Drawing; |
| | | using DevExpress.XtraCharts; |
| | | using System.Text; |
| | | using Yw.Geometry; |
| | | |
| | | namespace Yw.WinFrmUI.Phart |
| | | { |
| | |
| | | private AxisX _axis_x_flow; |
| | | private AxisY _axis_y_head; |
| | | private SecondaryAxisY _axis_y_eff, _axis_y_power; |
| | | private ConstantLine _query_flow_line; |
| | | private ConstantLine _const_line_x; |
| | | |
| | | private TextAnnotation _anno_txt_query_info; |
| | | private PumpCoordinate _coordinate; |
| | |
| | | _axis_y_power = _diagram.SecondaryAxesY.GetAxisByName("AxisYQP"); |
| | | _axis_y_power.SetSecondaryAxisYQPDisplay(); |
| | | |
| | | _query_flow_line = (ConstantLine)_diagram.AxisX.ConstantLines.GetElementByName("WorkPointLine"); |
| | | _query_flow_line.SetWorkPointLineDisplay(); |
| | | _const_line_x = (ConstantLine)_diagram.AxisX.ConstantLines.GetElementByName("WorkPointLine"); |
| | | _const_line_x.SetWorkPointLineDisplay(); |
| | | |
| | | _anno_txt_query_info = this.chartControl1.AnnotationRepository[0] as TextAnnotation; |
| | | _anno_txt_query_info.SetTextAnnoWorkPointDisplay(); |
| | |
| | | _axis_y_power.GridLines.Visible = false; |
| | | |
| | | |
| | | _query_flow_line.Visible = false; |
| | | _const_line_x.Visible = false; |
| | | _anno_txt_query_info.Visible = false; |
| | | |
| | | this.chartControl1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chartControl1_MouseMove); |
| | |
| | | |
| | | private void ChartControl1_CustomPaint(object sender, CustomPaintEventArgs e) |
| | | { |
| | | if (e is not DXCustomPaintEventArgs dxArgs) |
| | | if (e is not DXCustomPaintEventArgs dx_args) |
| | | return; |
| | | if (_vm_list == null || !_vm_list.Any()) |
| | | return; |
| | |
| | | var sect_pt = vm.EquipPoint; |
| | | if (sect_pt == null) |
| | | continue; |
| | | DrawEquipPoint(dxArgs.Cache, pen, sect_pt, vm.CurrentCurveQE, vm.CurrentCurveQP); |
| | | DrawEquipPoint(dx_args.Cache, pen, sect_pt, vm.CurrentCurveQE, vm.CurrentCurveQP); |
| | | } |
| | | |
| | | DrawEquipLine(dxArgs.Cache, pen, _equip_line); |
| | | DrawEquipLine(dx_args.Cache, pen, _equip_line); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | if (qp != null && _qp_visible) |
| | | { |
| | | var qp_y = qe.GetPointY(qh_x); |
| | | var qp_y = qp.GetPointY(qh_x); |
| | | var qp_pt = _diagram.DiagramToPoint(qh_x, qp_y, _axis_x_flow, _axis_y_power); |
| | | var qp_pt_x = qp_pt.Point.X; |
| | | var qp_pt_y = qp_pt.Point.Y; |
| | |
| | | continue; |
| | | var qe_pt_list = vm.CurrentCurveQE.GetPointList(); |
| | | var yyy = qe_pt_list.Select(x => x.Y); |
| | | _min_eff = Math.Min(_min_eff, yyy.Min()); |
| | | _max_eff = Math.Max(_max_eff, yyy.Max()); |
| | | } |
| | | |
| | |
| | | _axis_y_power.Visibility = DefaultBoolean.False; |
| | | _axis_y_power.GridLines.Visible = false; |
| | | |
| | | _query_flow_line.Visible = false; |
| | | _const_line_x.Visible = false; |
| | | |
| | | _bottom_pane.Visibility = ChartElementVisibility.Hidden; |
| | | |
| | |
| | | } |
| | | |
| | | //功率 |
| | | if (_max_power > _min_power) |
| | | if (_max_power > _min_power && _qp_visible) |
| | | { |
| | | //计算刻度 |
| | | var labels = new List<CustomAxisLabel>(); |
| | |
| | | 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 (!_line_visible) |
| | | { |
| | | _query_flow_line.Visible = false; |
| | | _query_flow_line.Title.Visible = false; |
| | | _const_line_x.Visible = false; |
| | | _const_line_x.Title.Visible = false; |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | _query_flow_line.Visible = true; |
| | | _query_flow_line.Title.Visible = true; |
| | | _const_line_x.Visible = true; |
| | | _const_line_x.Title.Visible = true; |
| | | } |
| | | |
| | | if (_vm_list == null || !_vm_list.Any()) |
| | |
| | | }); |
| | | } |
| | | |
| | | _query_flow_line.AxisValue = x_flow; |
| | | _query_flow_line.Title.Text = $"{x_flow:N1}"; |
| | | _const_line_x.AxisValue = x_flow; |
| | | _const_line_x.Title.Text = $"{x_flow:N1}"; |
| | | |
| | | this.QueryPointChangedEvent?.Invoke(query_pt_list); |
| | | } |
| | |
| | | series_qh.View = series_qh_view; |
| | | series_qh.Visible = true; |
| | | |
| | | var pt_qh_list = vm.CurrentCurveQH.GetPointList(12); |
| | | var pt_qh_list = vm.CurrentCurveQH.GetPointList(100); |
| | | for (int i = 0; i < pt_qh_list.Count; i++) |
| | | { |
| | | series_qh.Points.Add(new SeriesPoint(pt_qh_list[i].X, new double[] { pt_qh_list[i].Y })); |
| | |
| | | series_qe.View = series_qe_view; |
| | | series_qe.Visible = _qe_visible; |
| | | |
| | | var pt_qe_list = vm.CurrentCurveQE.GetPointList(12); |
| | | var pt_qe_list = vm.CurrentCurveQE.GetPointList(100); |
| | | for (int i = 0; i < pt_qe_list.Count; i++) |
| | | { |
| | | series_qe.Points.Add(new SeriesPoint(pt_qe_list[i].X, new double[] { pt_qe_list[i].Y })); |
| | |
| | | series_qp.View = series_qp_view; |
| | | series_qp.Visible = _qp_visible; |
| | | |
| | | var pt_qp_list = vm.CurrentCurveQP.GetPointList(12); |
| | | var pt_qp_list = vm.CurrentCurveQP.GetPointList(100); |
| | | for (int i = 0; i < pt_qp_list.Count; i++) |
| | | { |
| | | series_qp.Points.Add(new SeriesPoint(pt_qp_list[i].X, new double[] { pt_qp_list[i].Y })); |
| | |
| | | } |
| | | else if (hitInfo.InConstantLine) |
| | | { |
| | | if (hitInfo.ConstantLine == _query_flow_line) |
| | | if (hitInfo.ConstantLine == _const_line_x) |
| | | { |
| | | _onMoveWorkPointLine = true; |
| | | } |