tx
2025-04-22 e0b138b3e057de6f57021e6c8963868f5c5acc5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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<Model.TestGradeJudgeItem> 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;
            }
 
        }
 
 
 
 
 
 
 
 
    }
}