| | |
| | | |
| | | private PumpCoordinate _coordinate; |
| | | |
| | | private bool _qe_visible = true; |
| | | private bool _qp_visible = true; |
| | | private bool _eff_visible = true; |
| | | private bool _power_visible = true; |
| | | |
| | | private bool _run_point_visible = true; |
| | | private bool _equip_visible = true; |
| | |
| | | /// </summary> |
| | | public bool QEVisible |
| | | { |
| | | get => _qe_visible; |
| | | get => _eff_visible; |
| | | set |
| | | { |
| | | _qe_visible = value; |
| | | SetQEVisible(_qe_visible); |
| | | _eff_visible = value; |
| | | SetQEVisible(_eff_visible); |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public bool QPVisble |
| | | { |
| | | get => _qp_visible; |
| | | get => _power_visible; |
| | | set |
| | | { |
| | | _qp_visible = value; |
| | | SetQPVisible(_qp_visible); |
| | | _power_visible = value; |
| | | SetQPVisible(_power_visible); |
| | | } |
| | | } |
| | | |
| | |
| | | dx_args.Cache.FillEllipse(dg_x, dg_y, 10, 10, color); |
| | | _rect_list.Add(new(new Rectangle(dg_x, dg_y, 10, 10), color, vm)); |
| | | } |
| | | if (eff.HasValue && _qe_visible) |
| | | if (eff.HasValue && _eff_visible) |
| | | { |
| | | var dg_pt = _diagram.DiagramToPoint(flow, eff.Value, _axis_x_flow, _axis_y_eff); |
| | | var dg_x = dg_pt.Point.X - 5; |
| | |
| | | _rect_list.Add(new(new Rectangle(dg_x, dg_y, 10, 10), color, vm)); |
| | | } |
| | | |
| | | if (power.HasValue && _qp_visible) |
| | | if (power.HasValue && _power_visible) |
| | | { |
| | | var dg_pt = _diagram.DiagramToPoint(flow, power.Value, _axis_x_flow, _axis_y_power); |
| | | var dg_x = dg_pt.Point.X - 5; |
| | |
| | | |
| | | |
| | | _bottom_pane.Visibility = ChartElementVisibility.Hidden; |
| | | _bottom_pane.Visibility = _qp_visible ? ChartElementVisibility.Visible : ChartElementVisibility.Hidden; |
| | | _bottom_pane.Visibility = _power_visible ? ChartElementVisibility.Visible : ChartElementVisibility.Hidden; |
| | | |
| | | //计算刻度 Q |
| | | var axisQLabels = new List<CustomAxisLabel>(); |
| | |
| | | _axis_y_head.GridLines.Visible = true; |
| | | |
| | | //效率 |
| | | if (_max_eff > _min_eff && _qe_visible) |
| | | if (_max_eff > _min_eff && _eff_visible) |
| | | { |
| | | //计算刻度 |
| | | var labels = new List<CustomAxisLabel>(); |
| | |
| | | } |
| | | |
| | | //功率 |
| | | if (_max_power > _min_power && _qp_visible) |
| | | if (_max_power > _min_power && _power_visible) |
| | | { |
| | | //计算刻度 |
| | | var labels = new List<CustomAxisLabel>(); |
| | |
| | | var grid_count_head = _coordinate.EndLineNoH - _coordinate.StartLineNoH; |
| | | var grid_count_eff = _coordinate.EndLineNoE - _coordinate.StartLineNoE; |
| | | int grid_count_up = Math.Max(grid_count_head, grid_count_eff); |
| | | if (_qe_visible) |
| | | if (_eff_visible) |
| | | { |
| | | grid_count_up += 2;//多两条 |
| | | } |
| | |
| | | var qh_pt_ex_list = qh.GetPointListByXRatioRange(1, max_ratio, 100); |
| | | qh_pt_ex_list = qh_pt_ex_list.Where(x => x.X >= max_pt.X).ToList(); |
| | | qh_pt_ex_list.Add(max_pt); |
| | | CreateLineSeries(vm.Id + "qh", vm.Color, qh_pt_ex_list, _default_pane,_axis_y_head, DashStyle.Dot); |
| | | CreateLineSeries(vm.Id + "qh", vm.Color, qh_pt_ex_list, _default_pane, _axis_y_head, DashStyle.Dot); |
| | | |
| | | if (vm.CurveQE != null && vm.CurveQE.Any() && _qe_visible) |
| | | if (vm.CurveQE != null && vm.CurveQE.Any() && _eff_visible) |
| | | { |
| | | var qe = vm.CurveQE.GetFeatCurve(_feat_type_qe); |
| | | var qe_pt_ex_list = vm.CurveQE.GetExpandPointList(_feat_type_qe, 1, max_ratio, 100); |
| | |
| | | CreateLineSeries(vm.Id + "qe", vm.Color, qe_pt_ex_list, _default_pane, _axis_y_eff, DashStyle.Dot); |
| | | } |
| | | |
| | | if (vm.CurveQP != null && vm.CurveQP.Any() && _qp_visible) |
| | | if (vm.CurveQP != null && vm.CurveQP.Any() && _power_visible) |
| | | { |
| | | var qp = vm.CurveQP.GetFeatCurve(_feat_type_qp); |
| | | var qp_pt_ex_list = vm.CurveQP.GetExpandPointList(_feat_type_qp, 1, max_ratio, 100); |
| | | qp_pt_ex_list = qp_pt_ex_list.Where(x => x.X >= max_pt.X * 0.8).ToList(); |
| | | CreateLineSeries(vm.Id+"qp", vm.Color, qp_pt_ex_list, _bottom_pane, _axis_y_power, DashStyle.Dot); |
| | | CreateLineSeries(vm.Id + "qp", vm.Color, qp_pt_ex_list, _bottom_pane, _axis_y_power, DashStyle.Dot); |
| | | } |
| | | } |
| | | |
| | |
| | | series_qe.SeriesPointsSorting = SortingMode.None; |
| | | series_qe.SeriesPointsSortingKey = SeriesPointKey.Value_1; |
| | | series_qe.View = series_qe_view; |
| | | series_qe.Visible = _qe_visible; |
| | | series_qe.Visible = _eff_visible; |
| | | |
| | | var pt_qe_list = qe.GetPointList(_feat_type_qe, 100); |
| | | for (int i = 0; i < pt_qe_list.Count; i++) |
| | |
| | | series_qp.SeriesPointsSorting = SortingMode.None; |
| | | series_qp.SeriesPointsSortingKey = SeriesPointKey.Value_1; |
| | | series_qp.View = series_qp_view; |
| | | series_qp.Visible = _qp_visible; |
| | | series_qp.Visible = _power_visible; |
| | | |
| | | var pt_qp_list = qp.GetPointList(_feat_type_qp, 100); |
| | | for (int i = 0; i < pt_qp_list.Count; i++) |
| | |
| | | /// <summary> |
| | | /// 创建线系列 |
| | | /// </summary> |
| | | private void CreateLineSeries(string id, Color color, List<Yw.Geometry.Point2d> pt_list, XYDiagramPaneBase pane,AxisYBase axiy, DashStyle dash = DashStyle.Solid) |
| | | private void CreateLineSeries(string id, Color color, List<Yw.Geometry.Point2d> pt_list, XYDiagramPaneBase pane, AxisYBase axiy, DashStyle dash = DashStyle.Solid) |
| | | { |
| | | var series = new DevExpress.XtraCharts.Series(); |
| | | series.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical; |
| | |
| | | /// </summary> |
| | | public void SetQEVisible(bool visible) |
| | | { |
| | | _qe_visible = visible; |
| | | _eff_visible = visible; |
| | | UpdateChart(); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public void SetQPVisible(bool visible) |
| | | { |
| | | _qp_visible = visible; |
| | | _bottom_pane.Visibility = _qp_visible ? ChartElementVisibility.Visible : ChartElementVisibility.Hidden; |
| | | _power_visible = visible; |
| | | _bottom_pane.Visibility = _power_visible ? ChartElementVisibility.Visible : ChartElementVisibility.Hidden; |
| | | UpdateChart(); |
| | | } |
| | | |