| | |
| | | private List<Series> _series_eq_pt_list; |
| | | |
| | | private TextAnnotation _work_pt_txt_annot; |
| | | |
| | | |
| | | private Yw.Geometry.CubicSpline2d _cubic_spline_qh; |
| | | private Yw.Geometry.CubicSpline2d _cubic_spline_qe; |
| | | private Yw.Geometry.CubicSpline2d _cubic_spline_qp; |
| | |
| | | private List<Yw.Geometry.Point2d> _def_pt_qe_list; |
| | | private List<Yw.Geometry.Point2d> _def_pt_qp_list; |
| | | |
| | | |
| | | private PumpGroupPt _design_pt = new(0, 0, 0, 0, 0); |
| | | |
| | | private PumpGroupPt _design_pt = new(0, 0, 0, 0, 0); |
| | | private PumpGroupPt _work_point = new(0, 0, 0, 0, 0); |
| | | |
| | | |
| | | private bool _eq_visible = true; |
| | | |
| | | private PumpCoordinate _coordinate_paras; |
| | | private bool _initial_data = false; |
| | |
| | | #region Public Evnet |
| | | |
| | | public event Action<PumpCoordinate> OnCurveCoordinateChanged; |
| | | |
| | | |
| | | public event Action<PumpGroupPt> OnCalcQueryPoint = null; |
| | | |
| | | #endregion |
| | | |
| | |
| | | return; |
| | | } |
| | | List<Yw.Geometry.Point2d> pt_qh_list, pt_qe_list = null, pt_qp_list = null; |
| | | |
| | | |
| | | pt_qh_list = cubic_spline_qh.GetPointList(12); |
| | | |
| | | if (cubic_spline_qe != null) |
| | |
| | | |
| | | ((PointSeriesView)_series_pt_qp.View).Pane = _bottom_panel; |
| | | ((SplineSeriesView)_series_cubic_spline_qp.View).Pane = _bottom_panel; |
| | | if (series_eq_p_pt_view!=null) |
| | | if (series_eq_p_pt_view != null) |
| | | { |
| | | series_eq_p_pt_view.Pane = _bottom_panel; |
| | | series_eq_p_pt_view.Pane = _bottom_panel; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | else |
| | |
| | | if (_pt_qh_list == null || !_pt_qh_list.Any()) |
| | | return; |
| | | |
| | | |
| | | var minQ = _pt_qh_list.Min(x => x.X); |
| | | var maxQ = _pt_qh_list.Max(x => x.X); |
| | | |
| | |
| | | //测试展示效果 |
| | | _work_pt_txt_annot.Text = workInfoStringBuilder.ToString(); |
| | | _work_pt_txt_annot.AutoSize = true; |
| | | |
| | | if (OnCalcQueryPoint != null) |
| | | { |
| | | OnCalcQueryPoint(_work_point); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 计算设计点 |
| | | /// 设计点 |
| | | /// </summary> |
| | | /// <param name="design_pt_q"></param> |
| | | public void CalcDesignPointByQ(double? design_pt_q = null) |
| | | public void CalcDesignPointByQ(double? design_pt_q = null, double? design_pt_h = null) |
| | | { |
| | | _series_cubic_spline_eq.Visible = true; |
| | | _series_cubic_spline_eq.Points.Clear(); |
| | |
| | | |
| | | |
| | | _design_pt.Q = design_pt_q.Value; |
| | | _design_pt.H = _cubic_spline_qh.GetPointY(_design_pt.Q); |
| | | if (design_pt_h.HasValue) |
| | | { |
| | | _design_pt.H = design_pt_h.Value; |
| | | } |
| | | else |
| | | { |
| | | _design_pt.H = _cubic_spline_qh.GetPointY(_design_pt.Q); |
| | | } |
| | | |
| | | |
| | | _series_cubic_spline_eq.Visible = true; |
| | | _series_cubic_spline_eq.Visible = _eq_visible; |
| | | var design_pt = new Yw.Geometry.Point2d(_design_pt.Q, _design_pt.H); |
| | | var eq_paras = EquipCurveHelper.CalcEquipCurve(_cubic_spline_qh, design_pt, out Yw.Geometry.Point2d sect_pt); |
| | | if (eq_paras != null && eq_paras.EquipCurve != null) |
| | |
| | | } |
| | | |
| | | |
| | | var design_pt_qh = CreatePointSeries(Pump.eCurveType.QH, _design_pt.Q, _design_pt.H); |
| | | var design_pt_qh = CreatePointSeries(Pump.eCurveType.QH, sect_pt.X, sect_pt.Y); |
| | | _series_eq_pt_list.Add(design_pt_qh); |
| | | this.chartControl1.Series.Add(design_pt_qh); |
| | | if (_cubic_spline_qe != null) |
| | |
| | | /// 创建点系列 |
| | | /// </summary> |
| | | private Series CreatePointSeries(Yw.Pump.eCurveType curve_type, double x, double y) |
| | | { |
| | | |
| | | { |
| | | string name = string.Empty; |
| | | Color color = Color.White; |
| | | AxisYBase axis_y = _axisYQH; |
| | |
| | | break; |
| | | case Pump.eCurveType.QP: |
| | | { |
| | | name = "流量功率作用点"; |
| | | name = "流量功率设计点"; |
| | | color = Perform2dChartDisplay.PointColorQP; |
| | | axis_y = _axis_y_qp; |
| | | } |
| | |
| | | series_point.ShowInLegend = true; |
| | | series_point.SeriesPointsSorting = SortingMode.None; |
| | | series_point.SeriesPointsSortingKey = SeriesPointKey.Value_1; |
| | | series_point.Visible = true; |
| | | series_point.Visible = _eq_visible; |
| | | series_point.LabelsVisibility = DefaultBoolean.True; |
| | | series_point.Label.TextPattern = "{V:N1}"; |
| | | //series_point.CrosshairLabelPattern = "{V:N1}"; |
| | | series_point.CrosshairLabelVisibility = DefaultBoolean.False; |
| | | series_point.Points.Add(new SeriesPoint(x, new double[] { y })); |
| | | |
| | | |
| | |
| | | return true; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | private void barCekEqVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | _eq_visible = this.barCekEqVisible.Checked; |
| | | if (_series_cubic_spline_eq != null) |
| | | { |
| | | _series_cubic_spline_eq.Visible = _eq_visible; |
| | | } |
| | | if (_series_eq_pt_list != null && _series_eq_pt_list.Any()) |
| | | { |
| | | foreach (var item in _series_eq_pt_list) |
| | | { |
| | | item.Visible = _eq_visible; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private void barBtnPositioningMaxQ_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | } |
| | | } |