using Eventech.Model; using System.Collections.Generic; using System.Drawing; namespace TProduct.PumpGraph.Picture { public partial class LxpFeatChart : FeatChart { #region 额定点及显示设置 protected bool _isDrawRatedPoint = true; public bool IsDrawRatedPoint { get { return _isDrawRatedPoint; } set { _isDrawRatedPoint = value; } } protected TProduct.Model.RatedParas4Pump _ratedParas = null; protected Eventech.Model.PointToleranceParas _toleranceParas = null; protected Eventech.Model.eDesignPointDispType _designPointDispType = Eventech.Model.eDesignPointDispType.Cross; public Eventech.Model.eDesignPointDispType DesignPointDispType { get { return _designPointDispType; } set { _designPointDispType = value; } } protected Color _designPointColor = Color.Red; public Color DesignPointColor { get { return _designPointColor; } set { _designPointColor = value; } } protected float _designPointLineWidth = 3f; public float DesignPointLineWidth { get { return _designPointLineWidth; } set { _designPointLineWidth = value; } } #endregion //额定点 protected virtual void DrawRatedPoint() { if (_ratedParas == null) return; if (!this._isDrawRatedPoint) return; // var posi_x = MapRealToPictQ(_ratedParas.Q); //var posi_y = MapRealToPictH(_ratedParas.H); //using (Pen pen = new Pen(Color.Red, 4f)) //{ // _graphics.DrawEllipse(pen, posi_x - 4, posi_y - 4, 8, 8); //} #region 默认设计点 //if (_designPointDispType == Eventech.Model.eDesignPointDispType.Cross) //{ var pt = new Eventech.Model.FeatPoint(_ratedParas.Q, _ratedParas.H); var _crossPoint = new Eventech.Model.CrossPoint(pt, _toleranceParas); using (Pen pen = new Pen(_designPointColor, _designPointLineWidth)) { _graphics.DrawLine(pen, new PointF(MapRealToPictQ(_crossPoint.MinX), MapRealToPictH(pt.Y)), new PointF(MapRealToPictQ(_crossPoint.MaxX), MapRealToPictH(pt.Y))); _graphics.DrawLine(pen, new PointF(MapRealToPictQ(pt.X), MapRealToPictH(_crossPoint.MinY)), new PointF(MapRealToPictQ(pt.X), MapRealToPictH(_crossPoint.MaxY))); } //} //else //{ // using (Pen pen = new Pen(_designPointLineColor, _designPointLineWidth)) // { // var center_pt = new PointF(MapRealToPictQ(_designPointStdUnit.X), MapRealToPictH(_designPointStdUnit.Y)); // var h_length = this._chartDiagramQH.Width / 18; // var v_length = h_length * 0.61f;//0.618黄金分割 // _graphics.DrawLine(pen, center_pt, new PointF(center_pt.X, center_pt.Y + v_length)); // _graphics.DrawLine(pen, center_pt, new PointF(center_pt.X - h_length, center_pt.Y)); // _graphics.DrawLine(pen, new PointF(center_pt.X, center_pt.Y + v_length), new PointF(center_pt.X - h_length, center_pt.Y)); // _graphics.DrawLine(pen, new PointF(center_pt.X, center_pt.Y + v_length * 0.33f), new PointF(center_pt.X - h_length * 0.33f, center_pt.Y)); // _graphics.DrawLine(pen, new PointF(center_pt.X, center_pt.Y + v_length * 0.66f), new PointF(center_pt.X - h_length * 0.66f, center_pt.Y)); // } //} #endregion } public void SetRatedParas( TProduct.Model.RatedParas4Pump ratedParas, List testJudgeItems) { this._ratedParas = ratedParas; if (ratedParas == null) return; _toleranceParas = new PointToleranceParas(); var flow_min = testJudgeItems.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.流量 && x.ThresholdType == TProduct.Model.TestGradeJudgeItem.eThresholdType.Min); if (flow_min != null) { _toleranceParas.TolRatioMinQ = flow_min.ThresholdValue; } var flow_max = testJudgeItems.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.流量 && x.ThresholdType == TProduct.Model.TestGradeJudgeItem.eThresholdType.Max); if (flow_max != null) { _toleranceParas.TolRatioMaxQ = flow_max.ThresholdValue; } var head_min = testJudgeItems.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.扬程 && x.ThresholdType == TProduct.Model.TestGradeJudgeItem.eThresholdType.Min); if (head_min != null) { _toleranceParas.TolRatioMinH = head_min.ThresholdValue; } var head_max = testJudgeItems.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.扬程 && x.ThresholdType == TProduct.Model.TestGradeJudgeItem.eThresholdType.Max); if (head_max != null) { _toleranceParas.TolRatioMaxH = head_max.ThresholdValue; } } } }