using System.Collections.Generic; namespace TProduct.PumpGraph.Picture { public partial class LxpFeatChart : FeatChart { #region 设置点 public List _curveInfoQH = null; public List _curveInfoQE = null; public List _curveInfoQP = null; public List _pointInfoQH = null; public List _pointInfoQE = null; public List _pointInfoQP = null; public List _points_TestNPSH = null; public List _points_CurveNPSH = null; protected TProduct.Model.ProductMainExPump _currentPump = null; public virtual void SetFeatPointRecords( TProduct.Model.ProductMainExPump pump, List groupPoints) { if (groupPoints == null || groupPoints.Count < 4) { return; } this._currentPump = pump; _pointInfoQH = new List(); _pointInfoQE = new List(); _pointInfoQP = new List(); _curveInfoQH = new List(); _curveInfoQE = new List(); _curveInfoQP = new List(); foreach (var pt in groupPoints) { _pointInfoQH.Add(new Eventech.Model.FeatPoint(pt.CorrectPtQ, pt.CorrectPtH)); if (pt.CorrectPtP.HasValue) _pointInfoQP.Add(new Eventech.Model.FeatPoint(pt.CorrectPtQ, pt.CorrectPtP.Value)); if (pt.CorrectPtE.HasValue) _pointInfoQE.Add(new Eventech.Model.FeatPoint(pt.CorrectPtQ, pt.CorrectPtE.Value)); } if (_pointInfoQH.Count > 4) this._curveInfoQH = Eventech.Common.FitCurveHelper.GetFitPoints(_pointInfoQH, pump.CurveFitTypeQH, 12); if (_pointInfoQE.Count > 4) this._curveInfoQE = Eventech.Common.FitCurveHelper.GetFitPoints(_pointInfoQE, pump.CurveFitTypeQE, 12); if (_pointInfoQP.Count > 4) this._curveInfoQP = Eventech.Common.FitCurveHelper.GetFitPoints(_pointInfoQP, pump.CurveFitTypeQP, 12); } protected List _curveInfoQH_Extend = null; public void SetExtendCurveInfoQH(List points) { _curveInfoQH_Extend = points; } public virtual void SetNPSHPoint(List npshPoints) { if (npshPoints == null || npshPoints.Count < 1) return; _points_TestNPSH = npshPoints; _points_CurveNPSH = Eventech.Common.FitCurveHelper.GetFitPoints4Npsh(npshPoints); } #endregion #region 图片位置映射 //X轴实际尺寸换算为像素尺寸 protected virtual float MapRealToPictQ(double Q) { return (float)((Q - _coordinateParas.CoordMinQ) * _chartDiagram.Width / ((_coordinateParas.GridNumberX) * _coordinateParas.CoordSpaceQ)) + _chartDiagram.Left; } protected float _diagram_Cell_Height = 10;//图表中每个格子的高度(图片上的高度) //扬程曲线Y坐标实际尺寸换算为像素尺寸 protected virtual float MapRealToPictH(double H) { double startH = _coordinateParas.CoordMinH + _coordinateParas.StartLineNoH * _coordinateParas.CoordSpaceH; return _chartDiagramQH.Bottom - (float)((H - startH) * _diagram_Cell_Height / _coordinateParas.CoordSpaceH); } //效率曲线Y坐标实际尺寸换算为像素尺寸 protected virtual float MapRealToPictE(double E) { double startE = _coordinateParas.CoordMinE + _coordinateParas.StartLineNoE * _coordinateParas.CoordSpaceE; return _chartDiagramQE.Bottom - (float)((E - startE) * _diagram_Cell_Height / _coordinateParas.CoordSpaceE); } //功率曲线Y坐标实际尺寸换算为像素尺寸 protected virtual float MapRealToPictP(double P) { double startP = _coordinateParas.CoordMinP + _coordinateParas.StartLineNoP * _coordinateParas.CoordSpaceP; return _chartDiagramQP.Bottom - (float)((P - startP) * _diagram_Cell_Height / _coordinateParas.CoordSpaceP); } //汽蚀曲线Y坐标实际尺寸换算为像素尺寸 protected virtual float MapRealToPictNPSH(double NPSH) { if (!_isHaveNPSHCurve) return 0; if (_coordinateParas.CoordSpaceNPSH < 0.01) return 0; double startNPSH = _coordinateParas.CoordMinNPSH + _coordinateParas.StartLineNoNPSH * _coordinateParas.CoordSpaceNPSH; return _chartDiagramNPSH.Bottom - (float)((NPSH - startNPSH) * _diagram_Cell_Height / _coordinateParas.CoordSpaceNPSH); } //相对值 protected virtual float MapRealToPictNPSH_Space(double NPSH_spacce) { if (!_isHaveNPSHCurve) return 0; if (_coordinateParas.CoordSpaceNPSH < 0.01) return 0; return (float)(NPSH_spacce * _diagram_Cell_Height / _coordinateParas.CoordSpaceNPSH); } #endregion } }