tx
2025-04-09 fa7510e1ed63df0366787fa4ed1b3db6426d2b46
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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing.Drawing2D;
 
using DevExpress.XtraEditors;
using DevExpress.XtraCharts;
using DevExpress.Utils;
 
using Eventech.Model;
using TProduct.Model;
using TProduct.CorpSetting;
 
//测试时使用:只有功率和扬程没有效率
namespace TProduct.WinFrmUI.TPump
{
    internal partial class ChartLxpNpshCurveCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        #region 私有字段
        private List<TProduct.Model.PumpNpshTestRecordViewModel> _allRecords = new List<TProduct.Model.PumpNpshTestRecordViewModel>();
        private List<FeatPoint> _curveInfoQH = null;
        private List<FeatPoint> _curveInfoQE = null;
        private List<FeatPoint> _curveInfoQP = null;
        private TProduct.Model.ProductMainExPump _currentPump = null;
        private TProduct.Model.RatedParas4Pump _ratedParas = null;
        private Eventech.Model.PointToleranceParas _toleranceParas = null;
        #endregion
 
        #region CHART变量
        //测试的原始点
        private Series SeriesQHpoint = null;
        private Series SeriesQEpoint = null;
        private Series SeriesQPpoint = null;
 
        //拟合后的曲线上的点
        private Series SeriesQHcurve = null;
        private Series SeriesQEcurve = null;
        private Series SeriesQPcurve = null;
 
        //额定点
        private Series SeriesRatedMarkerH = null;
        private Series SeriesRatedMarkerV = null;
        //
        private DevExpress.XtraCharts.XYDiagram mainChartDiagram;
        private DevExpress.XtraCharts.XYDiagramPane bottomChartDiagram = null;
        //
        AxisX AxisQ = null;
        AxisY QHAxisY = null;
        SecondaryAxisY QEAxisY = null;
        SecondaryAxisY QPAxisY = null;
        #endregion
 
        #region 构造函数和加载函数
        public ChartLxpNpshCurveCtrl()
        {
            InitializeComponent();
 
            #region 图标控件显示
 
            mainChartDiagram = (XYDiagram)chartControl1.Diagram;
            for (int i = 0; i < mainChartDiagram.Panes.Count; i++)
            {
                var panel = mainChartDiagram.Panes[i];
                if (panel.Name == "PaneBottom")
                {
                    bottomChartDiagram = panel;
                }
            }
            //
            SeriesQHpoint = chartControl1.Series["SeriesQHpoint"];
            SeriesQEpoint = chartControl1.Series["SeriesQEpoint"];
            SeriesQPpoint = chartControl1.Series["SeriesQPpoint"];
            SeriesQHcurve = chartControl1.Series["SeriesQHcurve"];
            SeriesQEcurve = chartControl1.Series["SeriesQEcurve"];
            SeriesQPcurve = chartControl1.Series["SeriesQPcurve"];
 
 
 
            SeriesQHpoint.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
            SeriesQHcurve.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
   
            SeriesQEpoint.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
            SeriesQEcurve.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
 
            SeriesQPpoint.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
            SeriesQPcurve.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Numerical;
 
            SeriesQHpoint.Visible = false;
            SeriesQHcurve.Visible = false;
            SeriesQEpoint.Visible = false;
            SeriesQEcurve.Visible = false;
            SeriesQPpoint.Visible = false;
            SeriesQPcurve.Visible = false;
 
            SeriesQHcurve.CrosshairEnabled = DefaultBoolean.False;
            SeriesQEcurve.CrosshairEnabled = DefaultBoolean.False;
            SeriesQPcurve.CrosshairEnabled = DefaultBoolean.False;
 
            bottomChartDiagram.Visibility = ChartElementVisibility.Hidden;
 
            SeriesQHpoint.CrosshairEnabled = DefaultBoolean.False;
            SeriesQEpoint.CrosshairEnabled = DefaultBoolean.False;
            SeriesQPpoint.CrosshairEnabled = DefaultBoolean.False;
 
 
 
            //
            SeriesRatedMarkerH = chartControl1.Series["SeriesRatedMarkerH"];
            SeriesRatedMarkerV = chartControl1.Series["SeriesRatedMarkerV"];
            SeriesRatedMarkerH.Visible = false;
            SeriesRatedMarkerV.Visible = false;
            SeriesRatedMarkerH.CrosshairEnabled = DefaultBoolean.False;
            SeriesRatedMarkerV.CrosshairEnabled = DefaultBoolean.False;
 
            //
            AxisQ = mainChartDiagram.AxisX;
            QHAxisY = mainChartDiagram.AxisY;
            QEAxisY = mainChartDiagram.SecondaryAxesY.GetAxisByName("QEAxisY");
            QPAxisY = mainChartDiagram.SecondaryAxesY.GetAxisByName("QPAxisY");
 
            AxisQ.Visibility = DefaultBoolean.False;
            QHAxisY.Visibility = DefaultBoolean.False;
            QEAxisY.Visibility = DefaultBoolean.False;
            QPAxisY.Visibility = DefaultBoolean.False;
 
            #endregion
 
            //if (TPump.Localization.UICulture.IsEnglish)
            //{//英语
            //    //资源文件
            //    System.ComponentModel.ComponentResourceManager resources
            //        = new System.ComponentModel.ComponentResourceManager(typeof(ChartFeatTestIngCtrl));
 
            //    TPump.Localization.SetResource.ContextMenuStrip(chartRightMenu, resources);
            //    IAxisY.Title.Text = "Head(m)";
            //    InPutPAxisY.Title.Text = "Eff(%)";
            //}
 
            this.chartControl1.CustomPaint += new DevExpress.XtraCharts.CustomPaintEventHandler(this.chartControl_CustomPaint);
        }
 
        private void LoadWindow(object sender, EventArgs e)
        {
            SetChartDisplay();
        }
 
 
        //设置显示
        private void SetChartDisplay()
        {
            AxisQ.GridLines.MinorVisible = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.IsDispMinorLineX;
            QHAxisY.GridLines.MinorVisible = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.IsDispMinorLineY;
            QEAxisY.GridLines.MinorVisible = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.IsDispMinorLineY;
 
            AxisQ.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorQ;
            AxisQ.Label.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorQ;
            AxisQ.Title.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorQ;
            AxisQ.MinorCount = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.MinorCountQ;
            AxisQ.Label.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisLabelFontQ;
            AxisQ.Title.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisTitleFontQ;
 
            AxisQ.GridLines.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorX;
            AxisQ.GridLines.MinorColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorX;
            AxisQ.GridLines.MinorVisible = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.IsDispMinorLineX;
 
            QHAxisY.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorH;
            QHAxisY.Label.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorH;
            QHAxisY.Title.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorH;
            QHAxisY.MinorCount = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.MinorCountH;
            QHAxisY.Label.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisLabelFontH;
            QHAxisY.Title.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisTitleFontH;
            QHAxisY.GridLines.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorY;
 
            QEAxisY.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorE;
            QEAxisY.Label.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorE;
            QEAxisY.Title.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorE;
            QEAxisY.MinorCount = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.MinorCountE;
            QEAxisY.Label.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisLabelFontE;
            QEAxisY.Title.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisTitleFontE;
            QEAxisY.GridLines.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorY;
 
            SeriesQHcurve.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CurveColorQH;
            SeriesQEcurve.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CurveColorQE;
            SeriesQPcurve.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CurveColorQP;
 
            SeriesQHpoint.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointColorQH;
            (SeriesQHpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Size = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointSizeQH;
            (SeriesQHpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Kind = (MarkerKind)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointKindQH;
 
            SeriesQPpoint.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointColorQP;
            (SeriesQPpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Size = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointSizeQP;
            (SeriesQPpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Kind = (MarkerKind)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointKindQP;
 
            SeriesQEpoint.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointColorQE;
            (SeriesQEpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Size = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointSizeQE;
            (SeriesQEpoint.View as DevExpress.XtraCharts.PointSeriesView).PointMarkerOptions.Kind = (MarkerKind)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.PointKindQE;
 
 
 
            AxisQ.GridLines.LineStyle.DashStyle = (DevExpress.XtraCharts.DashStyle)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLineTypeX;
            QHAxisY.GridLines.LineStyle.DashStyle = (DevExpress.XtraCharts.DashStyle)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLineTypeY;
            QEAxisY.GridLines.LineStyle.DashStyle = (DevExpress.XtraCharts.DashStyle)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLineTypeY;
            QPAxisY.GridLines.LineStyle.DashStyle = (DevExpress.XtraCharts.DashStyle)TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLineTypeY;
 
            SeriesRatedMarkerH.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.RatedLineColor;
            SeriesRatedMarkerV.View.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.RatedLineColor;
 
            (SeriesRatedMarkerH.View as DevExpress.XtraCharts.LineSeriesView).LineStyle.Thickness = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.RatedLineWidth;
            (SeriesRatedMarkerV.View as DevExpress.XtraCharts.LineSeriesView).LineStyle.Thickness = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.RatedLineWidth;
 
            QPAxisY.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorP;
            QPAxisY.Label.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorP;
            QPAxisY.Title.TextColor = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.CoordColorP;
            QPAxisY.MinorCount = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.MinorCountE;
            QPAxisY.Label.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisLabelFontE;
            QPAxisY.Title.Font = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.AxisTitleFontE;
            QPAxisY.GridLines.Color = TProduct.WinFrmUI.TPump.ChartDisp.Settings.Default.GridLinesColorY;
        }
        #endregion
 
 
        #region 设置
        //
        internal void EmptyRecordPoint()
        {
            _allRecords = new List<PumpNpshTestRecordViewModel>();
            _curveInfoQH = null;
            _curveInfoQE = null;
            _curveInfoQP = null;
            ReCalcFitPoint();
        }
 
 
        internal void SetRecordPoint(List<TProduct.Model.PumpNpshTestRecordViewModel> pointInfos)
        {
            if (pointInfos == null || pointInfos.Count == 0)
                return;
            _allRecords = pointInfos;
            ReCalcFitPoint();
        }
 
        //计算
        private void ReCalcFitPoint()
        {
            //if (_allRecords == null || _allRecords.Count < 1)
            //{
            //    UpdateChart();
            //    return;
            //}
 
            //List<FeatPoint> PointInfoQH = new List<FeatPoint>();
            //List<FeatPoint> PointInfoQE = new List<FeatPoint>();
            //List<FeatPoint> PointInfoQP = new List<FeatPoint>();
 
            //foreach (var pt in _allRecords)
            //{
            //    PointInfoQH.Add(new FeatPoint(pt.CorrectPtQ, pt.CorrectPtH));
            //    if (pt.CorrectPtE.HasValue)
            //        PointInfoQE.Add(new FeatPoint(pt.CorrectPtQ, pt.CorrectPtE.Value));
            //    if (pt.CorrectPtP.HasValue)
            //        PointInfoQP.Add(new FeatPoint(pt.CorrectPtQ, pt.CorrectPtP.Value));
            //}
            //this._curveInfoQH = null;
            //if (this._currentPump.CurveFitTypeQH == eCurveFitType.FourM)
            //{
            //    if (PointInfoQH.Count >= 5)
            //    {
            //        this._curveInfoQH = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQH, this._currentPump.CurveFitTypeQH, 12);
            //    }
            //}
            //else if (this._currentPump.CurveFitTypeQH == eCurveFitType.CubicCurve)
            //{
            //    if (PointInfoQH.Count >= 4)
            //    {
            //        this._curveInfoQH = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQH, this._currentPump.CurveFitTypeQH, 12);
            //    }
            //}
            //else
            //{
            //    if (PointInfoQH.Count >= 3)
            //    {
            //        this._curveInfoQH = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQH, this._currentPump.CurveFitTypeQH, 12);
            //    }
            //}
 
            //this._curveInfoQE = null;
            //if (this._currentPump.CurveFitTypeQE == eCurveFitType.FourM)
            //{
            //    if (PointInfoQE.Count >= 5)
            //    {
            //        this._curveInfoQE = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQE, this._currentPump.CurveFitTypeQE, 12);
            //    }
            //}
            //else if (this._currentPump.CurveFitTypeQE == eCurveFitType.CubicCurve)
            //{
            //    if (PointInfoQE.Count >= 4)
            //    {
            //        this._curveInfoQE = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQE, this._currentPump.CurveFitTypeQE, 12);
            //    }
            //}
            //else
            //{
            //    if (PointInfoQE.Count >= 3)
            //    {
            //        this._curveInfoQE = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQE, this._currentPump.CurveFitTypeQE, 12);
            //    }
            //}
 
            //this._curveInfoQP = null;
            //if (this._currentPump.CurveFitTypeQP == eCurveFitType.FourM)
            //{
            //    if (PointInfoQP.Count >= 5)
            //    {
            //        this._curveInfoQP = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQP, this._currentPump.CurveFitTypeQP, 12);
            //    }
            //}
            //else if (this._currentPump.CurveFitTypeQP == eCurveFitType.CubicCurve)
            //{
            //    if (PointInfoQP.Count >= 4)
            //    {
            //        this._curveInfoQP = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQP, this._currentPump.CurveFitTypeQP, 12);
            //    }
            //}
            //else
            //{
            //    if (PointInfoQP.Count >= 3)
            //    {
            //        this._curveInfoQP = Eventech.Common.FitCurveHelper.GetFitPoints(PointInfoQP, this._currentPump.CurveFitTypeQP, 12);
            //    }
            //}
 
            ////重新更新图表
            //UpdateChart();
        }
 
        //
 
        public void SetRatedParas(
            TProduct.Model.ProductMainExPump pump,
            TProduct.Model.RatedParas4Pump ratedParas,
            List<Model.TestGradeJudgeItem> testJudgeItems)
        {
            this._currentPump = pump;
            this._ratedParas = ratedParas;
            if (ratedParas == null)
                return;
 
            RefreshJudgeItem(testJudgeItems);
 
            CalcCoordByRatedParas();
        }
 
        public void RefreshJudgeItem(List<Model.TestGradeJudgeItem> testJudgeItems)
        {
            if (this._ratedParas == null)
                return;
 
            _toleranceParas = new PointToleranceParas();
            var flow_min = testJudgeItems.Find(x => x.TargeType == eTestJudgeTargetType.流量 && x.ThresholdType == TestGradeJudgeItem.eThresholdType.Min);
            if (flow_min != null)
            {
                _toleranceParas.TolRatioMinQ = flow_min.ThresholdValue;
            }
            var flow_max = testJudgeItems.Find(x => x.TargeType == eTestJudgeTargetType.流量 && x.ThresholdType == TestGradeJudgeItem.eThresholdType.Max);
            if (flow_max != null)
            {
                _toleranceParas.TolRatioMaxQ = flow_max.ThresholdValue;
            }
 
            var head_min = testJudgeItems.Find(x => x.TargeType == eTestJudgeTargetType.扬程 && x.ThresholdType == TestGradeJudgeItem.eThresholdType.Min);
            if (head_min != null)
            {
                _toleranceParas.TolRatioMinH = head_min.ThresholdValue;
            }
            var head_max = testJudgeItems.Find(x => x.TargeType == eTestJudgeTargetType.扬程 && x.ThresholdType == TestGradeJudgeItem.eThresholdType.Max);
            if (head_max != null)
            {
                _toleranceParas.TolRatioMaxH = head_max.ThresholdValue;
            }
        }
 
        Eventech.Model.FeatPoint _judgePoint = null;
        internal void SetJudgePoint(FeatPoint judgePoint)
        {
            this._judgePoint = judgePoint;
        }
        bool _isDispJudgePoint = false;
        public void SetJudgePointDisp(bool isDisp)
        {
            this._isDispJudgePoint = isDisp; this.Invalidate();
        }
        EquipCurveParas _equipCurve = null;
        internal void SetEquipCurve(EquipCurveParas equipCurve)
        {
            this._equipCurve = equipCurve;
        }
        bool _isDispEquipCurve = false;
        public void SetEquipCurveDisp(bool isDisp)
        {
            this._isDispEquipCurve = isDisp;
            this.Invalidate();
        }
        #endregion
 
 
        #region 坐标
        //坐标
        private Eventech.Model.LxpCoordinateParas _coordinateParas = null;
        private double _coordMinQ = 0, _coordMaxQ = 0;//流量从0开始
        private double _coordMinH = 10000, _coordMaxH = 0;
        private double _coordMinP = 10000, _coordMaxP = 0;
        private double _coordMaxE = 0;
 
        //计算坐标
        internal bool CheckCoordinate()
        {
            if (_allRecords == null || _allRecords.Count < 1)
            {
                return false;
            }
 
            bool isReBuildCoordinate = false;
 
            double maxQ = Math.Max(_coordMaxQ, this._ratedParas.Q);
            double maxH = Math.Max(_coordMaxH, this._ratedParas.H);
            double minH = _coordMinH;
            double maxE = _coordMaxE;
            double maxP = _coordMaxP;
            double minP = _coordMinP;
 
 
            //foreach (var pt in _allRecords)
            //{
            //    maxQ = Math.Max(maxQ, pt.CorrectPtQ);
            //    maxH = Math.Max(maxH, pt.CorrectPtH);
            //    minH = Math.Min(minH, pt.CorrectPtH);
            //    if (pt.CorrectPtE != null)
            //    {
            //        maxE = Math.Max(maxE, pt.CorrectPtE.Value);
            //    }
            //    if (pt.CorrectPtP != null)
            //    {
            //        minP = Math.Min(minP, pt.CorrectPtP.Value);
            //        maxP = Math.Max(maxP, pt.CorrectPtP.Value);
            //    }
            //}
 
            if (maxQ > _coordMaxQ)
            {
                if (maxQ < 100)
                    maxQ = maxQ * 1.2;
                else if (maxQ < 300)
                    maxQ = maxQ * 1.1;
                else
                    maxQ = maxQ * 1.02;
 
                isReBuildCoordinate = true;
            }
            if (maxH > _coordMaxH || minH < _coordMinH)
            {
                minH = minH * 0.95;
                maxH = maxH * 1.1;
                isReBuildCoordinate = true;
            }
            if (maxP > _coordMaxP || minP < _coordMinP)
            {
                minP = minP * 0.95;
                maxP = maxP * 1.1;
                isReBuildCoordinate = true;
            }
            if (maxE > _coordMaxE)
            {
                isReBuildCoordinate = true;
            }
 
 
            //检查是否需要重建坐标  
            if (_coordinateParas == null)
            {
                isReBuildCoordinate = true;//原来没有,就必须重建坐标系
                _coordinateParas = new LxpCoordinateParas();
                _coordinateParas.GridNumberX = 10;
                _coordinateParas.GridNumberY = 12;
            }
 
            //不重建坐标就不用继续了
            if (!isReBuildCoordinate)
                return false;
 
            //流量
            double minQ = 0;//流量从0开始
            _coordinateParas.CoordSpaceQ = Eventech.Common.CoordinateHelper.GetOptimalSpaceMin(minQ, maxQ, 10, out _coordMinQ, out _coordMaxQ);
            _coordMinQ = Math.Max(0, _coordMinQ);//防止跑到负数去  
            _coordinateParas.CoordMinQ = _coordMinQ;
            _coordMaxQ = _coordMinQ;
            _coordinateParas.GridNumberX = 1;
            while (_coordMaxQ < maxQ)
            {
                _coordMaxQ = _coordMaxQ + _coordinateParas.CoordSpaceQ;
                _coordinateParas.GridNumberX++;
            }
 
            //扬程(保证最大值显示)
            _coordinateParas.StartLineNoH = 4;
            _coordinateParas.EndLineNoH = 12;
            _coordinateParas.CoordSpaceH = Eventech.Common.CoordinateHelper.GetOptimalSpaceMax(minH, maxH, 8,
                out _coordMinH, out _coordMaxH);
            if (_ratedParas != null)
            {
                double minSpaceH = Eventech.Common.CoordinateHelper.GetOptimalSpace(_ratedParas.H / 8);
                _coordinateParas.CoordSpaceH = Math.Max(minSpaceH, Eventech.Common.CoordinateHelper.GetOptimalSpaceMax(minH, maxH, 10, out _coordMinH, out _coordMaxH));
            }
            //计算扬程有效刻度
            double disH = _coordMaxH;
            _coordinateParas.StartLineNoH = _coordinateParas.EndLineNoH;
            while (disH > minH || (_coordinateParas.EndLineNoH - _coordinateParas.StartLineNoH) < 5)
            {
                disH = disH - _coordinateParas.CoordSpaceH;
                if (disH < 0)
                    break;
                _coordinateParas.StartLineNoH--;
            }
            //
            _coordinateParas.CoordMinH = _coordMaxH - _coordinateParas.EndLineNoH * _coordinateParas.CoordSpaceH;
 
            //功率(保证最小值显示)
            _coordinateParas.StartLineNoP = 0;
            _coordinateParas.EndLineNoP = 5;
 
            //计算间隔
            _coordinateParas.CoordSpaceP = Eventech.Common.CoordinateHelper.GetOptimalSpaceMin(minP, maxP,
                5, out _coordMinP, out _coordMaxP);
            _coordinateParas.CoordMinP = _coordMaxP - _coordinateParas.EndLineNoP * _coordinateParas.CoordSpaceP;
 
 
            //效率
            if (maxE < 50)
            {
                _coordinateParas.StartLineNoE = 0;
                _coordinateParas.EndLineNoE = 10;
                _coordinateParas.CoordSpaceE = 5;
                _coordinateParas.CoordMinE = 0;
                _coordMaxE = 50;
            }
            else if (maxE < 75)
            {
                _coordinateParas.StartLineNoE = 0;
                _coordinateParas.EndLineNoE = 10;
                _coordinateParas.CoordSpaceE = 7.5;
                _coordinateParas.CoordMinE = 0;
                _coordMaxE = 75;
            }
            else
            {
                _coordinateParas.StartLineNoE = 0;
                _coordinateParas.EndLineNoE = 10;
                _coordinateParas.CoordSpaceE = 10;
                _coordinateParas.CoordMinE = 0;
                _coordMaxE = 100;
            }
 
            return isReBuildCoordinate;
        }
 
        //根据额定参数计算坐标
        private void CalcCoordByRatedParas()
        {
            if (this._ratedParas == null)
                return;
            _coordinateParas = new Eventech.Model.LxpCoordinateParas();
            _coordinateParas.GridNumberX = 10;
            _coordinateParas.GridNumberY = 12;
 
            double maxQ = Math.Round(this._ratedParas.Q * 1.2, 2);//流量从0开始
            double maxH = Math.Round(this._ratedParas.H * 1.1, 2), minH = Math.Round(this._ratedParas.H * 0.8, 2);
 
            //流量
            double minQ = 0;//流量从0开始
            _coordinateParas.CoordSpaceQ = Eventech.Common.CoordinateHelper.GetOptimalSpaceMin(minQ, maxQ, 10, out _coordMinQ, out _coordMaxQ);
            _coordMinQ = Math.Max(0, _coordMinQ);//防止跑到负数去  
            _coordinateParas.CoordMinQ = _coordMinQ;
            _coordMaxQ = _coordMinQ;
            _coordinateParas.GridNumberX = 1;
            while (_coordMaxQ < maxQ * 1.05)
            {
                _coordMaxQ = _coordMaxQ + _coordinateParas.CoordSpaceQ;
                _coordinateParas.GridNumberX++;
            }
 
            //扬程(保证最大值显示)
            _coordinateParas.StartLineNoH = 4;
            _coordinateParas.EndLineNoH = 12;
            _coordinateParas.CoordSpaceH = Eventech.Common.CoordinateHelper.GetOptimalSpaceMax(minH, maxH, 8, out _coordMinH, out _coordMaxH);
 
            double minSpaceH = Eventech.Common.CoordinateHelper.GetOptimalSpace(this._ratedParas.H / 8);
            _coordinateParas.CoordSpaceH = Math.Max(minSpaceH, Eventech.Common.CoordinateHelper.GetOptimalSpaceMax(minH, maxH, 10, out _coordMinH, out _coordMaxH));
 
 
            //计算扬程有效刻度
            double disH = _coordMaxH;
            _coordinateParas.StartLineNoH = _coordinateParas.EndLineNoH;
            while (disH > minH * 0.98 || (_coordinateParas.EndLineNoH - _coordinateParas.StartLineNoH) < 5)
            {
                disH = disH - _coordinateParas.CoordSpaceH;
                if (disH < 0)
                    break;
                _coordinateParas.StartLineNoH--;
            }
            //
            _coordinateParas.CoordMinH = _coordMaxH - _coordinateParas.EndLineNoH * _coordinateParas.CoordSpaceH;
 
            //效率
            if (this._ratedParas.E < 50)
            {
                _coordinateParas.StartLineNoE = 0;
                _coordinateParas.EndLineNoE = 10;
                _coordinateParas.CoordSpaceE = 5;
                _coordinateParas.CoordMinE = 0;
                _coordMaxE = 50;
            }
            else if (this._ratedParas.E < 75)
            {
                _coordinateParas.StartLineNoE = 0;
                _coordinateParas.EndLineNoE = 10;
                _coordinateParas.CoordSpaceE = 7.5;
                _coordinateParas.CoordMinE = 0;
                _coordMaxE = 75;
            }
            else
            {
                _coordinateParas.StartLineNoE = 0;
                _coordinateParas.EndLineNoE = 10;
                _coordinateParas.CoordSpaceE = 10;
                _coordinateParas.CoordMinE = 0;
                _coordMaxE = 100;
            }
 
            _coordinateParas.StartLineNoP = 0;
            _coordinateParas.EndLineNoP = 10;
            _coordinateParas.CoordSpaceP = 1;
            _coordinateParas.CoordMinP = 0;
        }
 
        //更新图表坐标
        internal void UpdateCoordinate()
        {
            //先设置为不显示
            AxisQ.Visibility = DefaultBoolean.False;
            QHAxisY.GridLines.Visible = false;
            QHAxisY.Visibility = DefaultBoolean.False;
            QEAxisY.GridLines.Visible = false;
            QEAxisY.Visibility = DefaultBoolean.False;
 
            if (_coordinateParas == null)
                return;
 
            //流量坐标刻度
            List<CustomAxisLabel> q_Label_List = new List<CustomAxisLabel>();
            AxisQ.CustomLabels.Clear();
            double disQ = _coordinateParas.CoordMinQ;
            for (int i = 0; i < _coordinateParas.GridNumberX + 1; i++)
            {
                q_Label_List.Add(new CustomAxisLabel(disQ.ToString(), disQ));
                disQ = disQ + _coordinateParas.CoordSpaceQ;
            }
            AxisQ.CustomLabels.AddRange(q_Label_List.ToArray());
            this._coordMinQ = _coordinateParas.CoordMinQ ;
            this._coordMaxQ = _coordinateParas.DispMaxQ() ;
 
            //设置显示
            TProduct.WinFrmUI.XtraChartHelper.SetAxisRange(AxisQ, _coordinateParas.CoordMinQ,
                _coordinateParas.CoordMinQ + _coordinateParas.GridNumberX * _coordinateParas.CoordSpaceQ);
            AxisQ.GridLines.Visible = true;
            AxisQ.Visibility = DefaultBoolean.True;
 
 
            //扬程坐标刻度
            QHAxisY.CustomLabels.Clear();
            List<CustomAxisLabel> h_Label_List = new List<CustomAxisLabel>();
            double disH = _coordinateParas.CoordMinH + _coordinateParas.CoordSpaceH * _coordinateParas.StartLineNoH;
            for (int i = _coordinateParas.StartLineNoH; i < _coordinateParas.EndLineNoH + 1; i++)
            {
                h_Label_List.Add(new CustomAxisLabel(disH < 0 ? "" : disH.ToString(), disH));
                disH = disH + _coordinateParas.CoordSpaceH;
            }
            QHAxisY.CustomLabels.AddRange(h_Label_List.ToArray());
            //设置显示
            TProduct.WinFrmUI.XtraChartHelper.SetAxisRange(QHAxisY, _coordinateParas.CoordMinH,
                _coordinateParas.CoordMinH + _coordinateParas.GridNumberY * _coordinateParas.CoordSpaceH);
            QHAxisY.GridLines.Visible = true;
            QHAxisY.Visibility = DefaultBoolean.True;
            this._coordMinH = _coordinateParas.DispMinH();
            this._coordMaxH = _coordinateParas.DispMaxH();
 
            //功率坐标刻度
            QPAxisY.CustomLabels.Clear();
            List<CustomAxisLabel> P_Label_List = new List<CustomAxisLabel>();
            double disP = _coordinateParas.CoordMinP + _coordinateParas.CoordSpaceP * _coordinateParas.StartLineNoP;
            for (int i = _coordinateParas.StartLineNoP; i < _coordinateParas.EndLineNoP + 1; i++)
            {
                P_Label_List.Add(new CustomAxisLabel(disP < 0 ? "" : disP.ToString(), disP));
                disP = disP + _coordinateParas.CoordSpaceP;
            }
            QPAxisY.CustomLabels.AddRange(P_Label_List.ToArray());
            //设置显示
            TProduct.WinFrmUI.XtraChartHelper.SetAxisRange(QPAxisY, 
                _coordinateParas.CoordMinP + _coordinateParas.StartLineNoP * _coordinateParas.CoordSpaceP,
                _coordinateParas.CoordMinP + _coordinateParas.EndLineNoP * _coordinateParas.CoordSpaceP);
            QPAxisY.GridLines.Visible = _isDispQP  ;
            this.QPAxisY.Visibility = _isDispQP ? DefaultBoolean.True : DefaultBoolean.False;
            this._coordMinP = _coordinateParas.DispMinP();
            this._coordMaxP = _coordinateParas.DispMaxP();
 
 
            //效率坐标刻度
            QEAxisY.CustomLabels.Clear();
            List<CustomAxisLabel> E_Label_List = new List<CustomAxisLabel>();
            double disE = _coordinateParas.CoordMinE + _coordinateParas.CoordSpaceE * _coordinateParas.StartLineNoE;
            for (int i = _coordinateParas.StartLineNoE; i < _coordinateParas.EndLineNoE + 1; i++)
            {
                E_Label_List.Add(new CustomAxisLabel(disE < 0 ? "" : disE.ToString(), disE));
                disE = disE + _coordinateParas.CoordSpaceE;
            }
            QEAxisY.CustomLabels.AddRange(E_Label_List.ToArray());
            //设置显示
            TProduct.WinFrmUI.XtraChartHelper.SetAxisRange(QEAxisY, _coordinateParas.CoordMinE,
                _coordinateParas.CoordMinE + _coordinateParas.GridNumberY * _coordinateParas.CoordSpaceE);
            QEAxisY.GridLines.Visible = true;
            this.QEAxisY.Visibility = _isDispQE ? DefaultBoolean.True : DefaultBoolean.False;
            //this._coordMinE = _coordinateParas.DispMinE();
            this._coordMaxE = _coordinateParas.DispMaxE();
 
            if (OnChangeCoordinate != null)
            {
                OnChangeCoordinate(_coordinateParas);
            }
        }
      
        public Eventech.Model.LxpCoordinateParas GetCoordinateParas()
        {
            return _coordinateParas;
        }
        public Action<Eventech.Model.LxpCoordinateParas> OnChangeCoordinate = null;
        public void SetCoordinateParas(Eventech.Model.LxpCoordinateParas coordinateParas,bool isRefresh=false)
        {
            this._coordinateParas = coordinateParas;
            if (coordinateParas == null)
                return;
 
            if (isRefresh)
                UpdateCoordinate();
        }
        #endregion
 
        #region 更新
 
        //更新所有
        internal void UpdateChart(bool isCalcCoord= true)
        {
            if(isCalcCoord || this._coordinateParas == null)
            {
                //判断是否要重建坐标系
                bool isReBuildCoordinate = CheckCoordinate();
 
                if (isReBuildCoordinate)
                    UpdateCoordinate();
            }
 
 
            UpdateTestPoints();
 
            UpdateRatedParas();
        }
 
 
 
        //更新所有点
        public void UpdateTestPoints()
        {
            if (_allRecords == null)
            {
                SeriesQHpoint.Visible = false;
                SeriesQHcurve.Visible = false;
 
                SeriesQEpoint.Visible = false;
                SeriesQEcurve.Visible = false;
 
                SeriesQPpoint.Visible = false;
                SeriesQPcurve.Visible = false;
                return;
            }
 
            //SeriesQHpoint.Visible = true;
            //SeriesQEpoint.Visible = this._isDispQE;
            //SeriesQPpoint.Visible = this._isDispQP;
 
            //SeriesQHpoint.Points.Clear();
            //SeriesQEpoint.Points.Clear();
            //SeriesQPpoint.Points.Clear();
 
            //int i  ;
            //for (i = 0; i < _allRecords.Count(); i++)
            //{
            //    SeriesQHpoint.Points.Add(new SeriesPoint(_allRecords[i].CorrectPtQ, new double[] { _allRecords[i].CorrectPtH }));
 
            //    if (_allRecords[i].CorrectPtP != null)
            //        SeriesQPpoint.Points.Add(new SeriesPoint(_allRecords[i].CorrectPtQ, new double[] { _allRecords[i].CorrectPtP.Value }));
 
            //    if (_allRecords[i].CorrectPtE != null)
            //        SeriesQEpoint.Points.Add(new SeriesPoint(_allRecords[i].CorrectPtQ, new double[] { _allRecords[i].CorrectPtE.Value }));
            //}
 
            //if (_allRecords.Count < 4)
            //{
            //    SeriesQHcurve.Visible = false;
            //    SeriesQEcurve.Visible = false;
            //    SeriesQPcurve.Visible = false;
            //    return;
            //}
 
         
            //SeriesQHcurve.Visible = true;
            //SeriesQHcurve.Points.Clear();
 
            //SeriesQEcurve.Visible = this._isDispQE;
            //SeriesQEcurve.Points.Clear();
 
            //SeriesQPcurve.Visible = this._isDispQP;
            //SeriesQPcurve.Points.Clear();
 
            //if (_curveInfoQH != null && _curveInfoQH.Count > 3)
            //{
            //    for (i = 0; i < _curveInfoQH.Count(); i++)
            //    {
            //        SeriesQHcurve.Points.Add(new SeriesPoint(_curveInfoQH[i].X, new double[] { _curveInfoQH[i].Y }));
            //    }
            //}
 
            //if (_curveInfoQE != null && _curveInfoQE.Count > 3)
            //{
            //    for (i = 0; i < _curveInfoQE.Count(); i++)
            //    {
            //        SeriesQEcurve.Points.Add(new SeriesPoint(_curveInfoQE[i].X, new double[] { _curveInfoQE[i].Y }));
            //    }
            //}
 
            //if (_curveInfoQP != null && _curveInfoQP.Count > 3)
            //{
            //    for (i = 0; i < _curveInfoQP.Count(); i++)
            //    {
            //        SeriesQPcurve.Points.Add(new SeriesPoint(_curveInfoQP[i].X, new double[] { _curveInfoQP[i].Y }));
            //    }
            //}
 
 
        }
 
        //更新额定参数 
        public void UpdateRatedParas()
        {
            if (this._ratedParas == null || this._ratedParas.Q < 0.1)
                return;
            if (_toleranceParas == null)
                return;
 
            double maxQ = _toleranceParas.TolRatioMaxQ * this._ratedParas.Q;
            double minQ = _toleranceParas.TolRatioMinQ * this._ratedParas.Q;
            double maxH = _toleranceParas.TolRatioMaxH * this._ratedParas.H;
            double minH = _toleranceParas.TolRatioMinH * this._ratedParas.H;
 
 
            if (maxQ > minQ)
            {
                SeriesRatedMarkerH.Points.Clear();
                SeriesRatedMarkerH.Points.Add(new SeriesPoint(minQ,
                     new double[] { _ratedParas.H }));
                SeriesRatedMarkerH.Points.Add(new SeriesPoint(maxQ,
                     new double[] { _ratedParas.H }));
                SeriesRatedMarkerH.Visible = true;
 
                // ((LineSeriesView)SeriesRatedMarkerV.View).MarkerVisibility = DefaultBoolean.True;
            }
            else
            {
                SeriesRatedMarkerH.Visible = false;
            }
 
            if (maxH > minH)
            {
                SeriesRatedMarkerV.Points.Clear();
                SeriesRatedMarkerV.Points.Add(new SeriesPoint(_ratedParas.Q,
                     new double[] { minH }));
                SeriesRatedMarkerV.Points.Add(new SeriesPoint(_ratedParas.Q,
                     new double[] { maxH }));
                SeriesRatedMarkerV.Visible = true;
 
                // ((LineSeriesView)SeriesRatedMarkerH.View).MarkerVisibility = DefaultBoolean.True;
            }
            else
            {
                SeriesRatedMarkerV.Visible = false;
            }
        }
        #endregion
 
        #region 重绘
 
        void chartControl_CustomPaint(object sender, CustomPaintEventArgs e)
        {
            //Graphics g = e.Graphics;
            if (_coordinateParas == null)
                return;
 
            Graphics g = e.Graphics;
            //g.SetClip(CalculateDiagramBounds());
            g.SmoothingMode = SmoothingMode.AntiAlias;
 
            if (_judgePoint != null && this._isDispJudgePoint)
            {
                using (Pen penCurve = new Pen(System.Drawing.Color.Red, 5f))
                {
                    ControlCoordinates coor = mainChartDiagram.DiagramToPoint(_judgePoint.X,
                                      _judgePoint.Y, AxisQ, QHAxisY);
                    g.DrawEllipse(penCurve, coor.Point.X - 4, coor.Point.Y - 4, 8, 8);
                }
            }
 
            if(_equipCurve != null && this._isDispEquipCurve && _equipCurve.CurveInfo != null && _equipCurve.CurveInfo.Count>3)
            {
                List<PointF> points = new List<PointF>();
                foreach(var pt in _equipCurve.CurveInfo)
                {
                    ControlCoordinates coor = mainChartDiagram.DiagramToPoint(pt.X,
                              pt.Y, AxisQ, QHAxisY);
                    points.Add(coor.Point);
                }
                using (Pen penCurve = new Pen(System.Drawing.Color.PaleVioletRed, 2f))
                {
                    g.DrawCurve(penCurve, points.ToArray(), 0.5F);
                }
 
            }
 
 
            chartControl1.DrawCorpLogo(g);
        }
        private void DrawCurve(List<Point> points, Eventech.Model.CombineCurve equalCurve, Graphics g, Color curveColor)
        {
            //去掉重曲线复点
            Point[] pointArray = points.Distinct().ToArray();
 
            //写字
            //using (SolidBrush brushTextQP = new SolidBrush(curveColor))
            //using (Font fontTextQP = TProduct.WinFrmUI.CorpSkinStyleHelper.GetDefaultFont())
            //{
            //    g.DrawString(equalCurve.CurvePara.ToString(), fontTextQP, brushTextQP,
            //    pointArray.First().X, pointArray.First().Y - 15);
            //}
 
            //绘制曲线
            if (pointArray.Length > 2)
            {
                using (Pen penCurve = new Pen(curveColor, 3f))
                {
                    if (equalCurve.IsClosed)
                    {
                        System.Drawing.Drawing2D.FillMode aFillMode = System.Drawing.Drawing2D.FillMode.Alternate;
                        g.DrawClosedCurve(penCurve, pointArray, equalCurve.DispTension, aFillMode);
                    }
                    else
                    {//DrawBeziers
                        g.DrawCurve(penCurve, pointArray, equalCurve.DispTension);
                    }
                }
            }
            else if (pointArray.Length == 2)
            {
                using (Pen penCurve = new Pen(curveColor, 3f))
                {
                    g.DrawLine(penCurve, pointArray[0], pointArray[1]);
                }
            }
            else if (pointArray.Length == 1)
            {
                using (var brsh = new SolidBrush(curveColor))
                {
                    Rectangle rc = new Rectangle(pointArray[0].X - 2, pointArray[0].Y - 2, 4, 4);
                    g.FillEllipse(brsh, rc);
                }
            }
        }
 
        #endregion
 
        private bool _isDispCoodText = true;
        public void SetAxisTitle(bool isDisp)
        {
            _isDispCoodText = isDisp;
            QHAxisY.Title.Visibility = _isDispCoodText ? DefaultBoolean.True : DefaultBoolean.False;
            QEAxisY.Title.Visibility = _isDispCoodText ? DefaultBoolean.True : DefaultBoolean.False;
        }
 
        private bool _isDispQE = true;
        public void SetEtaDisp(bool isDisp)
        {
            this._isDispQE = isDisp;
            this.SeriesQEpoint.Visible = _isDispQE;
            this.SeriesQEcurve.Visible = _isDispQE;
            this.QEAxisY.Visibility = _isDispQE ? DefaultBoolean.True : DefaultBoolean.False;
        }
 
        private bool _isDispQP = false;
        public void SetPowerDisp(bool isDisp)
        {
            bottomChartDiagram.Visibility = isDisp? ChartElementVisibility.Visible : ChartElementVisibility.Hidden;
            _isDispQP = isDisp;
            SeriesQPpoint.Visible = _isDispQP;
            SeriesQPcurve.Visible = _isDispQP;
            QPAxisY.GridLines.Visible = _isDispQP;
            this.QPAxisY.Visibility = _isDispQP ? DefaultBoolean.True : DefaultBoolean.False;
        }
 
 
        private bool isDispQlabel = false;
        private void 显示流量值MenuItem_Click(object sender, EventArgs e)
        {
            isDispQlabel = !isDispQlabel;
            if (isDispQlabel)
            {
                显示流量值MenuItem.Text = "不显示流量值";
            }
            else
            {
                显示流量值MenuItem.Text = "显示流量值";
            }
            SetQHpointLabel();
        }
 
        private bool isDispHlabel = false;
        private void 显示扬程值MenuItem_Click(object sender, EventArgs e)
        {
            isDispHlabel = !isDispHlabel;
            if (isDispHlabel)
            {
                显示扬程值MenuItem.Text = "不显示扬程值";
            }
            else
            {
                显示扬程值MenuItem.Text = "显示扬程值";
            }
            SetQHpointLabel();
        }
 
        private void SetQHpointLabel()
        {
            if (!isDispQlabel && !isDispHlabel)
            {
                //SeriesIPoint.Label.Visible = false;
                SeriesQHpoint.LabelsVisibility = DefaultBoolean.False;
            }
            else
            {
                /// SeriesIPoint.Label.Visible = true;
                SeriesQHpoint.LabelsVisibility = DefaultBoolean.True;
                if (!isDispQlabel && isDispHlabel)
                {
                    SeriesQHpoint.Label.TextPattern = "{V}";
                    //SeriesIPoint.Label.PointOptions.PointView = PointView.Values;
                }
                else if (isDispQlabel && !isDispHlabel)
                {
                    SeriesQHpoint.Label.TextPattern = "{A}";
                    // SeriesIPoint.Label.PointOptions.PointView = PointView.Argument;
                }
                else
                {
                    SeriesQHpoint.Label.TextPattern = "{A},{V}";
                    // SeriesIPoint.Label.PointOptions.PointView = PointView.ArgumentAndValues;
                }
            }
        }
 
        private bool isDispPlabel = false;
        private void 显示功率值MenuItem_Click(object sender, EventArgs e)
        {
            isDispPlabel = !isDispPlabel;
            if (isDispPlabel)
            {
                显示功率值MenuItem.Text = "不显示功率值";
                //SeriesInputPpoint.Label.Visible = true;
                SeriesQEpoint.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            }
            else
            {
                显示功率值MenuItem.Text = "显示功率值";
                //SeriesInputPpoint.Label.Visible = false;
                SeriesQEpoint.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
            }
        }
 
 
        #region 面板风格
 
        protected TProduct.Model.eChartDiagramPanelStyle _chartPanelStyle = TProduct.Model.eChartDiagramPanelStyle.Whole;
 
        public void SetChartPanelStyleParas(TProduct.Model.eChartDiagramPanelStyle style)
        {
            _chartPanelStyle = style;
            SetChartPanelStyle();
        }
 
        //0 是一整块  1 上面扬程效率  下面功率汽蚀
        public virtual void SetChartPanelStyle()
        {
        }
 
 
 
 
 
        #endregion 面板风格
 
 
 
    }
}