using System.Collections.Generic; using System.Drawing; using System.Linq; namespace TProduct.PumpGraph.Picture { public partial class LxpFeatChart : FeatChart { protected RectangleF _chartDiagramQH; protected RectangleF _chartDiagramQE; protected RectangleF _chartDiagramQP; protected RectangleF _chartDiagramNPSH; #region 坐标 protected Eventech.Model.LxpCoordinateParas _coordinateParas = null; public void SetCoordinate(Eventech.Model.LxpCoordinateParas coordinateParas) { _coordinateParas = coordinateParas; } //检查坐标 protected virtual bool CheckCoordinate() { if (_coordinateParas == null) return false; CheckPressCoord(); CheckNpshCoord(); CheckPowerCoord(); return true; } protected void CheckPowerCoord() { if (this._curveInfoQP == null) return; Eventech.Model.FeatPoint lastPt = this._curveInfoQP.LastOrDefault(); if (lastPt == null) return; if (this._coordinateParas.DispMaxP() < lastPt.Y) { this._coordinateParas.EndLineNoP++; if (this._coordinateParas.DispMaxP() < lastPt.Y) { this._coordinateParas.EndLineNoP++; if (this._coordinateParas.DispMaxP() < lastPt.Y) { this._coordinateParas.EndLineNoP++; } } } } //检查扬程线的坐标有没有超出 protected void CheckPressCoord() { if (this._curveInfoQH == null) return; Eventech.Model.FeatPoint lastPt = this._curveInfoQH.LastOrDefault(); if (lastPt == null) return; if (lastPt == null) return; if (this._coordinateParas.DispMinH() < lastPt.Y) { if (this._coordinateParas.DispMinH() - this._coordinateParas.CoordSpaceH >= 0) this._coordinateParas.StartLineNoH--; if (this._coordinateParas.DispMinH() < lastPt.Y) { if (this._coordinateParas.DispMinH() - this._coordinateParas.CoordSpaceH >= 0) this._coordinateParas.StartLineNoH--; if (this._coordinateParas.DispMinH() < lastPt.Y) { if (this._coordinateParas.DispMinH() - this._coordinateParas.CoordSpaceH >= 0) this._coordinateParas.StartLineNoH--; } } } var max_h = (from x in this._curveInfoQH select x.Y).Max(); if (_coordinateParas.DispMaxH() < max_h) { _coordinateParas.GridNumberY = _coordinateParas.GridNumberY + 1; _coordinateParas.EndLineNoH = _coordinateParas.EndLineNoH + 1; if (_coordinateParas.DispMaxH() < max_h) { _coordinateParas.GridNumberY = _coordinateParas.GridNumberY + 1; _coordinateParas.EndLineNoH = _coordinateParas.EndLineNoH + 1; } } } protected void CheckNpshCoord() { if (this._points_CurveNPSH == null || _points_CurveNPSH.Count < 3) return; List points = _points_CurveNPSH; if (this._coordinateParas.DispMinNPSH() > points.First().Y) { this._coordinateParas.CoordMinNPSH = this._coordinateParas.CoordMinNPSH - this._coordinateParas.CoordSpaceNPSH; this._coordinateParas.EndLineNoNPSH = this._coordinateParas.EndLineNoNPSH + 1; } var lastPt = points.LastOrDefault(); if (this._coordinateParas.DispMaxNPSH() < lastPt.Y) { this._coordinateParas.EndLineNoNPSH++; if (this._coordinateParas.DispMaxNPSH() < lastPt.Y) { this._coordinateParas.EndLineNoNPSH++; if (this._coordinateParas.DispMaxNPSH() < lastPt.Y) { this._coordinateParas.EndLineNoNPSH++; } } } } #endregion #region 坐标颜色 //是否显示坐标说明 bool _isDispCurveTitle = true; public bool IsDispCurveTitle { get { return _isDispCurveTitle; } set { _isDispCurveTitle = value; } } protected Color _axisLabelColorE = Color.BlueViolet; public Color AxisLabelColorE { get { return _axisLabelColorE; } set { _axisLabelColorE = value; } } protected Color _axisLabelColorP = Color.Black; public Color AxisLabelColorP { get { return _axisLabelColorP; } set { _axisLabelColorP = value; } } protected Color _axisLabelColorNPSH = Color.BlueViolet; public Color AxisLabelColorNPSH { get { return _axisLabelColorNPSH; } set { _axisLabelColorNPSH = value; } } protected Color _axisTitleColorE = Color.Black; public Color AxisTitleTextColorE { get { return _axisTitleColorE; } set { _axisTitleColorE = value; } } protected Color _axisTitleColorP = Color.Black; public Color AxisTitleTextColorP { get { return _axisTitleColorP; } set { _axisTitleColorP = value; } } protected Color _axisTitleColorNPSH = Color.Black; public Color AxisTitleTextColorNPSH { get { return _axisTitleColorNPSH; } set { _axisTitleColorNPSH = value; } } //是否显示汽蚀曲线X的网格线 protected bool _isDispGridLineNPSHX = true; public bool IsDispGridLineNPSHX { get { return _isDispGridLineNPSHX; } set { _isDispGridLineNPSHX = value; } } protected int _blankGridNumberUpBottom = 2;//扬程下面预留2个格子 protected int _blankGridNumberUpTop = 1;//扬程上面预留1个格子 protected int _blankGridNumberDownBottom = 1;//功率下面预留2个格子 protected int _blankGridNumberDownTop = 1;//功率上面预留 格子数( 毅飞要求不要留间隙 其他客户为1) public int BlankGridNumberDownTop { get { return _blankGridNumberDownTop; } set { _blankGridNumberDownTop = value; } } //是否显示功率曲线 protected bool _isDispCurveQP = true; public bool IsDispCurveQP { get { return _isDispCurveQP; } set { _isDispCurveQP = value; } } //是否显示功率曲线 protected bool _isDispCurveQE = true; public bool IsDispCurveQE { get { return _isDispCurveQE; } set { _isDispCurveQE = value; } } //是否有汽蚀曲线 protected bool _isHaveNPSHCurve = true; //是否显示汽蚀曲线 protected bool _isDispCurveNPSH = true; public bool IsDispCurveNPSH { get { return _isDispCurveNPSH; } set { _isDispCurveNPSH = value; } } #endregion public override void SetColorQE(Color color) { _axisTitleColorE = color; _axisLabelColorE = color; _curveColorQE = color; } public override void SetColorQP(Color color) { _axisTitleColorP = color; _axisLabelColorP = color; _curveColorQP = color; } } }