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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
using WW.Cad.Base;
using WW.Cad.Drawing;
using WW.Cad.Drawing.GDI;
using WW.Cad.IO;
using WW.Cad.Model;
using WW.Math;
using WW.Cad.Model.Entities;
using WW.Actions;
using WW.Cad.Model.Tables;
using WW.Cad.Model.Objects;
 
namespace TProduct.PumpGraph.Dxf
{
    public partial class MultiSpeedBaseCuve : FeatChart
    {
        protected string _qhCurveLabelContent = "扬程(m)";
        protected string _qeCurveLabelContent = "效率(%)";
        protected string _qpCurveLabelContent = "功率(kW)";
        protected string _npshCurveLabelContent = "汽蚀(m)";
 
 
        //注意即使改了单位,曲线里面的数据没有变,只变化了图表的坐标显示
        protected Eventech.Model.UnitP _unitP = Eventech.Model.UnitP.KW;
        public Eventech.Model.UnitP UnitP
        {
            get { return _unitP; }
            set { _unitP = value; }
        }
 
        protected Eventech.Model.UnitH _unitNPSH = Eventech.Model.UnitH.M;
        public Eventech.Model.UnitH UnitNPSH
        {
            get { return _unitNPSH; }
            set { _unitNPSH = value; }
        }
 
 
 
        #region 坐标
        protected Eventech.Model.LxpCoordinateParas _coordinateParas = null;
        public void SetCoordinate(string strChartCoord)
        {
            SetCoordinate(Eventech.Common.LxpCoordinateParasConver.ToParameter(strChartCoord));
        }
        public void SetCoordinate(Eventech.Model.LxpCoordinateParas coordinateParas)
        {
            this._coordinateParas = coordinateParas;
        }
 
        #endregion
 
 
        #region 汽蚀曲线
        //是否有汽蚀曲线
        protected bool _isNPSHCurve = true;
        public bool IsNPSHCurve
        {
            get { return _isNPSHCurve; }
            set { _isNPSHCurve = value; }
        }
 
        //切除运行区域外的汽蚀曲线
        //protected bool _isCutOutRangeCurveNPSH = false;
        //public bool IsCutOutRangeCurveNPSH
        //{
        //    get { return _isCutOutRangeCurveNPSH; }
        //    set { _isCutOutRangeCurveNPSH = value; }
        //}
        //汽蚀曲线延长到区域点(最小流量点开始)
        protected bool _isCurveNpshStartWithRegionAllow = false;
        public bool IsCurveNpshStartWithRegionAllow
        {
            get { return _isCurveNpshStartWithRegionAllow; }
            set { _isCurveNpshStartWithRegionAllow = value; }
        }
 
        protected List<Eventech.Model.CurveDispParasEx> _allCurveNPSH = null;
        public List<Eventech.Model.CurveDispParasEx> AllCurveNPSH
        {
            get { return _allCurveNPSH; }
            set { _allCurveNPSH = value; }
        }
        #endregion
 
 
        #region 性能曲线
 
 
        protected List<Eventech.Model.CurveDispParasEx> _allCurveQH = null;
        public List<Eventech.Model.CurveDispParasEx> AllCurveQH
        {
            get { return _allCurveQH; }
            set { _allCurveQH = value; }
        }
        public void AddlCurveQH(Eventech.Model.CurveExpress curveExpress, string curveName = null,Eventech.Model.FeatPoint curveNamePosi = null)
        {
            Eventech.Model.CurveDispParasEx curveDispParasEx = new Eventech.Model.CurveDispParasEx();
            if (string.IsNullOrEmpty(curveName))
            {
                curveDispParasEx.IsDispName = false;
            }
            else
            {
                curveDispParasEx.LabelPosiName = curveNamePosi;
                curveDispParasEx.CurveName = curveName;
                curveDispParasEx.IsDispName = true ;
            }
          
            curveDispParasEx.IsDispCurve = true;
            curveDispParasEx.CurveExpress = curveExpress;
            curveDispParasEx.CurveColor = System.Drawing.Color.FromArgb(100, 149, 237);
            if (_allCurveQH == null)
                _allCurveQH = new List<Eventech.Model.CurveDispParasEx>();
            _allCurveQH.Add(curveDispParasEx);
        }
        public void AddlCurveQH(Eventech.Model.CurveExpress curveExpress, string curveName, Eventech.Model.FeatPoint curveNamePosi,
            double curvePara ,Eventech.Model.FeatPoint curveParaPosi, bool IsMeterUnit)
        {
            Eventech.Model.CurveDispParasEx curveDispParasEx = new Eventech.Model.CurveDispParasEx();
            if (string.IsNullOrEmpty(curveName) || string.IsNullOrWhiteSpace(curveName))
            {
                curveDispParasEx.IsDispName = false;
            }
            else
            {
                curveDispParasEx.LabelPosiName = curveNamePosi;
                curveDispParasEx.CurveName = curveName;
                curveDispParasEx.IsDispName = true;
            }
 
            if (curvePara > 0.5)
            {
                if (IsMeterUnit)
                    curveDispParasEx.CurvePara = string.Format("{0}mm", curvePara);
                else
                    curveDispParasEx.CurvePara = string.Format("{0}\"", curvePara);
                curveDispParasEx.LabelPosiPara = curveParaPosi;
                curveDispParasEx.IsDispPara = true;
            }
            else
            {
                curveDispParasEx.IsDispPara = false ;
            }
 
            curveDispParasEx.IsDispCurve = true;
            curveDispParasEx.CurveExpress = curveExpress;
            curveDispParasEx.CurveColor = System.Drawing.Color.FromArgb(100, 149, 237);
 
            if (_allCurveQH == null)
                _allCurveQH = new List<Eventech.Model.CurveDispParasEx>();
            _allCurveQH.Add(curveDispParasEx);
        }
        public void AddlCurveQH(Eventech.Model.CurveDispParasEx curveDispParasEx)
        {
            if (_allCurveQH == null)
                _allCurveQH = new List<Eventech.Model.CurveDispParasEx>();
 
            curveDispParasEx.CurveColor = System.Drawing.Color.FromArgb(100, 149, 237);
            _allCurveQH.Add(curveDispParasEx);
        }
  
        protected List<Eventech.Model.CurveDispParasEx> _allCurveQE = null;
        public List<Eventech.Model.CurveDispParasEx> AllCurveQE
        {
            get { return _allCurveQE; }
            set { _allCurveQE = value; }
        }
        public void AddlCurveQE(Eventech.Model.CurveExpress curveExpress, string curveName = null)
        {
            Eventech.Model.CurveDispParasEx curveDispParasEx = new Eventech.Model.CurveDispParasEx();
            if (string.IsNullOrEmpty(curveName))
            {
                curveDispParasEx.IsDispName = false;
            }
            else
            {
                curveDispParasEx.CurveName = curveName;
                curveDispParasEx.IsDispName = false;
            }
            curveDispParasEx.IsDispCurve = true;
            curveDispParasEx.IsDispCurve = true;
            curveDispParasEx.CurveExpress = curveExpress;
            curveDispParasEx.CurveColor = System.Drawing.Color.FromArgb(154, 255, 154);
            if (_allCurveQE == null)
                _allCurveQE = new List<Eventech.Model.CurveDispParasEx>();
            _allCurveQE.Add(curveDispParasEx);
        }
 
        protected List<Eventech.Model.CurveDispParasEx> _allCurveQP = null;
        public List<Eventech.Model.CurveDispParasEx> AllCurveQP
        {
            get { return _allCurveQP; }
            set { _allCurveQP = value; }
        }
        public void AddlCurveQP(Eventech.Model.CurveExpress curveExpress, string curveName = null)
        {
            Eventech.Model.CurveDispParasEx curveDispParasEx = new Eventech.Model.CurveDispParasEx();
            if (string.IsNullOrEmpty(curveName))
            {
                curveDispParasEx.IsDispName = false;
            }
            else
            {
                curveDispParasEx.CurveName = curveName;
                curveDispParasEx.IsDispName = false;
            }
            curveDispParasEx.IsDispCurve = true;
            curveDispParasEx.CurveExpress = curveExpress;
            curveDispParasEx.CurveColor = System.Drawing.Color.FromArgb(255, 140, 105);
            if (_allCurveQP == null)
                _allCurveQP = new List<Eventech.Model.CurveDispParasEx>();
            _allCurveQP.Add(curveDispParasEx);
        }
 
 
 
 
 
        #endregion
 
 
  
 
 
 
 
 
 
        protected bool _isRotateAxisTitleY = false;//是否对坐标标题文字旋转90度
        protected bool _isTwoLineAxisTileY = true;//坐标名字和单位放在两行
        protected double _axisTitleSizeX = 10;//刻度文字尺寸
        protected double _axisTitleSizeY = 10;//刻度文字尺寸
 
        protected double _axisLabelSizeX = 8;//刻度文字尺寸
        protected double _axisLabelSizeY = 8;//刻度文字尺寸
 
        protected float _axisMajorTickLength = 8;//长刻度线的长度
        protected float _axisMinorTickLength = 4;//短刻度线的长度
        protected int _minorTickNumberX = 4;
        protected int _minorTickNumberY = 3;
 
        protected double _axisTitleSpaceToDiagramQ = 35;//流量坐标标题距离图标的距离
        protected double _axisLabelSpaceToDiagramQ = 12;//流量坐标刻度距离图标的距离
 
        protected float _axisTitleSpaceToLabel_Vertial_Y = 1;//纵坐标Tile在Y方向与文字的间隔
 
        protected float _axisLabelSpaceToDiagramY_left = 15;//刻度文字离Y轴的距离(只对Y)
        protected float _axisTitleSpaceToDiagramY_left = 100;//
 
        protected float _axisLabelSpaceToDiagramY_right = 15;//刻度文字离Y轴的距离(只对Y)
        protected float _axisTitleSpaceToDiagramY_right = 45;//
 
        protected Point2D _diagramLeftBottomPt = new Point2D();
        protected Point2D _diagramRightBottomPt = new Point2D();
        protected Point2D _diagramLeftTopPt = new Point2D();
        protected Point2D _diagramRightTopPt = new Point2D();
 
 
 
 
        //是否显示型谱
        protected bool isDispSpectrum = true;
        public bool IsDispSpectrum { get { return isDispSpectrum; } set { isDispSpectrum = value; } }
 
        //曲线文字的间隙
        protected int _curveParasLabelSpaceX = 1;
        protected int _curveParasLabelSpaceY = 1;
 
        //X轴实际尺寸换算为像素尺寸
        protected virtual double MapRealToPictQ(double Q) { return 0; }
 
        //扬程曲线Y坐标实际尺寸换算为像素尺寸
        protected virtual double MapRealToPictH(double H) { return 0; }
 
        //效率曲线Y坐标实际尺寸换算为像素尺寸
        protected virtual double MapRealToPictE(double E) { return 0; }
 
        //功率曲线Y坐标实际尺寸换算为像素尺寸
        protected virtual double MapRealToPictP(double P) { return 0; }
 
        //汽蚀曲线Y坐标实际尺寸换算为像素尺寸
        protected virtual double MapRealToPictNPSH(double NPSH) { return 0; }
 
        //检查汽蚀线的坐标有没有超出
        protected void CheckNpshCoord()
        {
            if (this._allCurveNPSH == null)
                return;
            foreach (var curve in this._allCurveNPSH)
            {
                if (!curve.IsDispCurve)
                    continue;
                
                if (curve.CurveInfo != null && curve.CurveInfo.Count > 0)
                {
                    var lastPt = curve.CurveInfo.LastOrDefault();
                    if (this._coordinateParas.DispMaxNPSH() < lastPt.Y)
                        this._coordinateParas.EndLineNoNPSH++;
                }
                else if (curve.CurveExpress != null)
                {
                    var lastPt = curve.CurveExpress.GetLastPoint();
                    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++;
                            }
                        }
                    }
                        
                }
            }
        }
        //检查汽蚀线的坐标有没有超出
        protected void CheckPowerCoord()
        {
            if (this._allCurveQP == null)
                return;
            foreach (var curve in this._allCurveQP)
            {
                if (!curve.IsDispCurve)
                    continue;
 
                if (curve.CurveInfo != null && curve.CurveInfo.Count > 0)
                {
                    var lastPt = curve.CurveInfo.LastOrDefault();
                    if (this._coordinateParas.DispMaxP() < lastPt.Y)
                        this._coordinateParas.EndLineNoP++;
                }
                else if (curve.CurveExpress != null)
                {
                    var lastPt = curve.CurveExpress.GetLastPoint();
                    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 CheckEtaNpshCoord冲突()
        {
            if (_coordinateParas.EndLineNoNPSH > _coordinateParas.StartLineNoNPSH)
            {
                for (int dd = 0; dd < 10; dd++)
                {
                    if (_coordinateParas.EndLineNoNPSH >= _coordinateParas.StartLineNoE)
                    {
                        _coordinateParas.EndLineNoE++;
                        _coordinateParas.StartLineNoE++;
                        _coordinateParas.CoordMinE = _coordinateParas.CoordMinE - _coordinateParas.CoordSpaceE;
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }
 
    }
}