using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Drawing;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Windows.Forms;
|
using System.Data.SqlClient;
|
using System.Diagnostics;
|
using System.Drawing.Drawing2D;
|
|
using DevExpress.XtraEditors;
|
using DevExpress.XtraCharts;
|
using DevExpress.Utils;
|
|
using Eventech.Model;
|
using TProduct.Model;
|
using TProduct.CorpSetting;
|
|
//测试时使用:只有功率和扬程没有效率
|
namespace TProduct.WinFrmUI.TPump
|
{
|
internal partial class ChartLxpNpshCurveCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
#region 私有字段
|
private List<TProduct.Model.PumpNpshTestRecordViewModel> _allRecords = new List<TProduct.Model.PumpNpshTestRecordViewModel>();
|
private List<FeatPoint> _curveInfoQH = null;
|
private List<FeatPoint> _curveInfoQE = null;
|
private List<FeatPoint> _curveInfoQP = null;
|
private TProduct.Model.ProductMainExPump _currentPump = null;
|
private TProduct.Model.RatedParas4Pump _ratedParas = null;
|
private Eventech.Model.PointToleranceParas _toleranceParas = null;
|
#endregion
|
|
#region CHART变量
|
//测试的原始点
|
private Series SeriesQHpoint = null;
|
private Series SeriesQEpoint = null;
|
private Series SeriesQPpoint = null;
|
|
//拟合后的曲线上的点
|
private Series SeriesQHcurve = null;
|
private Series SeriesQEcurve = null;
|
private Series SeriesQPcurve = null;
|
|
//额定点
|
private Series SeriesRatedMarkerH = null;
|
private Series SeriesRatedMarkerV = null;
|
//
|
private DevExpress.XtraCharts.XYDiagram mainChartDiagram;
|
private DevExpress.XtraCharts.XYDiagramPane bottomChartDiagram = null;
|
//
|
AxisX AxisQ = null;
|
AxisY QHAxisY = null;
|
SecondaryAxisY QEAxisY = null;
|
SecondaryAxisY QPAxisY = null;
|
#endregion
|
|
#region 构造函数和加载函数
|
public ChartLxpNpshCurveCtrl()
|
{
|
InitializeComponent();
|
|
#region 图标控件显示
|
|
mainChartDiagram = (XYDiagram)chartControl1.Diagram;
|
for (int i = 0; i < mainChartDiagram.Panes.Count; i++)
|
{
|
var panel = mainChartDiagram.Panes[i];
|
if (panel.Name == "PaneBottom")
|
{
|
bottomChartDiagram = panel;
|
}
|
}
|
//
|
SeriesQHpoint = chartControl1.Series["SeriesQHpoint"];
|
SeriesQEpoint = chartControl1.Series["SeriesQEpoint"];
|
SeriesQPpoint = chartControl1.Series["SeriesQPpoint"];
|
SeriesQHcurve = chartControl1.Series["SeriesQHcurve"];
|
SeriesQEcurve = chartControl1.Series["SeriesQEcurve"];
|
SeriesQPcurve = chartControl1.Series["SeriesQPcurve"];
|
|
|
|
SeriesQHpoint.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
|
SeriesQHcurve.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
|
|
SeriesQEpoint.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
|
SeriesQEcurve.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
|
|
SeriesQPpoint.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
|
SeriesQPcurve.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
|
|
SeriesQHpoint.Visible = false;
|
SeriesQHcurve.Visible = false;
|
SeriesQEpoint.Visible = false;
|
SeriesQEcurve.Visible = false;
|
SeriesQPpoint.Visible = false;
|
SeriesQPcurve.Visible = false;
|
|
SeriesQHcurve.CrosshairEnabled = DefaultBoolean.False;
|
SeriesQEcurve.CrosshairEnabled = DefaultBoolean.False;
|
SeriesQPcurve.CrosshairEnabled = DefaultBoolean.False;
|
|
bottomChartDiagram.Visibility = ChartElementVisibility.Hidden;
|
|
SeriesQHpoint.CrosshairEnabled = DefaultBoolean.False;
|
SeriesQEpoint.CrosshairEnabled = DefaultBoolean.False;
|
SeriesQPpoint.CrosshairEnabled = DefaultBoolean.False;
|
|
|
|
//
|
SeriesRatedMarkerH = chartControl1.Series["SeriesRatedMarkerH"];
|
SeriesRatedMarkerV = chartControl1.Series["SeriesRatedMarkerV"];
|
SeriesRatedMarkerH.Visible = false;
|
SeriesRatedMarkerV.Visible = false;
|
SeriesRatedMarkerH.CrosshairEnabled = DefaultBoolean.False;
|
SeriesRatedMarkerV.CrosshairEnabled = DefaultBoolean.False;
|
|
//
|
AxisQ = mainChartDiagram.AxisX;
|
QHAxisY = mainChartDiagram.AxisY;
|
QEAxisY = mainChartDiagram.SecondaryAxesY.GetAxisByName("QEAxisY");
|
QPAxisY = mainChartDiagram.SecondaryAxesY.GetAxisByName("QPAxisY");
|
|
AxisQ.Visibility = DefaultBoolean.False;
|
QHAxisY.Visibility = DefaultBoolean.False;
|
QEAxisY.Visibility = DefaultBoolean.False;
|
QPAxisY.Visibility = DefaultBoolean.False;
|
|
#endregion
|
|
//if (TPump.Localization.UICulture.IsEnglish)
|
//{//英语
|
// //资源文件
|
// System.ComponentModel.ComponentResourceManager resources
|
// = new System.ComponentModel.ComponentResourceManager(typeof(ChartFeatTestIngCtrl));
|
|
// TPump.Localization.SetResource.ContextMenuStrip(chartRightMenu, resources);
|
// IAxisY.Title.Text = "Head(m)";
|
// InPutPAxisY.Title.Text = "Eff(%)";
|
//}
|
|
this.chartControl1.CustomPaint += new DevExpress.XtraCharts.CustomPaintEventHandler(this.chartControl_CustomPaint);
|
}
|
|
private void LoadWindow(object sender, EventArgs e)
|
{
|
SetChartDisplay();
|
}
|
|
|
//设置显示
|
private void SetChartDisplay()
|
{
|
AxisQ.GridLines.MinorVisible = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.IsDispMinorLineX;
|
QHAxisY.GridLines.MinorVisible = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.IsDispMinorLineY;
|
QEAxisY.GridLines.MinorVisible = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.IsDispMinorLineY;
|
|
AxisQ.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorQ;
|
AxisQ.Label.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorQ;
|
AxisQ.Title.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorQ;
|
AxisQ.MinorCount = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.MinorCountQ;
|
AxisQ.Label.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisLabelFontQ;
|
AxisQ.Title.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisTitleFontQ;
|
|
AxisQ.GridLines.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorX;
|
AxisQ.GridLines.MinorColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorX;
|
AxisQ.GridLines.MinorVisible = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.IsDispMinorLineX;
|
|
QHAxisY.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorH;
|
QHAxisY.Label.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorH;
|
QHAxisY.Title.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorH;
|
QHAxisY.MinorCount = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.MinorCountH;
|
QHAxisY.Label.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisLabelFontH;
|
QHAxisY.Title.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisTitleFontH;
|
QHAxisY.GridLines.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorY;
|
|
QEAxisY.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorE;
|
QEAxisY.Label.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorE;
|
QEAxisY.Title.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorE;
|
QEAxisY.MinorCount = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.MinorCountE;
|
QEAxisY.Label.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisLabelFontE;
|
QEAxisY.Title.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisTitleFontE;
|
QEAxisY.GridLines.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorY;
|
|
SeriesQHcurve.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CurveColorQH;
|
SeriesQEcurve.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CurveColorQE;
|
SeriesQPcurve.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CurveColorQP;
|
|
SeriesQHpoint.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointColorQH;
|
(SeriesQHpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Size = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointSizeQH;
|
(SeriesQHpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Kind = (MarkerKind)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointKindQH;
|
|
SeriesQPpoint.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointColorQP;
|
(SeriesQPpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Size = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointSizeQP;
|
(SeriesQPpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Kind = (MarkerKind)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointKindQP;
|
|
SeriesQEpoint.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointColorQE;
|
(SeriesQEpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Size = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointSizeQE;
|
(SeriesQEpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Kind = (MarkerKind)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointKindQE;
|
|
|
|
AxisQ.GridLines.LineStyle.DashStyle = (DevExpress.XtraCharts.DashStyle)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLineTypeX;
|
QHAxisY.GridLines.LineStyle.DashStyle = (DevExpress.XtraCharts.DashStyle)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLineTypeY;
|
QEAxisY.GridLines.LineStyle.DashStyle = (DevExpress.XtraCharts.DashStyle)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLineTypeY;
|
QPAxisY.GridLines.LineStyle.DashStyle = (DevExpress.XtraCharts.DashStyle)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLineTypeY;
|
|
SeriesRatedMarkerH.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.RatedLineColor;
|
SeriesRatedMarkerV.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.RatedLineColor;
|
|
(SeriesRatedMarkerH.View as DevExpress.XtraCharts.LineSeriesView).LineStyle.Thickness = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.RatedLineWidth;
|
(SeriesRatedMarkerV.View as DevExpress.XtraCharts.LineSeriesView).LineStyle.Thickness = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.RatedLineWidth;
|
|
QPAxisY.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorP;
|
QPAxisY.Label.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorP;
|
QPAxisY.Title.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorP;
|
QPAxisY.MinorCount = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.MinorCountE;
|
QPAxisY.Label.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisLabelFontE;
|
QPAxisY.Title.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisTitleFontE;
|
QPAxisY.GridLines.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorY;
|
}
|
#endregion
|
|
|
#region 设置
|
//
|
internal void EmptyRecordPoint()
|
{
|
_allRecords = new List<PumpNpshTestRecordViewModel>();
|
_curveInfoQH = null;
|
_curveInfoQE = null;
|
_curveInfoQP = null;
|
ReCalcFitPoint();
|
}
|
|
|
internal void SetRecordPoint(List<TProduct.Model.PumpNpshTestRecordViewModel> pointInfos)
|
{
|
if (pointInfos == null || pointInfos.Count == 0)
|
return;
|
_allRecords = pointInfos;
|
ReCalcFitPoint();
|
}
|
|
//计算
|
private void ReCalcFitPoint()
|
{
|
//if (_allRecords == null || _allRecords.Count < 1)
|
//{
|
// UpdateChart();
|
// return;
|
//}
|
|
//List<FeatPoint> PointInfoQH = new List<FeatPoint>();
|
//List<FeatPoint> PointInfoQE = new List<FeatPoint>();
|
//List<FeatPoint> PointInfoQP = new List<FeatPoint>();
|
|
//foreach (var pt in _allRecords)
|
//{
|
// PointInfoQH.Add(new FeatPoint(pt.CorrectPtQ, pt.CorrectPtH));
|
// if (pt.CorrectPtE.HasValue)
|
// PointInfoQE.Add(new FeatPoint(pt.CorrectPtQ, pt.CorrectPtE.Value));
|
// if (pt.CorrectPtP.HasValue)
|
// PointInfoQP.Add(new FeatPoint(pt.CorrectPtQ, pt.CorrectPtP.Value));
|
//}
|
//this._curveInfoQH = null;
|
//if (this._currentPump.CurveFitTypeQH == eCurveFitType.FourM)
|
//{
|
// if (PointInfoQH.Count >= 5)
|
// {
|
// this._curveInfoQH = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQH, this._currentPump.CurveFitTypeQH, 12);
|
// }
|
//}
|
//else if (this._currentPump.CurveFitTypeQH == eCurveFitType.CubicCurve)
|
//{
|
// if (PointInfoQH.Count >= 4)
|
// {
|
// this._curveInfoQH = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQH, this._currentPump.CurveFitTypeQH, 12);
|
// }
|
//}
|
//else
|
//{
|
// if (PointInfoQH.Count >= 3)
|
// {
|
// this._curveInfoQH = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQH, this._currentPump.CurveFitTypeQH, 12);
|
// }
|
//}
|
|
//this._curveInfoQE = null;
|
//if (this._currentPump.CurveFitTypeQE == eCurveFitType.FourM)
|
//{
|
// if (PointInfoQE.Count >= 5)
|
// {
|
// this._curveInfoQE = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQE, this._currentPump.CurveFitTypeQE, 12);
|
// }
|
//}
|
//else if (this._currentPump.CurveFitTypeQE == eCurveFitType.CubicCurve)
|
//{
|
// if (PointInfoQE.Count >= 4)
|
// {
|
// this._curveInfoQE = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQE, this._currentPump.CurveFitTypeQE, 12);
|
// }
|
//}
|
//else
|
//{
|
// if (PointInfoQE.Count >= 3)
|
// {
|
// this._curveInfoQE = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQE, this._currentPump.CurveFitTypeQE, 12);
|
// }
|
//}
|
|
//this._curveInfoQP = null;
|
//if (this._currentPump.CurveFitTypeQP == eCurveFitType.FourM)
|
//{
|
// if (PointInfoQP.Count >= 5)
|
// {
|
// this._curveInfoQP = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQP, this._currentPump.CurveFitTypeQP, 12);
|
// }
|
//}
|
//else if (this._currentPump.CurveFitTypeQP == eCurveFitType.CubicCurve)
|
//{
|
// if (PointInfoQP.Count >= 4)
|
// {
|
// this._curveInfoQP = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQP, this._currentPump.CurveFitTypeQP, 12);
|
// }
|
//}
|
//else
|
//{
|
// if (PointInfoQP.Count >= 3)
|
// {
|
// this._curveInfoQP = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQP, this._currentPump.CurveFitTypeQP, 12);
|
// }
|
//}
|
|
////重新更新图表
|
//UpdateChart();
|
}
|
|
//
|
|
public void SetRatedParas(
|
TProduct.Model.ProductMainExPump pump,
|
TProduct.Model.RatedParas4Pump ratedParas,
|
List<Model.TestGradeJudgeItem> testJudgeItems)
|
{
|
this._currentPump = pump;
|
this._ratedParas = ratedParas;
|
if (ratedParas == null)
|
return;
|
|
RefreshJudgeItem(testJudgeItems);
|
|
CalcCoordByRatedParas();
|
}
|
|
public void RefreshJudgeItem(List<Model.TestGradeJudgeItem> testJudgeItems)
|
{
|
if (this._ratedParas == null)
|
return;
|
|
_toleranceParas = new PointToleranceParas();
|
var flow_min = testJudgeItems.Find(x => x.TargeType == eTestJudgeTargetType.流量 && x.ThresholdType == TestGradeJudgeItem.eThresholdType.Min);
|
if (flow_min != null)
|
{
|
_toleranceParas.TolRatioMinQ = flow_min.ThresholdValue;
|
}
|
var flow_max = testJudgeItems.Find(x => x.TargeType == eTestJudgeTargetType.流量 && x.ThresholdType == TestGradeJudgeItem.eThresholdType.Max);
|
if (flow_max != null)
|
{
|
_toleranceParas.TolRatioMaxQ = flow_max.ThresholdValue;
|
}
|
|
var head_min = testJudgeItems.Find(x => x.TargeType == eTestJudgeTargetType.扬程 && x.ThresholdType == TestGradeJudgeItem.eThresholdType.Min);
|
if (head_min != null)
|
{
|
_toleranceParas.TolRatioMinH = head_min.ThresholdValue;
|
}
|
var head_max = testJudgeItems.Find(x => x.TargeType == eTestJudgeTargetType.扬程 && x.ThresholdType == TestGradeJudgeItem.eThresholdType.Max);
|
if (head_max != null)
|
{
|
_toleranceParas.TolRatioMaxH = head_max.ThresholdValue;
|
}
|
}
|
|
Eventech.Model.FeatPoint _judgePoint = null;
|
internal void SetJudgePoint(FeatPoint judgePoint)
|
{
|
this._judgePoint = judgePoint;
|
}
|
bool _isDispJudgePoint = false;
|
public void SetJudgePointDisp(bool isDisp)
|
{
|
this._isDispJudgePoint = isDisp; this.Invalidate();
|
}
|
EquipCurveParas _equipCurve = null;
|
internal void SetEquipCurve(EquipCurveParas equipCurve)
|
{
|
this._equipCurve = equipCurve;
|
}
|
bool _isDispEquipCurve = false;
|
public void SetEquipCurveDisp(bool isDisp)
|
{
|
this._isDispEquipCurve = isDisp;
|
this.Invalidate();
|
}
|
#endregion
|
|
|
#region 坐标
|
//坐标
|
private Eventech.Model.LxpCoordinateParas _coordinateParas = null;
|
private double _coordMinQ = 0, _coordMaxQ = 0;//流量从0开始
|
private double _coordMinH = 10000, _coordMaxH = 0;
|
private double _coordMinP = 10000, _coordMaxP = 0;
|
private double _coordMaxE = 0;
|
|
//计算坐标
|
internal bool CheckCoordinate()
|
{
|
if (_allRecords == null || _allRecords.Count < 1)
|
{
|
return false;
|
}
|
|
bool isReBuildCoordinate = false;
|
|
double maxQ = Math.Max(_coordMaxQ, this._ratedParas.Q);
|
double maxH = Math.Max(_coordMaxH, this._ratedParas.H);
|
double minH = _coordMinH;
|
double maxE = _coordMaxE;
|
double maxP = _coordMaxP;
|
double minP = _coordMinP;
|
|
|
//foreach (var pt in _allRecords)
|
//{
|
// maxQ = Math.Max(maxQ, pt.CorrectPtQ);
|
// maxH = Math.Max(maxH, pt.CorrectPtH);
|
// minH = Math.Min(minH, pt.CorrectPtH);
|
// if (pt.CorrectPtE != null)
|
// {
|
// maxE = Math.Max(maxE, pt.CorrectPtE.Value);
|
// }
|
// if (pt.CorrectPtP != null)
|
// {
|
// minP = Math.Min(minP, pt.CorrectPtP.Value);
|
// maxP = Math.Max(maxP, pt.CorrectPtP.Value);
|
// }
|
//}
|
|
if (maxQ > _coordMaxQ)
|
{
|
if (maxQ < 100)
|
maxQ = maxQ * 1.2;
|
else if (maxQ < 300)
|
maxQ = maxQ * 1.1;
|
else
|
maxQ = maxQ * 1.02;
|
|
isReBuildCoordinate = true;
|
}
|
if (maxH > _coordMaxH || minH < _coordMinH)
|
{
|
minH = minH * 0.95;
|
maxH = maxH * 1.1;
|
isReBuildCoordinate = true;
|
}
|
if (maxP > _coordMaxP || minP < _coordMinP)
|
{
|
minP = minP * 0.95;
|
maxP = maxP * 1.1;
|
isReBuildCoordinate = true;
|
}
|
if (maxE > _coordMaxE)
|
{
|
isReBuildCoordinate = true;
|
}
|
|
|
//检查是否需要重建坐标
|
if (_coordinateParas == null)
|
{
|
isReBuildCoordinate = true;//原来没有,就必须重建坐标系
|
_coordinateParas = new LxpCoordinateParas();
|
_coordinateParas.GridNumberX = 10;
|
_coordinateParas.GridNumberY = 12;
|
}
|
|
//不重建坐标就不用继续了
|
if (!isReBuildCoordinate)
|
return false;
|
|
//流量
|
double minQ = 0;//流量从0开始
|
_coordinateParas.CoordSpaceQ = Eventech.Common.CoordinateHelper.GetOptimalSpaceMin(minQ, maxQ, 10, out _coordMinQ, out _coordMaxQ);
|
_coordMinQ = Math.Max(0, _coordMinQ);//防止跑到负数去
|
_coordinateParas.CoordMinQ = _coordMinQ;
|
_coordMaxQ = _coordMinQ;
|
_coordinateParas.GridNumberX = 1;
|
while (_coordMaxQ < maxQ)
|
{
|
_coordMaxQ = _coordMaxQ + _coordinateParas.CoordSpaceQ;
|
_coordinateParas.GridNumberX++;
|
}
|
|
//扬程(保证最大值显示)
|
_coordinateParas.StartLineNoH = 4;
|
_coordinateParas.EndLineNoH = 12;
|
_coordinateParas.CoordSpaceH = Eventech.Common.CoordinateHelper.GetOptimalSpaceMax(minH, maxH, 8,
|
out _coordMinH, out _coordMaxH);
|
if (_ratedParas != null)
|
{
|
double minSpaceH = Eventech.Common.CoordinateHelper.GetOptimalSpace(_ratedParas.H / 8);
|
_coordinateParas.CoordSpaceH = Math.Max(minSpaceH, Eventech.Common.CoordinateHelper.GetOptimalSpaceMax(minH, maxH, 10, out _coordMinH, out _coordMaxH));
|
}
|
//计算扬程有效刻度
|
double disH = _coordMaxH;
|
_coordinateParas.StartLineNoH = _coordinateParas.EndLineNoH;
|
while (disH > minH || (_coordinateParas.EndLineNoH - _coordinateParas.StartLineNoH) < 5)
|
{
|
disH = disH - _coordinateParas.CoordSpaceH;
|
if (disH < 0)
|
break;
|
_coordinateParas.StartLineNoH--;
|
}
|
//
|
_coordinateParas.CoordMinH = _coordMaxH - _coordinateParas.EndLineNoH * _coordinateParas.CoordSpaceH;
|
|
//功率(保证最小值显示)
|
_coordinateParas.StartLineNoP = 0;
|
_coordinateParas.EndLineNoP = 5;
|
|
//计算间隔
|
_coordinateParas.CoordSpaceP = Eventech.Common.CoordinateHelper.GetOptimalSpaceMin(minP, maxP,
|
5, out _coordMinP, out _coordMaxP);
|
_coordinateParas.CoordMinP = _coordMaxP - _coordinateParas.EndLineNoP * _coordinateParas.CoordSpaceP;
|
|
|
//效率
|
if (maxE < 50)
|
{
|
_coordinateParas.StartLineNoE = 0;
|
_coordinateParas.EndLineNoE = 10;
|
_coordinateParas.CoordSpaceE = 5;
|
_coordinateParas.CoordMinE = 0;
|
_coordMaxE = 50;
|
}
|
else if (maxE < 75)
|
{
|
_coordinateParas.StartLineNoE = 0;
|
_coordinateParas.EndLineNoE = 10;
|
_coordinateParas.CoordSpaceE = 7.5;
|
_coordinateParas.CoordMinE = 0;
|
_coordMaxE = 75;
|
}
|
else
|
{
|
_coordinateParas.StartLineNoE = 0;
|
_coordinateParas.EndLineNoE = 10;
|
_coordinateParas.CoordSpaceE = 10;
|
_coordinateParas.CoordMinE = 0;
|
_coordMaxE = 100;
|
}
|
|
return isReBuildCoordinate;
|
}
|
|
//根据额定参数计算坐标
|
private void CalcCoordByRatedParas()
|
{
|
if (this._ratedParas == null)
|
return;
|
_coordinateParas = new Eventech.Model.LxpCoordinateParas();
|
_coordinateParas.GridNumberX = 10;
|
_coordinateParas.GridNumberY = 12;
|
|
double maxQ = Math.Round(this._ratedParas.Q * 1.2, 2);//流量从0开始
|
double maxH = Math.Round(this._ratedParas.H * 1.1, 2), minH = Math.Round(this._ratedParas.H * 0.8, 2);
|
|
//流量
|
double minQ = 0;//流量从0开始
|
_coordinateParas.CoordSpaceQ = Eventech.Common.CoordinateHelper.GetOptimalSpaceMin(minQ, maxQ, 10, out _coordMinQ, out _coordMaxQ);
|
_coordMinQ = Math.Max(0, _coordMinQ);//防止跑到负数去
|
_coordinateParas.CoordMinQ = _coordMinQ;
|
_coordMaxQ = _coordMinQ;
|
_coordinateParas.GridNumberX = 1;
|
while (_coordMaxQ < maxQ * 1.05)
|
{
|
_coordMaxQ = _coordMaxQ + _coordinateParas.CoordSpaceQ;
|
_coordinateParas.GridNumberX++;
|
}
|
|
//扬程(保证最大值显示)
|
_coordinateParas.StartLineNoH = 4;
|
_coordinateParas.EndLineNoH = 12;
|
_coordinateParas.CoordSpaceH = Eventech.Common.CoordinateHelper.GetOptimalSpaceMax(minH, maxH, 8, out _coordMinH, out _coordMaxH);
|
|
double minSpaceH = Eventech.Common.CoordinateHelper.GetOptimalSpace(this._ratedParas.H / 8);
|
_coordinateParas.CoordSpaceH = Math.Max(minSpaceH, Eventech.Common.CoordinateHelper.GetOptimalSpaceMax(minH, maxH, 10, out _coordMinH, out _coordMaxH));
|
|
|
//计算扬程有效刻度
|
double disH = _coordMaxH;
|
_coordinateParas.StartLineNoH = _coordinateParas.EndLineNoH;
|
while (disH > minH * 0.98 || (_coordinateParas.EndLineNoH - _coordinateParas.StartLineNoH) < 5)
|
{
|
disH = disH - _coordinateParas.CoordSpaceH;
|
if (disH < 0)
|
break;
|
_coordinateParas.StartLineNoH--;
|
}
|
//
|
_coordinateParas.CoordMinH = _coordMaxH - _coordinateParas.EndLineNoH * _coordinateParas.CoordSpaceH;
|
|
//效率
|
if (this._ratedParas.E < 50)
|
{
|
_coordinateParas.StartLineNoE = 0;
|
_coordinateParas.EndLineNoE = 10;
|
_coordinateParas.CoordSpaceE = 5;
|
_coordinateParas.CoordMinE = 0;
|
_coordMaxE = 50;
|
}
|
else if (this._ratedParas.E < 75)
|
{
|
_coordinateParas.StartLineNoE = 0;
|
_coordinateParas.EndLineNoE = 10;
|
_coordinateParas.CoordSpaceE = 7.5;
|
_coordinateParas.CoordMinE = 0;
|
_coordMaxE = 75;
|
}
|
else
|
{
|
_coordinateParas.StartLineNoE = 0;
|
_coordinateParas.EndLineNoE = 10;
|
_coordinateParas.CoordSpaceE = 10;
|
_coordinateParas.CoordMinE = 0;
|
_coordMaxE = 100;
|
}
|
|
_coordinateParas.StartLineNoP = 0;
|
_coordinateParas.EndLineNoP = 10;
|
_coordinateParas.CoordSpaceP = 1;
|
_coordinateParas.CoordMinP = 0;
|
}
|
|
//更新图表坐标
|
internal void UpdateCoordinate()
|
{
|
//先设置为不显示
|
AxisQ.Visibility = DefaultBoolean.False;
|
QHAxisY.GridLines.Visible = false;
|
QHAxisY.Visibility = DefaultBoolean.False;
|
QEAxisY.GridLines.Visible = false;
|
QEAxisY.Visibility = DefaultBoolean.False;
|
|
if (_coordinateParas == null)
|
return;
|
|
//流量坐标刻度
|
List<CustomAxisLabel> q_Label_List = new List<CustomAxisLabel>();
|
AxisQ.CustomLabels.Clear();
|
double disQ = _coordinateParas.CoordMinQ;
|
for (int i = 0; i < _coordinateParas.GridNumberX + 1; i++)
|
{
|
q_Label_List.Add(new CustomAxisLabel(disQ.ToString(), disQ));
|
disQ = disQ + _coordinateParas.CoordSpaceQ;
|
}
|
AxisQ.CustomLabels.AddRange(q_Label_List.ToArray());
|
this._coordMinQ = _coordinateParas.CoordMinQ ;
|
this._coordMaxQ = _coordinateParas.DispMaxQ() ;
|
|
//设置显示
|
TProduct.WinFrmUI.XtraChartHelper.SetAxisRange(AxisQ, _coordinateParas.CoordMinQ,
|
_coordinateParas.CoordMinQ + _coordinateParas.GridNumberX * _coordinateParas.CoordSpaceQ);
|
AxisQ.GridLines.Visible = true;
|
AxisQ.Visibility = DefaultBoolean.True;
|
|
|
//扬程坐标刻度
|
QHAxisY.CustomLabels.Clear();
|
List<CustomAxisLabel> h_Label_List = new List<CustomAxisLabel>();
|
double disH = _coordinateParas.CoordMinH + _coordinateParas.CoordSpaceH * _coordinateParas.StartLineNoH;
|
for (int i = _coordinateParas.StartLineNoH; i < _coordinateParas.EndLineNoH + 1; i++)
|
{
|
h_Label_List.Add(new CustomAxisLabel(disH < 0 ? "" : disH.ToString(), disH));
|
disH = disH + _coordinateParas.CoordSpaceH;
|
}
|
QHAxisY.CustomLabels.AddRange(h_Label_List.ToArray());
|
//设置显示
|
TProduct.WinFrmUI.XtraChartHelper.SetAxisRange(QHAxisY, _coordinateParas.CoordMinH,
|
_coordinateParas.CoordMinH + _coordinateParas.GridNumberY * _coordinateParas.CoordSpaceH);
|
QHAxisY.GridLines.Visible = true;
|
QHAxisY.Visibility = DefaultBoolean.True;
|
this._coordMinH = _coordinateParas.DispMinH();
|
this._coordMaxH = _coordinateParas.DispMaxH();
|
|
//功率坐标刻度
|
QPAxisY.CustomLabels.Clear();
|
List<CustomAxisLabel> P_Label_List = new List<CustomAxisLabel>();
|
double disP = _coordinateParas.CoordMinP + _coordinateParas.CoordSpaceP * _coordinateParas.StartLineNoP;
|
for (int i = _coordinateParas.StartLineNoP; i < _coordinateParas.EndLineNoP + 1; i++)
|
{
|
P_Label_List.Add(new CustomAxisLabel(disP < 0 ? "" : disP.ToString(), disP));
|
disP = disP + _coordinateParas.CoordSpaceP;
|
}
|
QPAxisY.CustomLabels.AddRange(P_Label_List.ToArray());
|
//设置显示
|
TProduct.WinFrmUI.XtraChartHelper.SetAxisRange(QPAxisY,
|
_coordinateParas.CoordMinP + _coordinateParas.StartLineNoP * _coordinateParas.CoordSpaceP,
|
_coordinateParas.CoordMinP + _coordinateParas.EndLineNoP * _coordinateParas.CoordSpaceP);
|
QPAxisY.GridLines.Visible = _isDispQP ;
|
this.QPAxisY.Visibility = _isDispQP ? DefaultBoolean.True : DefaultBoolean.False;
|
this._coordMinP = _coordinateParas.DispMinP();
|
this._coordMaxP = _coordinateParas.DispMaxP();
|
|
|
//效率坐标刻度
|
QEAxisY.CustomLabels.Clear();
|
List<CustomAxisLabel> E_Label_List = new List<CustomAxisLabel>();
|
double disE = _coordinateParas.CoordMinE + _coordinateParas.CoordSpaceE * _coordinateParas.StartLineNoE;
|
for (int i = _coordinateParas.StartLineNoE; i < _coordinateParas.EndLineNoE + 1; i++)
|
{
|
E_Label_List.Add(new CustomAxisLabel(disE < 0 ? "" : disE.ToString(), disE));
|
disE = disE + _coordinateParas.CoordSpaceE;
|
}
|
QEAxisY.CustomLabels.AddRange(E_Label_List.ToArray());
|
//设置显示
|
TProduct.WinFrmUI.XtraChartHelper.SetAxisRange(QEAxisY, _coordinateParas.CoordMinE,
|
_coordinateParas.CoordMinE + _coordinateParas.GridNumberY * _coordinateParas.CoordSpaceE);
|
QEAxisY.GridLines.Visible = true;
|
this.QEAxisY.Visibility = _isDispQE ? DefaultBoolean.True : DefaultBoolean.False;
|
//this._coordMinE = _coordinateParas.DispMinE();
|
this._coordMaxE = _coordinateParas.DispMaxE();
|
|
if (OnChangeCoordinate != null)
|
{
|
OnChangeCoordinate(_coordinateParas);
|
}
|
}
|
|
public Eventech.Model.LxpCoordinateParas GetCoordinateParas()
|
{
|
return _coordinateParas;
|
}
|
public Action<Eventech.Model.LxpCoordinateParas> OnChangeCoordinate = null;
|
public void SetCoordinateParas(Eventech.Model.LxpCoordinateParas coordinateParas,bool isRefresh=false)
|
{
|
this._coordinateParas = coordinateParas;
|
if (coordinateParas == null)
|
return;
|
|
if (isRefresh)
|
UpdateCoordinate();
|
}
|
#endregion
|
|
#region 更新
|
|
//更新所有
|
internal void UpdateChart(bool isCalcCoord= true)
|
{
|
if(isCalcCoord || this._coordinateParas == null)
|
{
|
//判断是否要重建坐标系
|
bool isReBuildCoordinate = CheckCoordinate();
|
|
if (isReBuildCoordinate)
|
UpdateCoordinate();
|
}
|
|
|
UpdateTestPoints();
|
|
UpdateRatedParas();
|
}
|
|
|
|
//更新所有点
|
public void UpdateTestPoints()
|
{
|
if (_allRecords == null)
|
{
|
SeriesQHpoint.Visible = false;
|
SeriesQHcurve.Visible = false;
|
|
SeriesQEpoint.Visible = false;
|
SeriesQEcurve.Visible = false;
|
|
SeriesQPpoint.Visible = false;
|
SeriesQPcurve.Visible = false;
|
return;
|
}
|
|
//SeriesQHpoint.Visible = true;
|
//SeriesQEpoint.Visible = this._isDispQE;
|
//SeriesQPpoint.Visible = this._isDispQP;
|
|
//SeriesQHpoint.Points.Clear();
|
//SeriesQEpoint.Points.Clear();
|
//SeriesQPpoint.Points.Clear();
|
|
//int i ;
|
//for (i = 0; i < _allRecords.Count(); i++)
|
//{
|
// SeriesQHpoint.Points.Add(new SeriesPoint(_allRecords[i].CorrectPtQ, new double[] { _allRecords[i].CorrectPtH }));
|
|
// if (_allRecords[i].CorrectPtP != null)
|
// SeriesQPpoint.Points.Add(new SeriesPoint(_allRecords[i].CorrectPtQ, new double[] { _allRecords[i].CorrectPtP.Value }));
|
|
// if (_allRecords[i].CorrectPtE != null)
|
// SeriesQEpoint.Points.Add(new SeriesPoint(_allRecords[i].CorrectPtQ, new double[] { _allRecords[i].CorrectPtE.Value }));
|
//}
|
|
//if (_allRecords.Count < 4)
|
//{
|
// SeriesQHcurve.Visible = false;
|
// SeriesQEcurve.Visible = false;
|
// SeriesQPcurve.Visible = false;
|
// return;
|
//}
|
|
|
//SeriesQHcurve.Visible = true;
|
//SeriesQHcurve.Points.Clear();
|
|
//SeriesQEcurve.Visible = this._isDispQE;
|
//SeriesQEcurve.Points.Clear();
|
|
//SeriesQPcurve.Visible = this._isDispQP;
|
//SeriesQPcurve.Points.Clear();
|
|
//if (_curveInfoQH != null && _curveInfoQH.Count > 3)
|
//{
|
// for (i = 0; i < _curveInfoQH.Count(); i++)
|
// {
|
// SeriesQHcurve.Points.Add(new SeriesPoint(_curveInfoQH[i].X, new double[] { _curveInfoQH[i].Y }));
|
// }
|
//}
|
|
//if (_curveInfoQE != null && _curveInfoQE.Count > 3)
|
//{
|
// for (i = 0; i < _curveInfoQE.Count(); i++)
|
// {
|
// SeriesQEcurve.Points.Add(new SeriesPoint(_curveInfoQE[i].X, new double[] { _curveInfoQE[i].Y }));
|
// }
|
//}
|
|
//if (_curveInfoQP != null && _curveInfoQP.Count > 3)
|
//{
|
// for (i = 0; i < _curveInfoQP.Count(); i++)
|
// {
|
// SeriesQPcurve.Points.Add(new SeriesPoint(_curveInfoQP[i].X, new double[] { _curveInfoQP[i].Y }));
|
// }
|
//}
|
|
|
}
|
|
//更新额定参数
|
public void UpdateRatedParas()
|
{
|
if (this._ratedParas == null || this._ratedParas.Q < 0.1)
|
return;
|
if (_toleranceParas == null)
|
return;
|
|
double maxQ = _toleranceParas.TolRatioMaxQ * this._ratedParas.Q;
|
double minQ = _toleranceParas.TolRatioMinQ * this._ratedParas.Q;
|
double maxH = _toleranceParas.TolRatioMaxH * this._ratedParas.H;
|
double minH = _toleranceParas.TolRatioMinH * this._ratedParas.H;
|
|
|
if (maxQ > minQ)
|
{
|
SeriesRatedMarkerH.Points.Clear();
|
SeriesRatedMarkerH.Points.Add(new SeriesPoint(minQ,
|
new double[] { _ratedParas.H }));
|
SeriesRatedMarkerH.Points.Add(new SeriesPoint(maxQ,
|
new double[] { _ratedParas.H }));
|
SeriesRatedMarkerH.Visible = true;
|
|
// ((LineSeriesView)SeriesRatedMarkerV.View).MarkerVisibility = DefaultBoolean.True;
|
}
|
else
|
{
|
SeriesRatedMarkerH.Visible = false;
|
}
|
|
if (maxH > minH)
|
{
|
SeriesRatedMarkerV.Points.Clear();
|
SeriesRatedMarkerV.Points.Add(new SeriesPoint(_ratedParas.Q,
|
new double[] { minH }));
|
SeriesRatedMarkerV.Points.Add(new SeriesPoint(_ratedParas.Q,
|
new double[] { maxH }));
|
SeriesRatedMarkerV.Visible = true;
|
|
// ((LineSeriesView)SeriesRatedMarkerH.View).MarkerVisibility = DefaultBoolean.True;
|
}
|
else
|
{
|
SeriesRatedMarkerV.Visible = false;
|
}
|
}
|
#endregion
|
|
#region 重绘
|
|
void chartControl_CustomPaint(object sender, CustomPaintEventArgs e)
|
{
|
//Graphics g = e.Graphics;
|
if (_coordinateParas == null)
|
return;
|
|
Graphics g = e.Graphics;
|
//g.SetClip(CalculateDiagramBounds());
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
|
if (_judgePoint != null && this._isDispJudgePoint)
|
{
|
using (Pen penCurve = new Pen(System.Drawing.Color.Red, 5f))
|
{
|
ControlCoordinates coor = mainChartDiagram.DiagramToPoint(_judgePoint.X,
|
_judgePoint.Y, AxisQ, QHAxisY);
|
g.DrawEllipse(penCurve, coor.Point.X - 4, coor.Point.Y - 4, 8, 8);
|
}
|
}
|
|
if(_equipCurve != null && this._isDispEquipCurve && _equipCurve.CurveInfo != null && _equipCurve.CurveInfo.Count>3)
|
{
|
List<PointF> points = new List<PointF>();
|
foreach(var pt in _equipCurve.CurveInfo)
|
{
|
ControlCoordinates coor = mainChartDiagram.DiagramToPoint(pt.X,
|
pt.Y, AxisQ, QHAxisY);
|
points.Add(coor.Point);
|
}
|
using (Pen penCurve = new Pen(System.Drawing.Color.PaleVioletRed, 2f))
|
{
|
g.DrawCurve(penCurve, points.ToArray(), 0.5F);
|
}
|
|
}
|
|
|
chartControl1.DrawCorpLogo(g);
|
}
|
private void DrawCurve(List<Point> points, Eventech.Model.CombineCurve equalCurve, Graphics g, Color curveColor)
|
{
|
//去掉重曲线复点
|
Point[] pointArray = points.Distinct().ToArray();
|
|
//写字
|
//using (SolidBrush brushTextQP = new SolidBrush(curveColor))
|
//using (Font fontTextQP = TProduct.WinFrmUI.CorpSkinStyleHelper.GetDefaultFont())
|
//{
|
// g.DrawString(equalCurve.CurvePara.ToString(), fontTextQP, brushTextQP,
|
// pointArray.First().X, pointArray.First().Y - 15);
|
//}
|
|
//绘制曲线
|
if (pointArray.Length > 2)
|
{
|
using (Pen penCurve = new Pen(curveColor, 3f))
|
{
|
if (equalCurve.IsClosed)
|
{
|
System.Drawing.Drawing2D.FillMode aFillMode = System.Drawing.Drawing2D.FillMode.Alternate;
|
g.DrawClosedCurve(penCurve, pointArray, equalCurve.DispTension, aFillMode);
|
}
|
else
|
{//DrawBeziers
|
g.DrawCurve(penCurve, pointArray, equalCurve.DispTension);
|
}
|
}
|
}
|
else if (pointArray.Length == 2)
|
{
|
using (Pen penCurve = new Pen(curveColor, 3f))
|
{
|
g.DrawLine(penCurve, pointArray[0], pointArray[1]);
|
}
|
}
|
else if (pointArray.Length == 1)
|
{
|
using (var brsh = new SolidBrush(curveColor))
|
{
|
Rectangle rc = new Rectangle(pointArray[0].X - 2, pointArray[0].Y - 2, 4, 4);
|
g.FillEllipse(brsh, rc);
|
}
|
}
|
}
|
|
#endregion
|
|
private bool _isDispCoodText = true;
|
public void SetAxisTitle(bool isDisp)
|
{
|
_isDispCoodText = isDisp;
|
QHAxisY.Title.Visibility = _isDispCoodText ? DefaultBoolean.True : DefaultBoolean.False;
|
QEAxisY.Title.Visibility = _isDispCoodText ? DefaultBoolean.True : DefaultBoolean.False;
|
}
|
|
private bool _isDispQE = true;
|
public void SetEtaDisp(bool isDisp)
|
{
|
this._isDispQE = isDisp;
|
this.SeriesQEpoint.Visible = _isDispQE;
|
this.SeriesQEcurve.Visible = _isDispQE;
|
this.QEAxisY.Visibility = _isDispQE ? DefaultBoolean.True : DefaultBoolean.False;
|
}
|
|
private bool _isDispQP = false;
|
public void SetPowerDisp(bool isDisp)
|
{
|
bottomChartDiagram.Visibility = isDisp? ChartElementVisibility.Visible : ChartElementVisibility.Hidden;
|
_isDispQP = isDisp;
|
SeriesQPpoint.Visible = _isDispQP;
|
SeriesQPcurve.Visible = _isDispQP;
|
QPAxisY.GridLines.Visible = _isDispQP;
|
this.QPAxisY.Visibility = _isDispQP ? DefaultBoolean.True : DefaultBoolean.False;
|
}
|
|
|
private bool isDispQlabel = false;
|
private void 显示流量值MenuItem_Click(object sender, EventArgs e)
|
{
|
isDispQlabel = !isDispQlabel;
|
if (isDispQlabel)
|
{
|
显示流量值MenuItem.Text = "不显示流量值";
|
}
|
else
|
{
|
显示流量值MenuItem.Text = "显示流量值";
|
}
|
SetQHpointLabel();
|
}
|
|
private bool isDispHlabel = false;
|
private void 显示扬程值MenuItem_Click(object sender, EventArgs e)
|
{
|
isDispHlabel = !isDispHlabel;
|
if (isDispHlabel)
|
{
|
显示扬程值MenuItem.Text = "不显示扬程值";
|
}
|
else
|
{
|
显示扬程值MenuItem.Text = "显示扬程值";
|
}
|
SetQHpointLabel();
|
}
|
|
private void SetQHpointLabel()
|
{
|
if (!isDispQlabel && !isDispHlabel)
|
{
|
//SeriesIPoint.Label.Visible = false;
|
SeriesQHpoint.LabelsVisibility = DefaultBoolean.False;
|
}
|
else
|
{
|
/// SeriesIPoint.Label.Visible = true;
|
SeriesQHpoint.LabelsVisibility = DefaultBoolean.True;
|
if (!isDispQlabel && isDispHlabel)
|
{
|
SeriesQHpoint.Label.TextPattern = "{V}";
|
//SeriesIPoint.Label.PointOptions.PointView = PointView.Values;
|
}
|
else if (isDispQlabel && !isDispHlabel)
|
{
|
SeriesQHpoint.Label.TextPattern = "{A}";
|
// SeriesIPoint.Label.PointOptions.PointView = PointView.Argument;
|
}
|
else
|
{
|
SeriesQHpoint.Label.TextPattern = "{A},{V}";
|
// SeriesIPoint.Label.PointOptions.PointView = PointView.ArgumentAndValues;
|
}
|
}
|
}
|
|
private bool isDispPlabel = false;
|
private void 显示功率值MenuItem_Click(object sender, EventArgs e)
|
{
|
isDispPlabel = !isDispPlabel;
|
if (isDispPlabel)
|
{
|
显示功率值MenuItem.Text = "不显示功率值";
|
//SeriesInputPpoint.Label.Visible = true;
|
SeriesQEpoint.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
|
}
|
else
|
{
|
显示功率值MenuItem.Text = "显示功率值";
|
//SeriesInputPpoint.Label.Visible = false;
|
SeriesQEpoint.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
|
}
|
}
|
|
|
#region 面板风格
|
|
protected TProduct.Model.eChartDiagramPanelStyle _chartPanelStyle = TProduct.Model.eChartDiagramPanelStyle.Whole;
|
|
public void SetChartPanelStyleParas(TProduct.Model.eChartDiagramPanelStyle style)
|
{
|
_chartPanelStyle = style;
|
SetChartPanelStyle();
|
}
|
|
//0 是一整块 1 上面扬程效率 下面功率汽蚀
|
public virtual void SetChartPanelStyle()
|
{
|
}
|
|
|
|
|
|
#endregion 面板风格
|
|
|
|
}
|
}
|