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
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using TProduct.Model;
 
namespace TProduct.WinFrmUI.TPump
{
    /// <summary>
    /// 性能测试
    /// </summary>
    public partial class FeatTestIngMainPage
    {
        /// <summary>
        /// 赋值
        /// </summary>
        /// <param name="project"></param>
        /// <param name="item"></param>
        /// <param name="workBench"></param>
        /// <param name="workBenchParas"></param>
        public void SetBindingData(
            TProduct.Model.ProductMainExPump pump,
            TProduct.Model.PartBase part,
            TProduct.Model.TestProjectItemView item,
            TProduct.Model.WorkBenchBase workBench)
        {
            if (workBench == null)
            {
                MessageBox.Show("还未设置workBench参数");
                return;
            }
            if (item == null)
            {
                MessageBox.Show("还未设置item参数");
                return;
            } 
            if (pump == null)
            {
                MessageBox.Show("还未设置pump参数");
                return;
            }
            if (part == null)
            {
                MessageBox.Show("还未设置part参数");
                return;
            }
 
            if (string.IsNullOrEmpty(pump.RatedParas))
            {
                MessageBox.Show("还未设置泵的额定参数");
                return;
            }
 
 
            this._workBenchInfo = workBench;
            this._testItem = item;
            this._currentPump = pump;
            this._currentPart = part;
            this._ratedParas = TProduct.Model.RatedParas4Pump.ToModel(pump.RatedParas);
            if (_currentPump.MotorMainID.HasValue && _currentPump.MotorMainID > 0)
            {
                _currentMotor = new BLL.ProductMotor().GetExByProductID((long)_currentPump.MotorMainID);
            }
            this._currentPumpSeries = new BLL.ProductSeries().GetByID(this._currentPump.SeriesID);
            if (this._currentPumpSeries == null)
            {
                MessageBox.Show("当前泵对应系列未找到");
                return;
            }
 
            if (TProduct.CorpSetting.PumpTest.IsRefreshAdditionInfo)
            {
                _isRefreshAdditionInfo = true;
            }
            else
            {
                _isRefreshAdditionInfo = false;
                bbi刷新状态信息.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            }
                
            ribbonPageGroup开停机.Visible = false;
 
            bsiOperateInfo.Caption = "";
            this._isInnerMotor = _currentPumpSeries.IsInnerMotor == 1 ? true : false;
 
            //初始化操作提示
            InitialNoticeList();
 
 
 
            //从数据库中获取以前的测试数据: 里面会初始化 _allMonitorPointList 的值 
            if (!InitialLink())
            {
                //MessageBox.Show("初始化测点失败");
                return;
            }
 
            //从数据库中获取以前的测试数据
            List<TProduct.Model.PumpFeatTestRecord> allRecords4Ds =
                new BLL.PumpFeatTestRecord().GetByTestItem(item);
            this._allRecords = new List<TProduct.Model.PumpFeatTestRecordViewModel>();
            if (allRecords4Ds != null)
            {
                foreach (var r in allRecords4Ds)
                {
                    this._allRecords.Add(new TProduct.Model.PumpFeatTestRecordViewModel(r) { MonitorRecordList = new TProduct.Model.MonitorRecord4DsList(r.MonitorRecords) });
                }
            }
 
            //数据记录辅助类(放在前面)
            _monitorValveIngRecordHelper = new MonitorValveIngRecordHelper();
            _monitorValveIngRecordHelper.Initial(
                TProduct.Model.eProductType.Pump,
                this._currentPumpSeries.ID,
                this._currentPump.ID,
                this._currentPart.ID,
                this._testItem, 
                this._workBenchInfo,
                this._allMonitorPointList);
 
 
            //初始化耐久测试
            InitialDurabilityTest();
 
            //
            InitialJudgeItem();
 
 
            //
            InitialGuages(_allMonitorPointList);
 
 
            //
            if (!InitialCalcDialog(this._currentPumpSeries, this._currentPump, _currentMotor, workBench, item, _allMonitorPointList))
            {
                return;
            }
 
            //
            InitialMonitorGrid(_allMonitorPointList);
 
            //修正点表和实时数据控件
            InitialCorrentPtGrid();
 
            //
            InitialAutoTestGrid(_allMonitorPointList);
 
            //
            IntialMainChart();
 
            //
            IntialPartInfoCtrl();
 
            //测试日志
            InitialTestLogCtrl();
 
            //记录操控
            InitialRecordOperateCtrl();
 
            //三维模型
            InitialModel3d();
 
            //工艺流程图
            InitialProcessDrawing();
 
            //通讯日志(放在最后)
            InitialLinkLogCtrl();
 
            bbiPumpName.Caption = string.Format("泵ID:{0},型号:{1}", pump.ID, pump.Name);
            TProduct.LogHelper.Test(string.Format("开始进行性能测试,泵型号:{0}", pump.Name));
        }
 
        /// <summary>
        /// 初始化操作注意事项
        /// </summary>
        List<Model.TestNoticeRecordView> _allNoticeRecordList = null;
        private void InitialNoticeList()
        {
            bbi注意事项.Enabled = false;
            var productStyle = new BLL.ProductStyle().GetByID(this._currentPumpSeries.ProductStyleID);
            if (productStyle == null)
                return;
 
            var notice_matter = new BLL.TestNoticeMattter().GetDefaultByProductType(productStyle.ID);
            if (notice_matter == null)
                return;
 
            var details = new BLL.TestNoticeItem().GetListByMatterID(notice_matter.ID);
            if (details == null || details.Count == 0)
                return;
 
            var records = new BLL.TestNoticeRecord().GetByTestItem(this._testItem);
 
            _allNoticeRecordList = new List<TestNoticeRecordView>();
 
            foreach (Model.TestNoticeItemEx detail in details)
            {
                var v = new TestNoticeRecordView(detail);
                v.TestItemID = this._testItem.ItemID;
                if (records != null && records.Count > 0)
                {
                    var r = records.Find(x => x.NoticeItemID == detail.ID);
                    if (r != null)
                    {
                        v.RecordID = r.ID;
                        v.Value = r.Value;
                        v.DsValue = r.Value;
                        v.Note = r.Note;
                        v.DsNote = r.Note;
                    }
                }
 
                _allNoticeRecordList.Add(v);
            }
 
            bbi注意事项.Enabled = true;
        }
 
        /// <summary>
        /// 设置测点
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        private List<TProduct.Model.WorkBenchMonitorPoint> ResetMonitorPoint(
            List<TProduct.Model.WorkBenchMonitorPoint> list)
        {
            if (list == null || list.Count() == 0)
            {
                return null;
            }
            //this._monitorTotalFlow = list.Find(x => x.MonitorType == Model.eMonitorType.流量);
 
            var instrumentInfo = this._testItem.InstrumentInfo;
            if (instrumentInfo != null)
            {
                #region  出口压力
                var out_press_index = list.FindIndex(x => x.MonitorType == Model.eMonitorType.压力
        && x.Property == TProduct.Model.MonitorTypeProperty.出口);
                if (out_press_index >= 0)
                {
                    var monitor_outletPress = list[out_press_index];
 
                    //设置出口压力表量程 
                    if (instrumentInfo.OutletPressureMeterID > 0)
                    {
                        var meter = new BLL.PressureMeter().GetByID(instrumentInfo.OutletPressureMeterID);
                        if (meter != null)
                        {
                            if (monitor_outletPress.AnalogParas == null)
                                monitor_outletPress.AnalogParas = new Model.AnalogMonitorPointParas();
                            monitor_outletPress.AnalogParas.RangeMax = meter.RangeMax;
                            monitor_outletPress.AnalogParas.RangeMin = meter.RangeMin;
                            list[out_press_index] = monitor_outletPress;
                        }
                    }
                    if (instrumentInfo.OutletPressureMeterPipeDia > 0)
                    {//  暂时用不到, 都是从测点或者泵上获取的,代码暂时保留
                        if (monitor_outletPress.AnalogParas == null)
                            monitor_outletPress.AnalogParas = new Model.AnalogMonitorPointParas();
                        monitor_outletPress.PipeDia = instrumentInfo.OutletPressureMeterPipeDia;
                    }
                    if (instrumentInfo.InletPressureMeterElevation > 0)
                    {
                        if (monitor_outletPress.AnalogParas == null)
                            monitor_outletPress.AnalogParas = new Model.AnalogMonitorPointParas();
                        monitor_outletPress.Elevation = instrumentInfo.OutletPressureMeterElevation;
                    }
 
                    //1:来源泵口径
                    if (TProduct.UserSetting.Setting.PumpTest.OutletPressMonitorDiaStatus == 1 && _ratedParas != null)
                    {
                        if (this._ratedParas.OutletDia.HasValue && _ratedParas.OutletDia > 0)
                        {
                            if (monitor_outletPress.AnalogParas == null)
                                monitor_outletPress.AnalogParas = new Model.AnalogMonitorPointParas();
                            monitor_outletPress.PipeDia = this._ratedParas.OutletDia.Value;
                        }
                    }
                }
 
                #endregion
 
                #region 进口压力
                var inlet_press_index = list.FindIndex(x => x.MonitorType == Model.eMonitorType.压力
                    && x.Property == TProduct.Model.MonitorTypeProperty.进口);
                if (inlet_press_index >= 0)
                {
                    var monitor_inletPress = list[inlet_press_index];
 
                    if (instrumentInfo.InletPressureMeterID > 0)
                    {
                        var meter = new BLL.PressureMeter().GetByID(instrumentInfo.InletPressureMeterID);
                        if (meter != null)
                        {
                            if (monitor_inletPress.AnalogParas == null)
                                monitor_inletPress.AnalogParas = new Model.AnalogMonitorPointParas();
                            monitor_inletPress.AnalogParas.RangeMax = meter.RangeMax;
                            monitor_inletPress.AnalogParas.RangeMin = meter.RangeMin;
                            list[inlet_press_index] = monitor_inletPress;
                        }
                    }
                    if (instrumentInfo.InletPressureMeterPipeDia > 0)
                    {
                        if (monitor_inletPress.AnalogParas == null)
                            monitor_inletPress.AnalogParas = new Model.AnalogMonitorPointParas();
                        monitor_inletPress.PipeDia = instrumentInfo.InletPressureMeterPipeDia;
                    }
                    if (instrumentInfo.InletPressureMeterElevation > 0)
                    {
                        if (monitor_inletPress.AnalogParas == null)
                            monitor_inletPress.AnalogParas = new Model.AnalogMonitorPointParas();
                        monitor_inletPress.Elevation = instrumentInfo.InletPressureMeterElevation;
                    }
                    //1:来源泵口径
                    if (TProduct.UserSetting.Setting.PumpTest.InletPressMonitorDiaStatus == 1 && _ratedParas != null)
                    {
                        if (this._ratedParas.InletDia.HasValue && _ratedParas.InletDia > 0)
                        {
                            if (monitor_inletPress.AnalogParas == null)
                                monitor_inletPress.AnalogParas = new Model.AnalogMonitorPointParas();
                            monitor_inletPress.PipeDia = this._ratedParas.InletDia.Value;
                        }
                    }
                }
                #endregion
 
                #region 流量
                if (instrumentInfo.FlowMeterRangeMax > instrumentInfo.FlowMeterRangeMin)
                {
                    var flow_index = list.FindIndex(x => x.MonitorType == Model.eMonitorType.流量);
                    if (flow_index >= 0)
                    {
                        var monitor_flow = list[flow_index];
                        if (monitor_flow.AnalogParas == null)
                            monitor_flow.AnalogParas = new Model.AnalogMonitorPointParas();
                        monitor_flow.AnalogParas.RangeMax = instrumentInfo.FlowMeterRangeMax;
                        monitor_flow.AnalogParas.RangeMin = instrumentInfo.FlowMeterRangeMin;
                    }
                }
                #endregion
 
            }
 
 
 
 
            var testMethod = new Model.WorkBenchMethod4Pump(this._workBenchInfo.TestMethod);
            if (testMethod.Power == Model.ePowerTestMethod.扭矩)
            {
                var monitor扭矩 = list.Find(x => x.MonitorType == Model.eMonitorType.扭矩);
                if (monitor扭矩 == null)
                {
                    monitor扭矩 = new Model.WorkBenchMonitorPoint()
                    {
                        Name = "扭矩",
                        MonitorType = Model.eMonitorType.扭矩,
                        SumCalcCoeff = 1,
                        ValueCoeffParas = null,
                        UseStatus = Model.eUseStatus.Enable,
                        SourceType = Model.eMonitorPointSourceType.数字量,
                        DigitalParas = null,
                        DispInPanel = 1,
                        AnalogParas = null,
                        BenchID = this._workBenchInfo.ID,
 
                        CreateTime = DateTime.Now,
                        CreateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
                        UpdateTime = DateTime.Now,
                        UpdateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
                        SortCode = 6
                    };
                    monitor扭矩.ID = new BLL.WorkBenchMonitorPoint().Insert(monitor扭矩);
                    list.Add(monitor扭矩);
                }
            }
            else if (!_isInnerMotor)
            {
                var monitor电机效率 = list.Find(x => x.MonitorType == Model.eMonitorType.电机效率);
                if (monitor电机效率 == null)
                {
                    monitor电机效率 = new Model.WorkBenchMonitorPoint()
                    {
                        Name = "电机效率",
                        MonitorType = Model.eMonitorType.电机效率,
                        SumCalcCoeff = 1,
                        ValueCoeffParas = null,
                        UseStatus = Model.eUseStatus.Enable,
                        SourceType = Model.eMonitorPointSourceType.计算量,
                        DigitalParas = null,
                        DispInPanel = 1,
                        AnalogParas = null,
                        BenchID = this._workBenchInfo.ID,
 
                        CreateTime = DateTime.Now,
                        CreateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
                        UpdateTime = DateTime.Now,
                        UpdateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
                        SortCode = 6
                    };
                    monitor电机效率.ID = new BLL.WorkBenchMonitorPoint().Insert(monitor电机效率);
                    list.Add(monitor电机效率);
                }
            }
 
            if (this._testItem.ProjectParas != null)
            {
                var testParas = this._testItem.ProjectParas;
                if (testParas.IsTemperatureTrn)
                {
                    var monitor介质温度 = list.Find(x => x.MonitorType == Model.eMonitorType.介质温度);
                    if (monitor介质温度 == null)
                    {
                        monitor介质温度 = new Model.WorkBenchMonitorPoint()
                        {
                            Name = "介质温度",
                            MonitorType = Model.eMonitorType.介质温度,
                            SumCalcCoeff = 1,
                            ValueCoeffParas = null,
                            UseStatus = Model.eUseStatus.Enable,
                            SourceType = Model.eMonitorPointSourceType.计算量,
                            DigitalParas = null,
                            DispInPanel = 1,
                            AnalogParas = null,
                            BenchID = this._workBenchInfo.ID,
 
                            CreateTime = DateTime.Now,
                            CreateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
                            UpdateTime = DateTime.Now,
                            UpdateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
                            SortCode = 11
                        };
                        monitor介质温度.ID = new BLL.WorkBenchMonitorPoint().Insert(monitor介质温度);
                        list.Add(monitor介质温度);
                    }
                }
            }
            //            if(_parallelInfo != null && _parallelInfo.Count > 0)
            //            {
            //                var monitor并联参考进口 = list.Find(x => 
            //                x.MonitorType == Model.eMonitorType.压力 && 
            //                x.Property ==  TProduct.Model.MonitorTypeProperty.并联泵进口);
            //                if (monitor并联参考进口 == null)
            //                {
            //                    monitor并联参考进口 = new Model.WorkBenchMonitorPoint()
            //                    {
            //                        Name = "并联进口压力",
            //                        MonitorType = Model.eMonitorType.压力,
            //                        ValueCoefficient = 1,
            //                        ValueAdditional = 0,
            //                        UseStatus = Model.eUseStatus.Enable,
            //                        SourceType = Model.eMonitorPointSourceType.未知,
            //                        DigitalParas = null,
            //                        DispInPanel = 1,
            //                        AnalogParas = null,
            //                        BenchID = this._workBenchInfo.ID,
            //                        Tag = TProduct.Model.MonitorTypeProperty.并联泵进口,
 
            //                        CreateTime = DateTime.Now,
            //                        CreateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
            //                        UpdateTime = DateTime.Now,
            //                        UpdateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
            //                        SortCode = 12
            //                    };
            //                    monitor并联参考进口.ID = new BLL.WorkBenchMonitorPoint().Insert(monitor并联参考进口);
            //                    list.Add(monitor并联参考进口);
            //                }
 
            //                var monitor并联参考出口 = list.Find(x =>
            //x.MonitorType == Model.eMonitorType.压力 &&
            //x.Property == TProduct.Model.MonitorTypeProperty.并联泵出口);
            //                if (monitor并联参考出口 == null)
            //                {
            //                    monitor并联参考出口 = new Model.WorkBenchMonitorPoint()
            //                    {
            //                        Name = "并联进口出力",
            //                        MonitorType = Model.eMonitorType.压力,
            //                        ValueCoefficient = 1,
            //                        ValueAdditional = 0,
            //                        UseStatus = Model.eUseStatus.Enable,
            //                        SourceType = Model.eMonitorPointSourceType.未知,
            //                        DigitalParas = null,
            //                        DispInPanel = 1,
            //                        AnalogParas = null,
            //                        BenchID = this._workBenchInfo.ID,
            //                        Tag = TProduct.Model.MonitorTypeProperty.并联泵出口,
 
            //                        CreateTime = DateTime.Now,
            //                        CreateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
            //                        UpdateTime = DateTime.Now,
            //                        UpdateUserID = TProduct.WinFrmUI.GlobeParas.CurrentLoginUser.ID,
            //                        SortCode = 12
            //                    };
            //                    monitor并联参考出口.ID = new BLL.WorkBenchMonitorPoint().Insert(monitor并联参考出口);
            //                    list.Add(monitor并联参考出口);
            //                }
            //            }
 
            return list;
        }
 
 
        //初始化Comm链接控件
        private bool InitialCommConnectCtrl(List<string> ComPortNameList)
        {
            if (_commCtrl == null)
            {
                if (ComPortNameList.Count > 1)
                {
                    var multiComStepCtrl = new TProduct.WinFrmUI.TBase.CommConMultiCtrl();
                    multiComStepCtrl.Name = "CommConMultiCtrl";
                    multiComStepCtrl.Dock = DockStyle.Fill;
                    // 修改了Comm链接
                    multiComStepCtrl.OnChangeConnectStatus += this.ChangeCommConnectStatus;
 
                    panelComm.Controls.Clear();
                    panelComm.Controls.Add(multiComStepCtrl);
                    _commCtrl = multiComStepCtrl;
 
                    string error_info;
                    var ret = multiComStepCtrl.InitialData(ComPortNameList, out error_info);
                    if (!ret)
                    {
                        MessageBox.Show(error_info);
                    }
                }
                else if (ComPortNameList.Count == 1)
                {
                    var singleComStepCtrl = new TProduct.WinFrmUI.TBase.CommConSingleCtrl();
                    singleComStepCtrl.Name = "CommConSingleCtrl";
                    singleComStepCtrl.Dock = DockStyle.Fill;
                    // 修改了Comm链接
                    singleComStepCtrl.OnChangeConnectStatus += this.ChangeCommConnectStatus;
 
                    panelComm.Controls.Clear();
                    panelComm.Controls.Add(singleComStepCtrl);
                    _commCtrl = singleComStepCtrl;
 
                    string error_info;
                    var ret = singleComStepCtrl.InitialData(ComPortNameList.First(), out error_info);
                    if (!ret)
                    {
                        MessageBox.Show(error_info);
                    }
                }
            }
 
            return true;
        }
 
 
        //初始化仪表控件
        private void InitialGuages(
            List<TProduct.Model.WorkBenchMonitorPoint> allMonitorList)
        {
            if (allMonitorList == null || allMonitorList.Count == 0)
                return;
            var sort_allMonitorList = (from x in allMonitorList orderby x.SortCode descending select x).ToList();
            _allMonitorGaugeDict = new Dictionary<long, TProduct.WinFrmUI.TBase.UserGaugeControl>();
            this.gaugeDockPanel.Controls.Clear();
 
            for (int i = 0; i < sort_allMonitorList.Count(); i++)
            {
                var monitor = sort_allMonitorList[i];
                if (monitor.DispInPanel == 0)
                    continue;
 
                var gaugeControl = TProduct.WinFrmUI.TBase.UserGaugeControl.Build(TProduct.UserSetting.Setting.Disp.GaugeStyle);
 
                gaugeControl.SetBindingData(
                    Model.eProductType.Pump,
                    this._testItem.TestType,
                    monitor,
                    this._testItem.AlarmSetting);
                gaugeControl.Size = new Size(153, 80);
                gaugeControl.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
                //gaugeControl.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10);
                //gaugeControl.Height = 90;
                //gaugeControl.Width = 165;
                gaugeControl.Dock = DockStyle.Left;
 
                if (monitor.MonitorType == Model.eMonitorType.耐久时间)
                {
                    if (_durabilityTestTimeHelper == null)
                    {
                        continue;
                    }
 
                    //
                    _durabilityTestTimeHelper.OnRefreshMintueTime += (mintue) =>
                    {
                        gaugeControl.RefreshRecordValue(mintue);
                    };
                    var totalMinute = _durabilityTestTimeHelper.GetTotalMintueTime();
                    gaugeControl.InitialRecordValue(totalMinute);
                }
 
                if (monitor.MonitorType == Model.eMonitorType.转速)
                {
                    if (monitor.SourceType == Model.eMonitorPointSourceType.额定参数)
                        gaugeControl.InitialRecordValue(this._currentPump.Ratedn.Value);
                }
                this.gaugeDockPanel.Controls.Add(gaugeControl);
                //gaugeControl.InitialRecordValue(-1);
                //添加到字典中
                _allMonitorGaugeDict[monitor.ID] = gaugeControl;
            }
 
            //if (allMonitorList.Count > 5)
            //{//两排
            //    splitContainerControlMain.SplitterPosition = 200;
            //}
        }
        List<Model.ParallelPumpInfoEx> _parallelInfo = null;
        /// <summary>
        /// 在SetBindingData之前调用
        /// </summary>
        /// <param name="parallelInfo"></param>
        internal void SetParallelInfo(List<Model.ParallelPumpInfoEx> parallelInfo)
        {
            this._parallelInfo = parallelInfo;
        }
 
 
        private void IntialMainChart()
        {
            if (_chartMainCtrl == null)
            {
                _chartMainCtrl = new ChartLxpFeatCurveCtrl();
                _chartMainCtrl.Name = "ChartFeatTestCtrl";
                _chartMainCtrl.Dock = DockStyle.Fill;
                this.tableLayoutPanel1.Controls.Add(this._chartMainCtrl, 0, 1);
                this.chartBarCtrl.cmbSetAction += (cmd, tag) =>
                {
                    if (cmd == "显示效率线")
                    {
                        this._chartMainCtrl.SetEtaDisp(Convert.ToBoolean(tag));
                    }
                    if (cmd == "显示功率线")
                    {
                        this._chartMainCtrl.SetPowerDisp(Convert.ToBoolean(tag));
                    }
                    if (cmd == "显示判定点")
                    {
                        this._chartMainCtrl.SetJudgePointDisp(Convert.ToBoolean(tag));
                    }
                    if (cmd == "显示装置曲线")
                    {
                        this._chartMainCtrl.SetEquipCurveDisp(Convert.ToBoolean(tag));
                    }
                    if (cmd == "查询参数")
                    {
                        this._chartMainCtrl.SetQueryLineDisp1(Convert.ToBoolean(tag));
                    }
                    if (cmd == "曲线方程")
                    {
                        this._chartMainCtrl.ShowCurveEquation( );
                    }
                };
            }
 
            _chartMainCtrl.SetEtaDisp(TProduct.UserSetting.Setting.PumpTest.IsDispCurveQE);
            _chartMainCtrl.SetPowerDisp(TProduct.UserSetting.Setting.PumpTest.IsDispCurveQP);
            _chartMainCtrl.SetRatedParas(this._currentPump, this._ratedParas, this._testJudgeItems);
            if (_allRecords == null || _allRecords.Count == 0)
            {
                _chartMainCtrl.UpdateCoordByRatedParas();
            }
            else
            {
                _chartMainCtrl.SetRecordPoint(this._allRecords);
                _chartMainCtrl.UpdateChart(true);
            }
            _chartMainCtrl.SetEtaDisp(TProduct.UserSetting.Setting.PumpTest.IsDispCurveQE);
            _chartMainCtrl.SetPowerDisp(TProduct.UserSetting.Setting.PumpTest.IsDispCurveQP);
 
        }
 
 
 
 
 
 
    }
}