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
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
using System.Linq;
using WW.Cad.Model.Entities;
using WW.Math;
 
namespace TProduct.PumpGraph.Dxf
{
    //坐标在一起的那种
    public partial class LxpFeatChart_Whole : LxpFeatChart
    {
        //绘制刻度显示值
        protected virtual void DrawAxisX()
        {
            double coorminQ = _coordinateParas.CoordMinQ;//最小显示值
            double coordSpace = _coordinateParas.CoordSpaceQ;//一个格子代表的数值15
            double coormax = (_coordinateParas.GridNumberX + 1) * coordSpace + coorminQ;//刻度显示最大值
 
            //_defaultTextFont = new DxfTextStyle("MYSTYLE", "simfang.ttf");//仿宋体 在WINDOWS/FONT下的文件名称
            //_dxfFileModel.TextStyles.Add(_defaultTextFont);
            //_dxfFileModel.TextStyles.Add(_defaultTextFont);
 
            //是否间隔的LABEL
            bool isIntervalLabel = false;
            if (_coordinateParas.GridNumberX > 20)
            {
                isIntervalLabel = true;
            }
 
            double spaceWidth = (_diagramRightBottomPt.X - _diagramLeftBottomPt.X) / (_coordinateParas.GridNumberX);//X轴上格子的宽度
 
            for (int i = 0; i < _coordinateParas.GridNumberX + 1; i = i + 1)
            {
                double space = i * spaceWidth;
                double kedu_d = coorminQ + i * coordSpace;
                if (kedu_d < 0.001)
                    kedu_d = 0;
                string kedu_str = "";
                if (_unitQ == Eventech.Model.UnitQ.M3H)
                {
                    kedu_str = kedu_d.ToString();
                }
                else
                {
                    kedu_str = Eventech.Common.UnitQHelper.fromM3H(_unitQ, kedu_d).ToString("N2");
                }
 
                //DxfText axisLabel = new DxfText(kedu_str, new Point3D(_diagramLeftBottomPt.X + space - _axisLabelSizeX / 2, _diagramLeftBottomPt.Y - _axisLabelSpaceToDiagramQ, 0d), _axisLabelSizeX);
                //axisLabel.Thickness = 0.4d;
                //axisLabel.Color = _axisLabelColorQ;
                //if (_defaultTextFont != null)
                //    axisLabel.Style = _defaultTextFont;
                //_dxfFileModel.Entities.Add(axisLabel);
 
 
                var labelPtQ = new Point3D(_diagramLeftBottomPt.X + space, _diagramLeftBottomPt.Y - _axisLabelSpaceToDiagramQ, 0d);
                DxfMText axisLabel_q = new DxfMText(kedu_str, labelPtQ, _axisLabelSizeX);//\P表示回车
                axisLabel_q.AttachmentPoint = AttachmentPoint.TopCenter;
                if (_axisTextFont != null)
                    axisLabel_q.Style = this._axisTextFont;
                axisLabel_q.Color = this._axisLabelColorQ;
                _dxfFileModel.Entities.Add(axisLabel_q);
 
                //
                if (isIntervalLabel)
                    i = i + 1;
            }
 
            //绘制网格线
            if (_isDispGridLineX)
            {
                for (int i = 1; i < _coordinateParas.GridNumberX; i++)
                {
                    double space = i * spaceWidth;//竖直线之间的间距
                    Point2D startXgeziPt = new Point2D(_diagramLeftBottomPt.X + space, _diagramLeftBottomPt.Y);
                    Point2D endXgeziPt = new Point2D(_diagramLeftBottomPt.X + space, _diagramLeftTopPt.Y);
                    DxfLine dxfLine = new DxfLine(startXgeziPt, endXgeziPt);
                    dxfLine.Color = this._gridLineColor;
                    _dxfFileModel.Entities.Add(dxfLine);
                }
            }
 
 
            string title_content = string.Format("{0}({1})", _axisTtileContentQ, Eventech.Common.UnitQHelper.GetEnUnitName(_unitQ));
 
            Point3D title_posi_pt = new Point3D();
            title_posi_pt.X = _diagramLeftBottomPt.X + (_diagramRightBottomPt.X - _diagramLeftBottomPt.X) / 2 - _axisTitleSizeX * 2;
            title_posi_pt.Y = _diagramLeftBottomPt.Y - _axisTitleSpaceToDiagramQ_Y;
            title_posi_pt.Z = 0;
            DxfMText textTitleQ = new DxfMText(title_content, title_posi_pt, _axisTitleSizeX);
            textTitleQ.Color = this._axisTitleColorQ;
            if (_axisTextFont != null)
                textTitleQ.Style = this._axisTextFont;
            _dxfFileModel.Entities.Add(textTitleQ);
 
            for (int i = 0; i < _coordinateParas.GridNumberX + 1; i++)
            {
                double space = i * spaceWidth;//竖直线之间的间距
                Point2D startPt = new Point2D(_diagramLeftBottomPt.X + space, _diagramLeftBottomPt.Y);
                Point2D endPt;
                if (this._isDrawMajorTickX)
                {
                    endPt = new Point2D(_diagramLeftBottomPt.X + space, _diagramLeftBottomPt.Y - _axisMajorTickLength);
                }
                else
                {
                    endPt = new Point2D(_diagramLeftBottomPt.X + space, _diagramLeftBottomPt.Y);
                }
                DxfLine dxfLine = new DxfLine(startPt, endPt);
                dxfLine.Color = _gridLineColor;
 
                _dxfFileModel.Entities.Add(dxfLine);
            }
 
            if (_minorTickNumberX > 0)
            {
                for (int i = 0; i < _coordinateParas.GridNumberX; i++)
                {
                    double Longspace = i * spaceWidth;//竖直线之间的间距
                    for (int j = 1; j <= _minorTickNumberX; j++)
                    {
                        double space = j * spaceWidth / _minorTickNumberX;
                        double x = _diagramLeftBottomPt.X + space + Longspace;
                        Point2D startPt = new Point2D(x, _diagramLeftBottomPt.Y);
                        Point2D endPt = new Point2D(x, _diagramLeftBottomPt.Y - _axisMinorTickLength);
                        DxfLine dxfLine = new DxfLine(startPt, endPt);
                        dxfLine.Color = this._gridLineColor;
 
                        _dxfFileModel.Entities.Add(dxfLine);
                    }
                }
            }
 
        }
 
        //绘制QH刻度数值和刻度线
        protected virtual void DrawAxisH()
        {
            double coordSpace = _coordinateParas.CoordSpaceH;//一个格子代表的数值
            int gridNumber = _coordinateParas.EndLineNoH - _coordinateParas.StartLineNoH;//Y格子的数量
            // _dxfFileModel.TextStyles.Add(_defaultTextFont);
 
 
            //是否间隔的LABEL
            bool isIntervalLabel = false;
            if (_coordinateParas.StartLineNoH - _coordinateParas.EndLineNoH > 8)
            {
                isIntervalLabel = true;
            }
            double gridHeight = (_diagramLeftTopPt.Y - _diagramLeftBottomPt.Y) / _coordinateParas.GridNumberY;
 
            //刻度文字
            for (int i = _coordinateParas.StartLineNoH; i <= _coordinateParas.EndLineNoH; i++)
            {
                double space = i * gridHeight;
                double kedu_d = _coordinateParas.CoordMinH + i * coordSpace;//刻度值显示
                if (kedu_d < 0.001)
                    kedu_d = 0;
                string kedu_str = "";
                if (_unitH == Eventech.Model.UnitH.M)
                {
                    kedu_str = kedu_d.ToString();
                }
                else if (_unitH == Eventech.Model.UnitH.MPa)
                {
                    kedu_str = (kedu_d / 100).ToString();
                }
                else
                {
                    kedu_str = Eventech.Common.UnitHHelper.fromM2(_unitH, kedu_d).ToString("N2");
                }
 
                var labelPtH = new Point3D(_diagramLeftBottomPt.X - _axisLabelSpaceToDiagramY_left, _diagramLeftBottomPt.Y + space, 0d);
                DxfMText axisLabel_h = new DxfMText(kedu_str, labelPtH, _axisLabelSizeY);//\P表示回车
                axisLabel_h.AttachmentPoint = AttachmentPoint.MiddleRight;
                if (_axisTextFont != null)
                    axisLabel_h.Style = this._axisTextFont;
                axisLabel_h.Color = this._axisLabelColorH;
                _dxfFileModel.Entities.Add(axisLabel_h);
 
 
                if (isIntervalLabel)
                {
                    i++;
                }
            }
 
 
            Point3D pt_title = new Point3D();
            pt_title.X = _diagramLeftBottomPt.X - _axisTitleSpaceToDiagramY_left;
            //纵坐标标题的位置 0表示 中间, 1表示刻度的上面
            if (AxisTitlePosiStyleY == eAxisTitlePosiStyle.Top)
            {
                pt_title.Y = _diagramLeftBottomPt.Y + _coordinateParas.EndLineNoH * gridHeight + _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y;
            }
            else
            {
                pt_title.Y = _diagramLeftBottomPt.Y + (_coordinateParas.StartLineNoH + _coordinateParas.EndLineNoH) * gridHeight / 2 - _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y;
            }
            pt_title.Z = 0;
 
            DxfMText textTitle;
            if (this._isTwoLineAxisTileY)
                textTitle = new DxfMText(string.Format(@"{0}\P({1})", _axisTtileContentH, Eventech.Common.UnitHHelper.GetEnUnitName(_unitH)), pt_title, _axisTitleSizeY);//\P表示回车
            else
                textTitle = new DxfMText(string.Format("{0} ({1})", _axisTtileContentH, Eventech.Common.UnitHHelper.GetEnUnitName(_unitH)), pt_title, _axisTitleSizeY);//\P表示回车
 
            if (this._isRotateAxisTitleY)
            {
                textTitle.XAxis = new Vector3D(0, 1, 0);
                textTitle.ZAxis = new Vector3D(0, 0, 1);
            }
            if (this._axisTextFont != null)
                textTitle.Style = this._axisTextFont;
            if (_axisTitlePosiStyleY == eAxisTitlePosiStyle.Top)
            {
                textTitle.AttachmentPoint = AttachmentPoint.BottomCenter;
            }
            else
            {
                textTitle.AttachmentPoint = AttachmentPoint.TopCenter;
            }
            textTitle.Color = this._axisTitleColorH;
            _dxfFileModel.Entities.Add(textTitle);
 
 
            //画刻度线  (主)          
            if (_isDrawMajorTickY)
            {
                for (int i = _coordinateParas.StartLineNoH; i <= _coordinateParas.EndLineNoH; i++)
                {
                    double space = i * gridHeight;//水平线的间距
                    Point2D axisTitleStartPt = new Point2D(_diagramLeftBottomPt.X, _diagramLeftBottomPt.Y + space);
                    Point2D axisTitleEndPt = new Point2D(_diagramLeftBottomPt.X - _axisMajorTickLength, _diagramLeftBottomPt.Y + space);
                    DxfLine dxfLine = new DxfLine(axisTitleStartPt, axisTitleEndPt);
                    dxfLine.Color = this._gridLineColor;
 
                    _dxfFileModel.Entities.Add(dxfLine);
                }
            }
 
 
            //画刻度线 (子刻度)  
            if (_minorTickNumberY > 0)
            {
                for (int i = _coordinateParas.StartLineNoH; i <= _coordinateParas.EndLineNoH - 1; i++)
                {
                    double space = i * gridHeight;
 
                    for (int j = 1; j < _minorTickNumberY; j++)
                    {
                        double y = _diagramLeftBottomPt.Y + space + j * gridHeight / _minorTickNumberY;
 
                        Point2D startPt = new Point2D(_diagramLeftBottomPt.X, y);
                        Point2D endPt = new Point2D(_diagramLeftBottomPt.X - _axisMinorTickLength, y);
                        DxfLine dxfLine = new DxfLine(startPt, endPt);
                        dxfLine.Color = this._gridLineColor;
 
                        _dxfFileModel.Entities.Add(dxfLine);
                    }
                }
            }
 
        }
        protected double _minAxisLabelE = 0;//效率最小刻度
        protected virtual void DrawAxisE()
        {
            if (!this._isDispCurveQE)
                return;
 
            double coordSpace = _coordinateParas.CoordSpaceE;//一个格子代表的数值
 
            int gridNumber = _coordinateParas.EndLineNoE - _coordinateParas.StartLineNoE;//Y格子的数量
 
            //是否间隔的LABEL
            bool isIntervalLabel = false;
            if (_coordinateParas.StartLineNoE - _coordinateParas.EndLineNoE > 8)
            {
                isIntervalLabel = true;
            }
            double gridHeight = (_diagramLeftTopPt.Y - _diagramLeftBottomPt.Y) / _coordinateParas.GridNumberY;
 
            //刻度文字
            for (int i = _coordinateParas.StartLineNoE; i <= _coordinateParas.EndLineNoE; i++)
            {
                if (i <= _coordinateParas.EndLineNoNPSH)
                    continue;//保证不要重叠,效率少几个刻度没事
                double space = i * gridHeight;
                double kedu = _coordinateParas.CoordMinE + i * coordSpace;//刻度值显示
                if (kedu < 0.001)
                    kedu = 0;
                if (kedu < _minAxisLabelE)
                    continue;
                Point3D startPt = new Point3D(_diagramRightBottomPt.X + _axisLabelSpaceToDiagramY_right, _diagramRightBottomPt.Y + space - _axisLabelSizeY / 2, 0d);
                DxfText textX = new DxfText(kedu.ToString(), startPt, 2d);
                textX.Thickness = 0.4d;
                textX.Height = this._axisLabelSizeY;
                textX.Color = this._axisLabelColorE;
                if (_axisTextFont != null)
                    textX.Style = this._axisTextFont;
 
                _dxfFileModel.Entities.Add(textX);
 
                if (isIntervalLabel)
                {
                    i++;
                }
            }
 
 
            Point3D pt_title = new Point3D();
            pt_title.X = _diagramRightBottomPt.X + _axisTitleSpaceToDiagramY_right;
            //纵坐标标题的位置 0表示 中间, 1表示刻度的上面
            if (AxisTitlePosiStyleY == eAxisTitlePosiStyle.Top)
            {
                pt_title.Y = _diagramLeftBottomPt.Y + _coordinateParas.EndLineNoE * gridHeight + _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y;
            }
            else
            {
                pt_title.Y = _diagramLeftBottomPt.Y + (_coordinateParas.StartLineNoE + _coordinateParas.EndLineNoE) * gridHeight / 2 - _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y;
            }
            pt_title.Z = 0;
            DxfMText textTitle;
 
            if (this._isTwoLineAxisTileY)
                textTitle = new DxfMText(string.Format(@" {0}\P(%)", _axisTtileContentE), pt_title, this._axisTitleSizeY);
            else
                textTitle = new DxfMText(string.Format("{0} (%)", _axisTtileContentE), pt_title, this._axisTitleSizeY);
 
            if (this._isRotateAxisTitleY)
            {
                textTitle.XAxis = new Vector3D(0, 1, 0);
                textTitle.ZAxis = new Vector3D(0, 0, 1);
            }
 
 
            if (AxisTitlePosiStyleY == eAxisTitlePosiStyle.Top)
            {
                textTitle.AttachmentPoint = AttachmentPoint.BottomCenter;
            }
            else
            {
                textTitle.AttachmentPoint = AttachmentPoint.TopCenter;
            }
            if (_axisTextFont != null)
                textTitle.Style = _axisTextFont;
            textTitle.Color = _axisTitleColorE;
            _dxfFileModel.Entities.Add(textTitle);
 
 
 
 
            //画刻度线  (主)       
            if (_isDrawMajorTickY)
            {
                for (int i = _coordinateParas.StartLineNoE; i <= _coordinateParas.EndLineNoE; i++)
                {
                    double space = i * gridHeight;//水平线的间距
                    Point2D majorTickStartPt = new Point2D(_diagramRightBottomPt.X, _diagramRightBottomPt.Y + space);
                    Point2D majorTickEndPt = new Point2D(_diagramRightBottomPt.X + _axisMajorTickLength, _diagramRightBottomPt.Y + space);
                    DxfLine dxfLine = new DxfLine(majorTickStartPt, majorTickEndPt);
                    dxfLine.Color = this._gridLineColor;
 
                    _dxfFileModel.Entities.Add(dxfLine);
                }
            }
 
            //画较短刻度线   
            if (_minorTickNumberY > 0)
            {
                for (int i = _coordinateParas.StartLineNoE; i <= _coordinateParas.EndLineNoE - 1; i++)
                {
                    double space = i * gridHeight;
 
                    for (int j = 1; j < _minorTickNumberY; j++)
                    {
                        double y = _diagramRightBottomPt.Y + space + j * gridHeight / _minorTickNumberY;
 
                        Point2D startPt = new Point2D(_diagramRightBottomPt.X, y);
                        Point2D endPt = new Point2D(_diagramRightBottomPt.X + _axisMinorTickLength, y);
                        DxfLine dxfLine = new DxfLine(startPt, endPt);
                        dxfLine.Color = this._gridLineColor;
 
                        _dxfFileModel.Entities.Add(dxfLine);
                    }
                }
            }
 
        }
 
        protected virtual void DrawAxisP()
        {
            double coordSpace = _coordinateParas.CoordSpaceP;//一个格子代表的数值
            int gridNumber = _coordinateParas.EndLineNoP - _coordinateParas.StartLineNoP;//Y格子的数量
 
            //是否间隔的LABEL
            bool isIntervalLabel = false;
            if (_coordinateParas.StartLineNoP - _coordinateParas.EndLineNoP > 8)
            {
                isIntervalLabel = true;
            }
            double gridHeight = (_diagramLeftTopPt.Y - _diagramLeftBottomPt.Y) / _coordinateParas.GridNumberY;
 
            //刻度文字
            string unit_name = "kW";
            for (int i = _coordinateParas.StartLineNoP; i <= _coordinateParas.EndLineNoP; i++)
            {
                if (i >= _coordinateParas.StartLineNoH)
                    continue;//保证不要重叠,功率少几个刻度没事
 
                double space = i * gridHeight;
                double kedu_d = _coordinateParas.CoordMinP + i * coordSpace;//刻度值显示
                if (kedu_d < 0.001)
                    kedu_d = 0;
 
                string kedu_str = "";
 
                if (_unitP == Eventech.Model.UnitP.KW)
                {
                    kedu_str = kedu_d.ToString();
                }
                else
                {
                    if (_unitP == Eventech.Model.UnitP.HP)
                        unit_name = "hp";
                    else
                        unit_name = "";
                    kedu_str = Eventech.Common.UnitPHelper.fromKW(_unitP, kedu_d).ToString("N2");
                }
 
 
                var labelPtP = new Point3D(_diagramLeftBottomPt.X - _axisLabelSpaceToDiagramY_left, _diagramLeftBottomPt.Y + space, 0d);
                DxfMText axisLabel_p = new DxfMText(kedu_str, labelPtP, _axisLabelSizeY);//\P表示回车
                axisLabel_p.AttachmentPoint = AttachmentPoint.MiddleRight;
                if (_axisTextFont != null)
                    axisLabel_p.Style = this._axisTextFont;
                axisLabel_p.Color = this._axisLabelColorP;
                _dxfFileModel.Entities.Add(axisLabel_p);
 
                if (isIntervalLabel)
                {
                    i++;
                }
            }
 
            Point3D pt_title = new Point3D();
            pt_title.X = _diagramLeftBottomPt.X - _axisTitleSpaceToDiagramY_left;
            //纵坐标标题的位置 0表示 中间, 1表示刻度的上面
            if (AxisTitlePosiStyleY == eAxisTitlePosiStyle.Top)
            {
                pt_title.Y = _diagramLeftBottomPt.Y + _coordinateParas.EndLineNoP * gridHeight + _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y;
            }
            else
            {
                pt_title.Y = _diagramLeftBottomPt.Y + (_coordinateParas.StartLineNoP + _coordinateParas.EndLineNoP) * gridHeight / 2 - _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y;
            }
            pt_title.Z = 0;
 
 
 
            DxfMText textTitle;
            if (this._isTwoLineAxisTileY)
                textTitle = new DxfMText(string.Format(@"{0}\P({1})", _axisTtileContentP, unit_name), pt_title, this._axisTitleSizeY);
            else
                textTitle = new DxfMText(string.Format("{0} ({1})", _axisTtileContentP, unit_name), pt_title, this._axisTitleSizeY);
            if (this._isRotateAxisTitleY)
            {
                textTitle.XAxis = new Vector3D(0, 1, 0);
                textTitle.ZAxis = new Vector3D(0, 0, 1);
            }
 
            if (AxisTitlePosiStyleY == eAxisTitlePosiStyle.Top)
            {
                textTitle.AttachmentPoint = AttachmentPoint.BottomCenter;
            }
            else
            {
                textTitle.AttachmentPoint = AttachmentPoint.TopCenter;
            }
            if (_axisTextFont != null)
                textTitle.Style = _axisTextFont;
            textTitle.Color = _axisTitleColorP;
            _dxfFileModel.Entities.Add(textTitle);
 
 
 
            //画刻度线  (主)          
            if (_isDrawMajorTickY)
            {
                for (int i = _coordinateParas.StartLineNoP; i <= _coordinateParas.EndLineNoP; i++)
                {
                    double space = i * gridHeight;//水平线的间距
                    Point2D majorTickStartPt = new Point2D(_diagramLeftBottomPt.X, _diagramLeftBottomPt.Y + space);
                    Point2D majorTickEndPt = new Point2D(_diagramLeftBottomPt.X - _axisMajorTickLength, _diagramLeftBottomPt.Y + space);
                    DxfLine dxfLine = new DxfLine(majorTickStartPt, majorTickEndPt);
                    dxfLine.Color = this._gridLineColor;
 
                    _dxfFileModel.Entities.Add(dxfLine);
                }
            }
 
            //画较短刻度线   
            if (_minorTickNumberY > 0)
            {
                for (int i = _coordinateParas.StartLineNoP; i <= _coordinateParas.EndLineNoP - 1; i++)
                {
                    double space = i * gridHeight;
 
                    for (int j = 1; j < _minorTickNumberY; j++)
                    {
                        double y = _diagramLeftBottomPt.Y + space + j * gridHeight / _minorTickNumberY;
 
                        Point2D startPt = new Point2D(_diagramLeftBottomPt.X, y);
                        Point2D endPt = new Point2D(_diagramLeftBottomPt.X - _axisMinorTickLength, y);
                        DxfLine dxfLine = new DxfLine(startPt, endPt);
                        dxfLine.Color = this._gridLineColor;
 
                        _dxfFileModel.Entities.Add(dxfLine);
                    }
                }
            }
 
        }
 
        protected virtual void DrawAxisNPSH()
        {
            if (!_isNPSHCurve)
                return;
            if (_allCurveNPSH == null || _allCurveNPSH.Count() == 0)
                return;
 
            double coordSpace = _coordinateParas.CoordSpaceNPSH;//一个格子代表的数值
 
            int gridNumber = _coordinateParas.EndLineNoNPSH - _coordinateParas.StartLineNoNPSH;//Y格子的数量
 
 
            //是否间隔的LABNPSHL
            bool isIntervalLabel = false;
            if (_coordinateParas.StartLineNoNPSH - _coordinateParas.EndLineNoNPSH > 5)
            {
                isIntervalLabel = true;
            }
            double gridHeight = (_diagramLeftTopPt.Y - _diagramLeftBottomPt.Y) / _coordinateParas.GridNumberY;
 
            //刻度文字
            for (int i = _coordinateParas.StartLineNoNPSH; i <= _coordinateParas.EndLineNoNPSH; i++)
            {
                double space = i * gridHeight;
                double kedu = _coordinateParas.CoordMinNPSH + i * coordSpace;//刻度值显示
                if (kedu < 0.001)
                    kedu = 0;
                Point3D startPt = new Point3D(_diagramRightBottomPt.X + _axisLabelSpaceToDiagramY_right, _diagramRightBottomPt.Y + space - this._axisLabelSizeY / 2, 0d);
                DxfText textX = new DxfText(kedu.ToString(), startPt, 2d);
                textX.Thickness = 0.4d;
                textX.Height = this._axisLabelSizeY;
                textX.Color = this._axisLabelColorNPSH;
                if (_axisTextFont != null)
                    textX.Style = this._axisTextFont;
                _dxfFileModel.Entities.Add(textX);
 
                if (isIntervalLabel)
                {
                    i++;
                }
            }
 
 
            Point3D pt_title = new Point3D();
            pt_title.X = _diagramRightBottomPt.X + _axisTitleSpaceToDiagramY_right;
            //纵坐标标题的位置 0表示 中间, 1表示刻度的上面
            if (AxisTitlePosiStyleY == eAxisTitlePosiStyle.Top)
            {
                pt_title.Y = _diagramLeftBottomPt.Y + _coordinateParas.EndLineNoNPSH * gridHeight + _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y;
            }
            else
            {
                pt_title.Y = _diagramLeftBottomPt.Y + (_coordinateParas.StartLineNoNPSH + _coordinateParas.EndLineNoNPSH) * gridHeight / 2 - _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y;
            }
            pt_title.Z = 0;
 
 
 
            DxfMText textTitle = null;
            if (this._isTwoLineAxisTileY)
                textTitle = new DxfMText(string.Format(@" {0}\P(m)", _axisTtileContentNPSH), pt_title, this._axisTitleSizeY);
            else
                textTitle = new DxfMText(string.Format("{0} (m)", _axisTtileContentNPSH), pt_title, this._axisTitleSizeY);
 
            if (this._isRotateAxisTitleY)
            {
                textTitle.XAxis = new Vector3D(0, 1, 0);
                textTitle.ZAxis = new Vector3D(0, 0, 1);
            }
 
            if (AxisTitlePosiStyleY == eAxisTitlePosiStyle.Top)
            {
                textTitle.AttachmentPoint = AttachmentPoint.BottomCenter;
            }
            else
            {
                textTitle.AttachmentPoint = AttachmentPoint.TopCenter;
            }
            if (_axisTextFont != null)
                textTitle.Style = this._axisTextFont;
            textTitle.Color = this._axisTitleColorNPSH;
            _dxfFileModel.Entities.Add(textTitle);
 
 
            //画刻度线  (主)     
            if (_isDrawMajorTickY)
            {
                for (int i = _coordinateParas.StartLineNoNPSH; i <= _coordinateParas.EndLineNoNPSH; i++)
                {
                    double space = i * gridHeight;//水平线的间距
                    Point2D majorTickStartPt = new Point2D(_diagramRightBottomPt.X, _diagramRightBottomPt.Y + space);
                    Point2D majorTickEndPt = new Point2D(_diagramRightBottomPt.X + _axisMajorTickLength, _diagramRightBottomPt.Y + space);
                    DxfLine dxfLine = new DxfLine(majorTickStartPt, majorTickEndPt);
                    dxfLine.Color = this._gridLineColor;
 
                    _dxfFileModel.Entities.Add(dxfLine);
                }
            }
 
            //画较短刻度线   
            if (_minorTickNumberY > 0)
            {
                for (int i = _coordinateParas.StartLineNoNPSH; i <= _coordinateParas.EndLineNoNPSH - 1; i++)
                {
                    double space = i * gridHeight;
 
                    for (int j = 1; j < _minorTickNumberY; j++)
                    {
                        double y = _diagramRightBottomPt.Y + space + j * gridHeight / this._minorTickNumberY;
 
                        Point2D startPt = new Point2D(_diagramRightBottomPt.X, y);
                        Point2D endPt = new Point2D(_diagramRightBottomPt.X + this._axisMinorTickLength, y);
                        DxfLine dxfLine = new DxfLine(startPt, endPt);
                        dxfLine.Color = this._gridLineColor;
 
                        _dxfFileModel.Entities.Add(dxfLine);
                    }
                }
            }
 
        }
 
        protected virtual void DrawAxisY()
        {
            double spaceWidth = (_diagramLeftBottomPt.Y - _diagramLeftTopPt.Y) / (_coordinateParas.GridNumberY);//X轴上格子的宽度
            //绘制网格线
            if (_isDispGridLineY)
            {
                for (int i = 1; i < _coordinateParas.GridNumberY; i++)
                {
                    double space = i * spaceWidth;
                    Point2D startXgeziPt = new Point2D(_diagramLeftBottomPt.X, _diagramLeftBottomPt.Y - space);
                    Point2D endXgeziPt = new Point2D(_diagramRightTopPt.X, _diagramLeftBottomPt.Y - space);
                    DxfLine dxfLine = new DxfLine(startXgeziPt, endXgeziPt);
                    dxfLine.Color = _gridLineColor;
                    _dxfFileModel.Entities.Add(dxfLine);
 
                }
            }
 
            DrawAxisH();
 
            DrawAxisE();
 
            DrawAxisP();
 
            DrawAxisNPSH();
        }
 
        //初始化面板尺寸 
        protected virtual void InitialDiagramSize(double diagramLength, double diagramHeight)
        {
            _diagramLeftBottomPt = new Point2D(0, 0);
 
            _diagramRightBottomPt.X = _diagramLeftBottomPt.X + diagramLength;
            _diagramRightBottomPt.Y = _diagramLeftBottomPt.Y;
 
            _diagramLeftTopPt.X = _diagramLeftBottomPt.X;
            _diagramLeftTopPt.Y = _diagramLeftBottomPt.Y + diagramHeight;
 
            _diagramRightTopPt.X = _diagramRightBottomPt.X;
            _diagramRightTopPt.Y = _diagramLeftBottomPt.Y + diagramHeight;
 
            DxfLine lineBottom = new DxfLine(_diagramLeftBottomPt, _diagramRightBottomPt);
            lineBottom.LineWeight = _diagramBoundaryLineWidth;
            _dxfFileModel.Entities.Add(lineBottom);
 
            DxfLine lineLeft = new DxfLine(_diagramLeftBottomPt, _diagramLeftTopPt);
            lineLeft.LineWeight = _diagramBoundaryLineWidth;
            _dxfFileModel.Entities.Add(lineLeft);
 
            DxfLine lineTop = new DxfLine(_diagramLeftTopPt, _diagramRightTopPt);
            lineTop.LineWeight = _diagramBoundaryLineWidth;
            _dxfFileModel.Entities.Add(lineTop);
 
            DxfLine lineRight = new DxfLine(_diagramRightBottomPt, _diagramRightTopPt);
            lineRight.LineWeight = _diagramBoundaryLineWidth;
            _dxfFileModel.Entities.Add(lineRight);
        }
 
 
 
 
        //X轴实际尺寸换算为像素尺寸
        protected override double MapRealToPictQ(double Q)
        {
            return ((Q - _coordinateParas.CoordMinQ) * (_diagramRightBottomPt.X - _diagramLeftBottomPt.X) / (_coordinateParas.GridNumberX * _coordinateParas.CoordSpaceQ)) + _diagramLeftBottomPt.X;
        }
 
 
        //扬程曲线Y坐标实际尺寸换算为像素尺寸
        protected override double MapRealToPictH(double H)
        {
            double diagramHeight = (_diagramLeftTopPt.Y - _diagramLeftBottomPt.Y);//汽蚀曲线图的高度
            return _diagramLeftBottomPt.Y + (H - _coordinateParas.CoordMinH) * diagramHeight / (_coordinateParas.CoordSpaceH * _coordinateParas.GridNumberY);
        }
 
        //效率曲线Y坐标实际尺寸换算为像素尺寸
        protected override double MapRealToPictE(double E)
        {
            double diagramHeight = (_diagramLeftTopPt.Y - _diagramLeftBottomPt.Y);//汽蚀曲线图的高度
            return _diagramLeftBottomPt.Y + (E - _coordinateParas.CoordMinE) * diagramHeight / (_coordinateParas.CoordSpaceE * _coordinateParas.GridNumberY);
        }
 
        //功率曲线Y坐标实际尺寸换算为像素尺寸
        protected override double MapRealToPictP(double P)
        {
            double diagramHeight = (_diagramLeftTopPt.Y - _diagramLeftBottomPt.Y);//汽蚀曲线图的高度
            return _diagramLeftBottomPt.Y + (P - _coordinateParas.CoordMinP) * diagramHeight / (_coordinateParas.CoordSpaceP * _coordinateParas.GridNumberY);
        }
 
        //汽蚀曲线Y坐标实际尺寸换算为像素尺寸
        protected override double MapRealToPictNPSH(double NPSH)
        {
            if (_coordinateParas.CoordSpaceNPSH < 0.01)
                return 0;
            double diagramHeight = (_diagramLeftTopPt.Y - _diagramLeftBottomPt.Y);//汽蚀曲线图的高度
            return _diagramLeftBottomPt.Y + (NPSH - _coordinateParas.CoordMinNPSH) * diagramHeight / (_coordinateParas.CoordSpaceNPSH * _coordinateParas.GridNumberY);
        }
 
 
    }
}