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
135
136
137
138
139
140
141
142
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
 
namespace TProduct.PumpGraph.Picture
{
    public abstract class ZlpFeatChart : FeatChart
    {
 
 
        protected Eventech.Model.QhCoordinateParas _coordinateParas = null;
 
        public void SetCoordinate(Eventech.Model.QhCoordinateParas coordinateParas)
        {
            this._coordinateParas = coordinateParas;
        }
 
 
 
 
 
 
        protected float _diagram_Cell_Height = 10;//图表中每个格子的高度(图片上的高度)
 
 
 
        //X轴实际尺寸换算为像素尺寸
        protected float MapRealToPictQ(double Q)
        {
            return (float)((_coordinateParas.AxisCalcQ.Calc(Q) - _coordinateParas.AxisLabelQ.First() ) * _chartDiagram.Width / (_coordinateParas.AxisLabelQ.Last() - _coordinateParas.AxisLabelQ.First())) + _chartDiagram.Left;
            //return (float)((_coordinateParas.AxisCalcQ.Calc(Q) - _coordinateParas.AxisLabelQ[0]) * (_diagramRightBottomPt.X - _diagramLeftBottomPt.X) / ((_coordinateParas.AxisLabelQ[_coordinateParas.AxisLabelQ.Count - 1] - _coordinateParas.AxisLabelQ[0]))) + _diagramLeftBottomPt.X;
        }
 
        //扬程曲线Y坐标实际尺寸换算为像素尺寸
        protected float MapRealToPictH(double H)
        {
            return _chartDiagram.Bottom - (float)((H - _coordinateParas.AxisLabelH.First()) * _chartDiagram.Height / (_coordinateParas.AxisLabelH.Last() - _coordinateParas.AxisLabelH.First()));
            //return _diagramLeftBottomPt.Y - (float)((H - _coordinateParas.AxisLabelH[0]) * (_diagramLeftBottomPt.Y - _diagramLeftTopPt.Y) / (_coordinateParas.AxisLabelH[_coordinateParas.AxisLabelH.Count - 1] - _coordinateParas.AxisLabelH[0]));
        }
 
 
        public void SetEqualParaCurve(Eventech.Model.CombineCurveList equalParaCurveE, Eventech.Model.AnnoAnchorPointList annoAnchorPointList)
        {
            AnnoAnchorPointList = annoAnchorPointList;
            _equalParaCurveE = equalParaCurveE;
        }
 
 
        public void SetChartTextWith(float QtextWith, float HtextWith, float EtextWith, float PtextWith)
        {
 
            this._axisTitleTextSizeY = HtextWith;
 
            this._axisTitleTextSizeQ = QtextWith;
        }
 
 
 
        /// <summary>
        /// 绘制扬程特殊线
        /// </summary>
        protected void DrawSpecConstantLineH()
        {
            if (_maxHeadValue.HasValue && _maxHeadValue > 0)
            {
                //var color = TProduct.PumpGraph.Dxf.AutoCadHelper.BlueColor;
 
                //var pic_h = MapRealToPictH(_maxHeadValue.Value);
                //DxfLine lineRight = new DxfLine(new Point2D(_diagramLeftTopPt.X, pic_h), new Point2D(_diagramRightTopPt.X, pic_h));
                //lineRight.LineWeight = 2;
                //lineRight.Color = color;
                //_dxfFileModel.Entities.Add(lineRight);
 
 
                //var labelPtH = new Point3D(_diagramRightTopPt.X - 5, pic_h + 2, 0d);
                //DxfMText axisLabel_h = new DxfMText("最高扬程", labelPtH, _axisLabelSizeY);//\P表示回车
                //axisLabel_h.AttachmentPoint = AttachmentPoint.BottomRight;
                //if (_axisTextFont != null)
                //    axisLabel_h.Style = this._axisTextFont;
                //axisLabel_h.Color = color;
                //_dxfFileModel.Entities.Add(axisLabel_h);
            }
 
 
            if (_averagHeadValue.HasValue && _averagHeadValue > 0)
            {
                //var color = TProduct.PumpGraph.Dxf.AutoCadHelper.BlueColor;
 
                //var pic_h = MapRealToPictH(_averagHeadValue.Value);
                //DxfLine lineRight = new DxfLine(new Point2D(_diagramLeftTopPt.X, pic_h), new Point2D(_diagramRightTopPt.X, pic_h));
                //lineRight.LineWeight = 2;
                //lineRight.Color = color;
                //_dxfFileModel.Entities.Add(lineRight);
 
 
                //var labelPtH = new Point3D(_diagramRightTopPt.X - 5, pic_h + 2, 0d);
                //DxfMText axisLabel_h = new DxfMText("平均扬程", labelPtH, _axisLabelSizeY);//\P表示回车
                //axisLabel_h.AttachmentPoint = AttachmentPoint.BottomRight;
                //if (_axisTextFont != null)
                //    axisLabel_h.Style = this._axisTextFont;
                //axisLabel_h.Color = color;
                //_dxfFileModel.Entities.Add(axisLabel_h);
            }
 
            if (_minHeadValue.HasValue && _minHeadValue > 0)
            {
                //var color = TProduct.PumpGraph.Dxf.AutoCadHelper.BlueColor;
 
                //var pic_h = MapRealToPictH(_minHeadValue.Value);
                //DxfLine lineRight = new DxfLine(new Point2D(_diagramLeftTopPt.X, pic_h), new Point2D(_diagramRightTopPt.X, pic_h));
                //lineRight.LineWeight = 2;
                //lineRight.Color = color;
                //_dxfFileModel.Entities.Add(lineRight);
 
 
                //var labelPtH = new Point3D(_diagramRightTopPt.X - 5, pic_h + 2, 0d);
                //DxfMText axisLabel_h = new DxfMText("最低扬程", labelPtH, _axisLabelSizeY);//\P表示回车
                //axisLabel_h.AttachmentPoint = AttachmentPoint.BottomRight;
                //if (_axisTextFont != null)
                //    axisLabel_h.Style = this._axisTextFont;
                //axisLabel_h.Color = color;
                //_dxfFileModel.Entities.Add(axisLabel_h);
            }
        }
        protected double? _maxHeadValue = null;
        protected double? _averagHeadValue = null;
        protected double? _minHeadValue = null;
        public void SetSpecConstantLineValue(double? min, double? avery, double? max)
        {
            this._maxHeadValue = max;
            this._averagHeadValue = avery;
            this._minHeadValue = min;
        }
 
 
 
 
 
    }
}