| | |
| | | headerRowPumpList.Cells.Add(CreateTableCell("编码", 100)); |
| | | headerRowPumpList.Cells.Add(CreateTableCell("额定流量", 100)); |
| | | headerRowPumpList.Cells.Add(CreateTableCell("额定扬程", 100)); |
| | | headerRowPumpList.Cells.Add(CreateTableCell("额定功率", 100)); |
| | | headerRowPumpList.Cells.Add(CreateTableCell("额定功率(KW)", 100)); |
| | | headerRowPumpList.Cells.Add(CreateTableCell("额定转速", 100)); |
| | | |
| | | // 将表头行添加到表格 |
| | |
| | | // 创建 XY 图表 |
| | | XYDiagram xyDiagram = new XYDiagram(); |
| | | ((System.ComponentModel.ISupportInitialize)(xyDiagram)).BeginInit(); |
| | | // 设置 X 轴主要网格线可见 |
| | | xyDiagram.AxisX.GridLines.Visible = true; |
| | | // 设置 X 轴主要刻度间隔,可根据需求调整该值,值越小网格越密 |
| | | xyDiagram.AxisX.Tickmarks.Thickness = 1; |
| | | // 设置 Y 轴主要网格线可见 |
| | | xyDiagram.AxisY.GridLines.Visible = true; |
| | | // 设置 Y 轴主要刻度间隔,可根据需求调整该值,值越小网格越密 |
| | | xyDiagram.AxisX.Tickmarks.Thickness = 1; |
| | | |
| | | // 配置主 X 轴 |
| | | xyDiagram.AxisX.Title.Text = "流量(m³/h)"; |
| | | xyDiagram.AxisX.Title.Visibility = DefaultBoolean.True; |
| | | xyDiagram.AxisX.Visibility = DefaultBoolean.True; |
| | | xyDiagram.AxisX.Alignment = AxisAlignment.Far; // 将 X 轴设置在图表底部 |
| | | |
| | | // 配置主 Y 轴 |
| | | xyDiagram.AxisY.Title.Text = "扬程/m"; |
| | |
| | | |
| | | // 创建次要 Y 轴 |
| | | SecondaryAxisY secondaryAxisY1 = new SecondaryAxisY("Secondary Y-Axis 1"); |
| | | secondaryAxisY1.Title.Text = "功率"; |
| | | secondaryAxisY1.Title.Text = "功率(KW)"; |
| | | secondaryAxisY1.Title.Visibility = DefaultBoolean.True; |
| | | secondaryAxisY1.Visibility = DefaultBoolean.True; |
| | | secondaryAxisY1.GridLines.Visible = true; |
| | | secondaryAxisY1.Tickmarks.Thickness = 1; |
| | | secondaryAxisY1.GridLines.Color = Color.LightGray; |
| | | |
| | | xyDiagram.SecondaryAxesY.Add(secondaryAxisY1); |
| | | |
| | | SecondaryAxisY secondaryAxisY2 = new SecondaryAxisY("Secondary Y-Axis 2"); |
| | | secondaryAxisY2.Title.Text = "效率"; |
| | | secondaryAxisY2.Title.Text = "效率(%)"; |
| | | secondaryAxisY2.Title.Visibility = DefaultBoolean.True; |
| | | secondaryAxisY2.Visibility = DefaultBoolean.True; |
| | | secondaryAxisY2.GridLines.Visible = true; |
| | | secondaryAxisY2.Tickmarks.Thickness = 1; |
| | | secondaryAxisY2.GridLines.Color = Color.LightGray; |
| | | |
| | | xyDiagram.SecondaryAxesY.Add(secondaryAxisY2); |
| | | |
| | | chart.Diagram = xyDiagram; |
| | |
| | | this.Detail.Controls.Add(label); |
| | | currentY += 20F; |
| | | |
| | | XRChart chartQh = new XRChart(); |
| | | chartQh.LocationF = new DevExpress.Utils.PointFloat(0F, currentY); |
| | | chartQh.WidthF = contentWidth; |
| | | chartQh.HeightF = 300F; |
| | | XRChart chart = new XRChart(); |
| | | ((System.ComponentModel.ISupportInitialize)(chart)).BeginInit(); |
| | | chart.LocationF = new DevExpress.Utils.PointFloat(0F, currentY); |
| | | chart.WidthF = contentWidth; |
| | | chart.HeightF = 600F; |
| | | chart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; |
| | | |
| | | XRChart chartQE = new XRChart(); |
| | | chartQE.LocationF = new DevExpress.Utils.PointFloat(0F, currentY + chartQh.HeightF); |
| | | chartQE.WidthF = contentWidth; |
| | | chartQE.HeightF = 300F; |
| | | // 创建 XY 图表 |
| | | XYDiagram xyDiagram = new XYDiagram(); |
| | | ((System.ComponentModel.ISupportInitialize)(xyDiagram)).BeginInit(); |
| | | |
| | | XRChart chartQP = new XRChart(); |
| | | chartQP.LocationF = new DevExpress.Utils.PointFloat(0F, currentY + chartQh.HeightF + chartQE.HeightF); |
| | | chartQP.WidthF = contentWidth; |
| | | chartQP.HeightF = 300F; |
| | | // 设置 X 轴主要网格线可见 |
| | | xyDiagram.AxisX.GridLines.Visible = true; |
| | | // 设置 X 轴主要刻度间隔,可根据需求调整该值,值越小网格越密 |
| | | xyDiagram.AxisX.Tickmarks.Thickness = 1; |
| | | // 设置 Y 轴主要网格线可见 |
| | | xyDiagram.AxisY.GridLines.Visible = true; |
| | | // 设置 Y 轴主要刻度间隔,可根据需求调整该值,值越小网格越密 |
| | | xyDiagram.AxisX.Tickmarks.Thickness = 1; |
| | | // 配置主 X 轴 |
| | | xyDiagram.AxisX.Title.Text = "流量(m³/h)"; |
| | | xyDiagram.AxisX.Title.Visibility = DefaultBoolean.True; |
| | | xyDiagram.AxisX.Visibility = DefaultBoolean.True; |
| | | |
| | | // 配置主 Y 轴 |
| | | xyDiagram.AxisY.Title.Text = "扬程/m"; |
| | | xyDiagram.AxisY.Title.Visibility = DefaultBoolean.True; |
| | | xyDiagram.AxisY.Visibility = DefaultBoolean.True; |
| | | //xyDiagram.AxisY.Alignment = AxisAlignment.Zero; // 设置 Y 轴与 X 轴共用零点 |
| | | |
| | | // 创建两个面板 |
| | | XYDiagramPane pane1 = new XYDiagramPane(); |
| | | pane1.Name = "Pane 1"; |
| | | xyDiagram.Panes.Add(pane1); |
| | | |
| | | XYDiagramPane pane2 = new XYDiagramPane(); |
| | | pane2.Name = "Pane 2"; |
| | | xyDiagram.Panes.Add(pane2); |
| | | |
| | | // 创建次要 Y 轴 |
| | | SecondaryAxisY secondaryAxisY1 = new SecondaryAxisY("Secondary Y-Axis 1"); |
| | | secondaryAxisY1.Title.Text = "功率(KW)"; |
| | | secondaryAxisY1.Title.Visibility = DefaultBoolean.True; |
| | | secondaryAxisY1.Visibility = DefaultBoolean.True; |
| | | secondaryAxisY1.GridLines.Visible = true; |
| | | secondaryAxisY1.Tickmarks.Thickness = 1; |
| | | secondaryAxisY1.GridLines.Color = Color.LightGray; |
| | | |
| | | xyDiagram.SecondaryAxesY.Add(secondaryAxisY1); |
| | | |
| | | SecondaryAxisY secondaryAxisY2 = new SecondaryAxisY("Secondary Y-Axis 2"); |
| | | secondaryAxisY2.Title.Text = "效率(%)"; |
| | | secondaryAxisY2.Title.Visibility = DefaultBoolean.True; |
| | | secondaryAxisY2.Visibility = DefaultBoolean.True; |
| | | secondaryAxisY2.GridLines.Visible = true; |
| | | secondaryAxisY2.Tickmarks.Thickness = 1; |
| | | secondaryAxisY2.GridLines.Color = Color.LightGray; |
| | | |
| | | xyDiagram.SecondaryAxesY.Add(secondaryAxisY2); |
| | | |
| | | chart.Diagram = xyDiagram; |
| | | ((System.ComponentModel.ISupportInitialize)(xyDiagram)).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(chart)).EndInit(); |
| | | |
| | | foreach (var valve in item) |
| | | { |
| | | // 创建一个线系列 |
| | | Series series = new Series(valve.Code, ViewType.Spline); |
| | | // 添加数据点 |
| | | foreach (var qh in valve.CurrentCurveQH) |
| | | // 创建第一个系列 |
| | | Series series1 = new Series("Series 1", ViewType.Spline); |
| | | if (valve.CurrentCurveQH != null) |
| | | { |
| | | series.Points.Add(new SeriesPoint(qh.X.ToString(), qh.Y.ToString())); |
| | | foreach (var qh in valve.CurrentCurveQH) |
| | | { |
| | | series1.Points.Add(new SeriesPoint(qh.X, qh.Y)); |
| | | } |
| | | series1.LabelsVisibility = DefaultBoolean.False; |
| | | chart.Series.Add(series1); |
| | | } |
| | | chartQh.Series.Add(series); |
| | | |
| | | Series series2 = new Series("Series2", ViewType.Spline); |
| | | // 添加数据点 |
| | | foreach (var qe in valve.CurrentCurveQE) |
| | | // 创建第二个系列 |
| | | Series series2 = new Series("Series 2", ViewType.Spline); |
| | | if (valve.CurrentCurveQE != null) |
| | | { |
| | | series2.Points.Add(new SeriesPoint(qe.X.ToString(), qe.Y.ToString())); |
| | | foreach (var qe in valve.CurrentCurveQE) |
| | | { |
| | | series2.Points.Add(new SeriesPoint(qe.X, qe.Y)); |
| | | } |
| | | ((XYDiagramSeriesViewBase)series2.View).Pane = pane2; |
| | | ((XYDiagramSeriesViewBase)series2.View).AxisY = secondaryAxisY2; |
| | | series2.LabelsVisibility = DefaultBoolean.False; |
| | | chart.Series.Add(series2); |
| | | } |
| | | chartQE.Series.Add(series2); |
| | | |
| | | Series series3 = new Series("Series3", ViewType.Spline); |
| | | // 添加数据点 |
| | | foreach (var qp in valve.CurrentCurveQP) |
| | | // 创建第三个系列 |
| | | Series series3 = new Series("Series 3", ViewType.Spline); |
| | | if (valve.RatedCurveQP != null) |
| | | { |
| | | series3.Points.Add(new SeriesPoint(qp.X.ToString(), qp.Y.ToString())); |
| | | foreach (var qp in valve.RatedCurveQP) |
| | | { |
| | | series3.Points.Add(new SeriesPoint(qp.X, qp.Y)); |
| | | } |
| | | ((XYDiagramSeriesViewBase)series3.View).Pane = pane1; |
| | | ((XYDiagramSeriesViewBase)series3.View).AxisY = secondaryAxisY1; |
| | | series3.LabelsVisibility = DefaultBoolean.False; |
| | | chart.Series.Add(series3); |
| | | } |
| | | chartQP.Series.Add(series3); |
| | | } |
| | | |
| | | this.Detail.Controls.Add(chartQh); |
| | | this.Detail.Controls.Add(chartQE); |
| | | this.Detail.Controls.Add(chartQP); |
| | | |
| | | currentY += chartQh.HeightF + chartQE.HeightF + chartQP.HeightF; |
| | | Detail.Controls.Add(chart); |
| | | currentY += chart.HeightF; |
| | | } |
| | | } |
| | | } |
| | |
| | | }); |
| | | dataRow.Cells.Add(new XRTableCell() |
| | | { |
| | | Text = item.CurrentQ?.ToString(), |
| | | Text = item.CurrentQ?.ToString("F2"), |
| | | WidthF = 100F, |
| | | TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter, |
| | | Borders = DevExpress.XtraPrinting.BorderSide.All |
| | | }); |
| | | |
| | | dataRow.Cells.Add(new XRTableCell() |
| | | { |
| | | Text = item.CurrentPr1?.ToString("F2"), |
| | | WidthF = 100F, |
| | | TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter, |
| | | Borders = DevExpress.XtraPrinting.BorderSide.All |
| | | }); |
| | | dataRow.Cells.Add(new XRTableCell() |
| | | { |
| | | Text = item.CurrentPr2?.ToString("F2"), |
| | | WidthF = 100F, |
| | | TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter, |
| | | Borders = DevExpress.XtraPrinting.BorderSide.All |
| | | }); |
| | | dataRow.Cells.Add(new XRTableCell() |
| | | { |
| | | Text = item.CurrentH?.ToString("F2"), |
| | | WidthF = 100F, |
| | | TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter, |
| | | Borders = DevExpress.XtraPrinting.BorderSide.All |
| | | }); |
| | | dataRow.Cells.Add(new XRTableCell() |
| | | { |
| | | Text = item.CurrentP?.ToString("F2"), |
| | | WidthF = 100F, |
| | | TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter, |
| | | Borders = DevExpress.XtraPrinting.BorderSide.All |
| | | }); |
| | | dataRow.Cells.Add(new XRTableCell() |
| | | { |
| | | Text = item.CurrentE?.ToString("F2"), |
| | | WidthF = 100F, |
| | | TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter, |
| | | Borders = DevExpress.XtraPrinting.BorderSide.All |
| | | }); |
| | | tableForEnergyDetails.Rows.Add(dataRow); |
| | | } |
| | | // 将表格添加到Detail |
| | |
| | | chart.LocationF = new DevExpress.Utils.PointFloat(0F, currentY); |
| | | chart.WidthF = contentWidth; |
| | | chart.HeightF = 300F; |
| | | |
| | | chart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; |
| | | // 创建一个线系列 |
| | | Series series = new Series("Series1", ViewType.Area); |
| | | Series series2 = new Series("Series2", ViewType.Area); |
| | | Series series3 = new Series("Series3", ViewType.Area); |
| | | series.LabelsVisibility = DefaultBoolean.False; |
| | | series2.LabelsVisibility = DefaultBoolean.False; |
| | | series3.LabelsVisibility = DefaultBoolean.False; |
| | | // 添加数据点 |
| | | foreach (var item in working.LossCurve.End.Items) |
| | | { |
| | |
| | | currentY += accuracyScaleChart.HeightF; |
| | | var CategoryChart = CreateCategory(working.LossStatistics, 727F, 230F, 0F, currentY); |
| | | Detail.Controls.Add(CategoryChart); |
| | | currentY += CategoryChart.HeightF; |
| | | } |
| | | } |
| | | |