tx
8 天以前 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
using NPOI.HSSF.UserModel;
using System;
using System.IO;
using System.Linq;
 
namespace TProduct.DataFile.PumpReport
{
    /// <summary>
    /// TPump里面的V5模版(来源淄博质检所)
    /// </summary>
    public class TestReportFileT1 : TestReportFileExcelBase
    {
        public TestReportFileT1() { }
 
        protected string _strExcelFile = null;
 
 
        public override string Create(string strFilePath, TProduct.Model.DispStautInfo infoDelegete)
        {
            //初始化文件
            var message = InitialFile(strFilePath);
            if (!string.IsNullOrEmpty(message))
            {
                infoDelegete("泵数据表V1 生成失败,Error:" + message, 1);
                return message;
            }
 
            this._strExcelFile = strFilePath;
 
            try
            {
                using (FileStream fileStream = new FileStream(_strExcelFile, FileMode.Open, FileAccess.ReadWrite))
                {
                    _theBookHander = new HSSFWorkbook(fileStream);
                }
 
                if (_theBookHander == null)
                {
                    infoDelegete("泵数据表V1 生成失败,Error:未能打开模版Excel文件", 1);
                    return "未能打开模版Excel文件";
                }
 
 
 
 
                WritePage封面(infoDelegete);
                WritePage基本信息(infoDelegete);
                WritePage分析报告(infoDelegete);
                WritePage性能测试数据(infoDelegete);
                WritePage性能测试曲线(infoDelegete);
 
                using (var fileStream = new FileStream(_strExcelFile, FileMode.Create))
                {
                    _theBookHander.Write(fileStream);
                }
            }
            catch (Exception ex)
            {
                infoDelegete("泵数据表V1 生成失败,Error:" + ex.Message, 1);
                return ex.Message;
            }
            finally
            {
                //workSheet.Save();
                //workSheet.Close();
                //workSheet = null;
            }
 
            return null;
        }
        public override string GetTemplateFilePath()
        {
            return System.IO.Path.Combine(
              TProduct.DataFolderParas.FullPath,
              "PumpFeatReportTemplate",
              "P_CN_T1_V1.xls");
        }
 
        //初始化文件
        private string InitialFile(string strFilePath)
        {
            string strTemplateFile = GetTemplateFilePath();
            if (!File.Exists(strTemplateFile))
            {
                return strTemplateFile + ": 模板文件被非法删除";
            }
 
            if (File.Exists(strFilePath))
            {
                File.Delete(strFilePath);
            }
 
            File.Copy(strTemplateFile, strFilePath, true);
 
 
            return null;
        }
 
 
 
        private bool WritePage封面(TProduct.Model.DispStautInfo infoDelegete)
        {
            NPOI.SS.UserModel.ISheet sheet封面 = _theBookHander.GetSheetAt(0);
            if (sheet封面 == null)
            {
                infoDelegete(" 生成失败,Error:未发现模版封面页", 1);
                return false;
            }
            //
            //产品名称
            SetCellValue(sheet封面, 11, "B", this._currentPart.Name);
            //型号
            SetCellValue(sheet封面, 12, "B", this._currentPump.Name);
            //产品编号
            SetCellValue(sheet封面, 13, "B", this._currentPart.Code);
            //测试编号
            SetCellValue(sheet封面, 14, "B", this._testProject.Code);
            //生产单位/受检单位
            var manufacture_name = new BLL.ManufacturerBase().GetNameByID(this._currentPart.ManufacturerID);
            SetCellValue(sheet封面, 16, "B", manufacture_name);
            //送检单位/委托单位
            var sender_name = new BLL.Senderbase().GetNameByID(this._currentPart.SenderID);
            SetCellValue(sheet封面, 17, "B", sender_name);
 
 
 
 
 
            sheet封面.ForceFormulaRecalculation = true;
 
            return true;
        }
 
 
        private bool WritePage基本信息(TProduct.Model.DispStautInfo infoDelegete)
        {
            NPOI.SS.UserModel.ISheet sheet基本信息 = _theBookHander.GetSheetAt(2);
            if (sheet基本信息 == null)
            {
                infoDelegete("  生成失败,Error:未发现模版基本信息页", 1);
                return false;
            }
 
            //产品名称
            SetCellValue(sheet基本信息, 4, "B", this._currentPart.Name);
            //型号
            SetCellValue(sheet基本信息, 4, "E", this._currentPump.Name);
 
            //生产单位/受检单位
            var manufacture_name = new BLL.ManufacturerBase().GetNameByID(this._currentPart.ManufacturerID);
            SetCellValue(sheet基本信息, 6, "B", manufacture_name);
            //送检单位/委托单位
            var sender_name = new BLL.Senderbase().GetNameByID(this._currentPart.SenderID);
            SetCellValue(sheet基本信息, 11, "B", sender_name);
 
            //产品编号
            SetCellValue(sheet基本信息, 10, "E", this._currentPart.Code);
            //测试编号
            SetCellValue(sheet基本信息, 11, "E", this._testProject.Code);
            //生产日期
            SetCellValue(sheet基本信息, 12, "E", this._currentPart.ManufactureTime);
            //送检日期
            SetCellValue(sheet基本信息, 14, "E", this._testProject.CreateTime.ToString("yyyy-MM-dd"));
 
 
 
            sheet基本信息.ForceFormulaRecalculation = true;
 
            return true;
        }
 
 
        private bool WritePage分析报告(TProduct.Model.DispStautInfo infoDelegete)
        {
            NPOI.SS.UserModel.ISheet sheet分析报告 = _theBookHander.GetSheetAt(3);
            if (sheet分析报告 == null)
            {
                infoDelegete("  生成失败,Error:未发现模版分析报告页", 1);
                return false;
            }
 
            //报告编号
            SetCellValue(sheet分析报告, 2, "B", this._testProject.ReportFileNO);
            //型号
            SetCellValue(sheet分析报告, 3, "B", this._currentPump.Name);
 
            //测试编号
            SetCellValue(sheet分析报告, 3, "G", this._testProject.Code);
 
 
            //生产单位/受检单位
            var manufacture_name = new BLL.ManufacturerBase().GetNameByID(this._currentPart.ManufacturerID);
            SetCellValue(sheet分析报告, 3, "L", manufacture_name);
 
 
            //试验日期
            SetCellValue(sheet分析报告, 4, "L", this._testProject.CreateTime.ToString("yyyy-MM-dd"));
 
            if (this._allMonitorPoints != null)
            {
                //double bwj = 0;
                var mp_inlet = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.压力 && x.Property == TProduct.Model.MonitorTypeProperty.进口);
                //if (mp_inlet != null)
                //{
                //    if (mp_inlet.PipeDia.HasValue)
                //    {
                //        SetCellValue(sheet分析报告, 9, "D", mp_inlet.PipeDia.Value);
                //    }
                //    if (mp_inlet.Elevation.HasValue)
                //        bwj = bwj - mp_inlet.Elevation.Value;
                //}
 
                var mp_outlet = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.压力 && x.Property == TProduct.Model.MonitorTypeProperty.出口);
                //if (mp_outlet != null)
                //{
                //    if (mp_outlet.PipeDia.HasValue)
                //    {
                //        SetCellValue(sheet分析报告, 9, "M", mp_outlet.PipeDia.Value);
                //    }
                //    if (mp_outlet.Elevation.HasValue)
                //        bwj = bwj + mp_outlet.Elevation.Value;
                //}
 
                ////进口压力表至进口压力表距离
                //SetCellValue(sheet分析报告, 10, "M", bwj);
 
                //基准高差
                SetCellValue(sheet分析报告, 10, "D", this._ratedParas.NpshGaoChaZd);
 
                //叶轮外径 (mm)
                if (this._currentPump.D2 != null && this._currentPump.D2 > 0)
                {
                    SetCellValue(sheet分析报告, 11, "D", this._currentPump.D2.Value);
                }
 
                //大气压力 (kPa)
                var setting = new TProduct.Model.WorkBenchSetting4Pump(this._workBench.TestSetting);
                SetCellValue(sheet分析报告, 12, "D", setting.AtmosphericPressure);
 
            }
            if (_currentMotor != null)
            {
                var ratedParasMotor = TProduct.Model.RatedParas4Motor.ToModel(_currentMotor.RatedParas);
                if (ratedParasMotor.E_Self > 0)
                {
                    SetCellValue(sheet分析报告, 11, "M", ratedParasMotor.E_Self);
                }
                SetCellValue(sheet分析报告, 13, "D", _currentMotor.Name);
            }
            if (_testParas != null)
            {//介质温度
                SetCellValue(sheet分析报告, 12, "M", _testParas.JzWenDu);
            }
 
            if (this._ratedParas != null)
            {
                SetCellValue(sheet分析报告, 17, "A", _ratedParas.Q);
                SetCellValue(sheet分析报告, 17, "D", _ratedParas.H);
                if (this._currentPump.Ratedn.HasValue)
                    SetCellValue(sheet分析报告, 17, "F", this._currentPump.Ratedn.Value);
                SetCellValue(sheet分析报告, 17, "J", _ratedParas.E);
                SetCellValue(sheet分析报告, 17, "H", _ratedParas.P);
                if (_ratedParas.NPSHr.HasValue && _ratedParas.NPSHr > 0)
                    SetCellValue(sheet分析报告, 17, "M", _ratedParas.NPSHr.Value);
            }
 
            //实测性能
            if (_testJudgeResults != null && _testJudgeResults.Count > 0)
            {
                var judge_flow = this._testJudgeResults.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.流量);
                var judge_head = this._testJudgeResults.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.扬程);
 
                SetCellValue(sheet分析报告, 22, "A", Math.Round(judge_flow.JudgeValue, 2));
 
                SetCellValue(sheet分析报告, 22, "D", Math.Round(judge_head.JudgeValue, 2));
                if (this._currentPump.Ratedn.HasValue)
                    SetCellValue(sheet分析报告, 22, "F", this._currentPump.Ratedn.Value);
 
 
 
 
                //if (_ratedParas.NPSHr.HasValue && _ratedParas.NPSHr > 0)
                //    SetCellValue(sheet分析报告, 22, "M", _ratedParas.NPSHr.Value);
 
                var flow_result = TProduct.Common.PumpTestJudgeHelper.ConnectFlow(_testJudgeResults);
                SetCellValue(sheet分析报告, 26, "A", "流量");
                SetCellValue(sheet分析报告, 26, "B", flow_result.RequestPercent);
                SetCellValue(sheet分析报告, 26, "E", flow_result.RatedValue * flow_result.JudgeItem.ThresholdValue);
                SetCellValue(sheet分析报告, 26, "G", flow_result.JudgeValue);
                SetCellValue(sheet分析报告, 26, "J", flow_result.ItemJudgResultName);
 
                var head_result = TProduct.Common.PumpTestJudgeHelper.ConnectHead(_testJudgeResults);
                SetCellValue(sheet分析报告, 27, "A", "扬程");
                SetCellValue(sheet分析报告, 27, "B", head_result.RequestPercent);
                SetCellValue(sheet分析报告, 27, "E", head_result.RatedValue * head_result.JudgeItem.ThresholdValue);
                SetCellValue(sheet分析报告, 27, "G", head_result.JudgeValue);
                SetCellValue(sheet分析报告, 27, "J", head_result.ItemJudgResultName);
 
 
                var eta_result = _testJudgeResults.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.泵效率);
                if (eta_result != null)
                {
                    SetCellValue(sheet分析报告, 28, "A", "效率");
                    SetCellValue(sheet分析报告, 28, "B", eta_result.RequestPercent);
                    SetCellValue(sheet分析报告, 28, "E", eta_result.RatedValue - head_result.JudgeItem.ThresholdValue);
                    SetCellValue(sheet分析报告, 28, "G", eta_result.JudgeValue);
                    SetCellValue(sheet分析报告, 28, "J", eta_result.ItemJudgResultName);
                    //var eta_j = Eventech.Common.FitCurveHelper.GetFitPointY(_curveExpressQE, Math.Round(judge_flow.JudgeValue, 2));
                    SetCellValue(sheet分析报告, 22, "J", Math.Round(eta_result.JudgeValue, 2));
 
 
                    var power = Eventech.Common.PumpParaHelper.CalculateP(Math.Round(judge_flow.JudgeValue, 2),
          Math.Round(judge_head.JudgeValue, 2), Math.Round(eta_result.JudgeValue, 2));
                    //var power = Eventech.Common.FitCurveHelper.GetFitPointY(_curveExpressQP, Math.Round(judge_flow.JudgeValue, 2));
                    SetCellValue(sheet分析报告, 22, "H", Math.Round(power, 2));
 
 
                }
 
 
 
 
                if (this._testProject.JudgeResult == TProduct.Model.eTestJudgeResult.合格)
                    SetCellValue(sheet分析报告, 34, "C", "合格");
                else
                    SetCellValue(sheet分析报告, 34, "C", "不合格");
 
            }
 
            //曲线分析
            if (_curveExpressQH != null)
            {
                var min_flow = (from x in this._allRecords select x.CorrectPtQ).Min();
                //最小流量点流量
                SetCellValue(sheet分析报告, 32, "D", Math.Round(min_flow, 2));
 
                var min_flow_head = Eventech.Common.FitCurveHelper.GetFitPointY(_curveExpressQH, Math.Round(min_flow, 2));
                //最小流量点流量
                SetCellValue(sheet分析报告, 32, "K", Math.Round(min_flow_head, 2));
 
                //最高扬程(m)
                var max_head_pt = Eventech.Common.FitCurveHelper.GetMaxPoint(_curveExpressQH, 200);
                SetCellValue(sheet分析报告, 33, "D", Math.Round(max_head_pt.Y, 2));
            }
 
 
            SetCellValue(sheet分析报告, 37, "L", this._testUserName);
 
            sheet分析报告.ForceFormulaRecalculation = true;
 
            return true;
        }
 
 
        private bool WritePage性能测试数据(TProduct.Model.DispStautInfo infoDelegete)
        {
            NPOI.SS.UserModel.ISheet sheet性能测试数据 = _theBookHander.GetSheetAt(4);
            if (sheet性能测试数据 == null)
            {
                infoDelegete("  生成失败,Error:未发现模版 性能测试数据页", 1);
                return false;
            }
 
            //报告编号
            SetCellValue(sheet性能测试数据, 1, "B", this._testProject.ReportFileNO);
            //设备编号
            SetCellValue(sheet性能测试数据, 3, "B", this._currentPump.Code);
            //产品编号
            SetCellValue(sheet性能测试数据, 3, "E", this._currentPart.Code);
            //型号
            SetCellValue(sheet性能测试数据, 3, "H", this._currentPump.Name);
 
 
            if (this._ratedParas != null)
            {
                SetCellValue(sheet性能测试数据, 4, "B", this._ratedParas.Q);
                SetCellValue(sheet性能测试数据, 4, "E", this._ratedParas.H);
                SetCellValue(sheet性能测试数据, 4, "H", this._ratedParas.E);
            }
 
 
 
            if (this._featTestItem.ElectricInfo != null &&
                this._featTestItem.ElectricInfo.Ct > 0)
            {
                SetCellValue(sheet性能测试数据, 5, "B", this._featTestItem.ElectricInfo.Ct);
                if (this._featTestItem.ElectricInfo.Pt > 0)
                    SetCellValue(sheet性能测试数据, 5, "E", this._featTestItem.ElectricInfo.Pt);
            }
 
            if (this._allMonitorPoints == null || this._allMonitorPoints.Count() == 0)
                return false;
 
            if (this._allRecords == null || this._allRecords.Count() == 0)
                return false;
            var sort_allRecords = (from x in this._allRecords orderby x.CorrectPtQ select x).ToList();
            //序号 
            for (var index = 0; index < sort_allRecords.Count(); index++)
            {
                SetCellValue(sheet性能测试数据, 8 + index, "A", index + 1);
            }
 
            //入口压力 
            var mp_inlet = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.压力 && x.Property == TProduct.Model.MonitorTypeProperty.进口);
            if (mp_inlet != null)
            {
                for (var index = 0; index < sort_allRecords.Count(); index++)
                {
                    var rs = sort_allRecords[index].MonitorRecordList.Find(x => x.ID == mp_inlet.ID);
                    if (rs != null)
                        SetCellValue(sheet性能测试数据, 8 + index, "B", rs.Value);
                }
            }
 
            //出口压力
            var mp_outlet = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.压力 && x.Property == TProduct.Model.MonitorTypeProperty.出口);
            if (mp_outlet != null)
            {
                for (var index = 0; index < sort_allRecords.Count(); index++)
                {
                    var rs = sort_allRecords[index].MonitorRecordList.Find(x => x.ID == mp_outlet.ID);
                    if (rs != null)
                        SetCellValue(sheet性能测试数据, 8 + index, "C", rs.Value);
                }
            }
 
 
            //流量
            var mp_flow = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.流量);
            if (mp_flow != null)
            {
                for (var index = 0; index < sort_allRecords.Count(); index++)
                {
                    var rs = sort_allRecords[index].MonitorRecordList.Find(x => x.ID == mp_flow.ID);
                    if (rs != null)
                        SetCellValue(sheet性能测试数据, 8 + index, "D", rs.Value);
                }
            }
 
            //转速
            var mp_speed = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.转速);
            if (mp_speed != null)
            {
                for (var index = 0; index < sort_allRecords.Count(); index++)
                {
                    var rs = sort_allRecords[index].MonitorRecordList.Find(x => x.ID == mp_speed.ID);
                    if (rs != null)
                        SetCellValue(sheet性能测试数据, 8 + index, "E", rs.Value);
                }
            }
 
            //介质温度
            var mp_介质温度 = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.介质温度);
            if (mp_介质温度 != null)
            {
                for (var index = 0; index < sort_allRecords.Count(); index++)
                {
                    var rs = sort_allRecords[index].MonitorRecordList.Find(x => x.ID == mp_介质温度.ID);
                    if (rs != null)
                        SetCellValue(sheet性能测试数据, 8 + index, "F", rs.Value);
                    else
                        SetCellValue(sheet性能测试数据, 8 + index, "F", this._testParas.JzWenDu);
                }
            }
            else
            {
                if (_testParas != null)
                    for (var index = 0; index < sort_allRecords.Count(); index++)
                    {
                        SetCellValue(sheet性能测试数据, 8 + index, "F", this._testParas.JzWenDu);
                    }
            }
 
 
            //电压
            var mp_电压 = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.相电压 && x.Property == "B");
            if (mp_电压 != null)
            {
                for (var index = 0; index < sort_allRecords.Count(); index++)
                {
                    var rs = sort_allRecords[index].MonitorRecordList.Find(x => x.ID == mp_电压.ID);
                    if (rs != null)
                        SetCellValue(sheet性能测试数据, 8 + index, "G", rs.Value);
                }
            }
 
            //电流
            var mp_电流 = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.相电流 && x.Property == "B");
            if (mp_电流 != null)
            {
                for (var index = 0; index < sort_allRecords.Count(); index++)
                {
                    var rs = sort_allRecords[index].MonitorRecordList.Find(x => x.ID == mp_电流.ID);
                    if (rs != null)
                        SetCellValue(sheet性能测试数据, 8 + index, "H", rs.Value);
                }
            }
 
 
            //功率
            var mp_功率 = this._allMonitorPoints.Find(x => x.MonitorType == Model.eMonitorType.功率);
            if (mp_功率 != null)
            {
                for (var index = 0; index < sort_allRecords.Count(); index++)
                {
                    var rs = sort_allRecords[index].MonitorRecordList.Find(x => x.ID == mp_功率.ID);
                    if (rs != null)
                        SetCellValue(sheet性能测试数据, 8 + index, "I", Round(rs.Value, 1));
                }
            }
 
            SetCellValue(sheet性能测试数据, 29, "H", this._currentPump.Ratedn.ToString());
            // 
            for (var index = 0; index < sort_allRecords.Count(); index++)
            {
                SetCellValue(sheet性能测试数据, 32 + index, "A", index + 1);
                SetCellValue(sheet性能测试数据, 32 + index, "B", sort_allRecords[index].CorrectPtQ);
                SetCellValue(sheet性能测试数据, 32 + index, "C", "998");
                SetCellValue(sheet性能测试数据, 32 + index, "D", sort_allRecords[index].TestPtH);
                SetCellValue(sheet性能测试数据, 32 + index, "E", sort_allRecords[index].CorrectPtH);
 
                SetCellValue(sheet性能测试数据, 32 + index, "G", Round(sort_allRecords[index].TestPtP, 1).ToString());
                SetCellValue(sheet性能测试数据, 32 + index, "H", Round(sort_allRecords[index].CorrectPtP, 1).ToString());
 
                SetCellValue(sheet性能测试数据, 32 + index, "I", sort_allRecords[index].CorrectPtE.ToString());
            }
 
            SetCellValue(sheet性能测试数据, 54, "H", this._testProject.CreateTime.ToString("yyyy-MM-dd"));
 
            SetCellValue(sheet性能测试数据, 54, "B", this._testUserName);
 
            sheet性能测试数据.ForceFormulaRecalculation = true;
 
            return true;
        }
 
        private bool WritePage性能测试曲线(TProduct.Model.DispStautInfo infoDelegete)
        {
            NPOI.SS.UserModel.ISheet sheet性能测试曲线 = _theBookHander.GetSheetAt(5);
            if (sheet性能测试曲线 == null)
            {
                infoDelegete("  生成失败,Error:未发现模版性能测试曲线", 1);
                return false;
            }
 
            //报告编号
            SetCellValue(sheet性能测试曲线, 1, "B", this._testProject.ReportFileNO);
 
            //试验编号
            SetCellValue(sheet性能测试曲线, 6, "B", this._testProject.Code);
 
 
            if (this._ratedParas != null)
            {
                SetCellValue(sheet性能测试曲线, 4, "B", this._ratedParas.Q);
                SetCellValue(sheet性能测试曲线, 4, "D", this._ratedParas.H);
                SetCellValue(sheet性能测试曲线, 4, "F", this._ratedParas.P);
                SetCellValue(sheet性能测试曲线, 4, "H", this._currentPump.Ratedn.ToString());
                SetCellValue(sheet性能测试曲线, 4, "J", this._ratedParas.E);
            }
            //实测性能
            if (_testJudgeResults != null && _testJudgeResults.Count > 0)
            {
                var judge_flow = this._testJudgeResults.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.流量);
                var judge_head = this._testJudgeResults.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.扬程);
 
                SetCellValue(sheet性能测试曲线, 5, "B", Math.Round(judge_flow.JudgeValue, 2));
                SetCellValue(sheet性能测试曲线, 5, "D", Math.Round(judge_head.JudgeValue, 2));
                SetCellValue(sheet性能测试曲线, 5, "H", this._currentPump.Ratedn.ToString());
                var judge_eta = _testJudgeResults.Find(x => x.TargeType == TProduct.Model.eTestJudgeTargetType.泵效率);
                if (judge_eta != null)
                {
                    SetCellValue(sheet性能测试曲线, 5, "F", Math.Round(judge_eta.JudgeValue, 2));
                }
            }
            if (this._allMonitorPoints == null || this._allMonitorPoints.Count() == 0)
                return false;
 
            if (this._allRecords == null || this._allRecords.Count() == 0)
                return false;
 
            if (_featChartImage != null)
            {
                _featChartImage.SetDockType(PumpGraph.Picture.FeatChart.eDockType.测试报告, 769, 850);
                var image1 = _featChartImage.CreateImage();
                //System.Drawing.Image img = SPump.DataFile.BASE.NPIOExcelHelper.CreateNewLargeImage(image1, width, height);
                AddImage1(sheet性能测试曲线, 8, "A", 56, "L", image1);//添加图片
            }
 
 
 
            SetCellValue(sheet性能测试曲线, 57, "I", this._testProject.CreateTime.ToString("yyyy-MM-dd"));
 
            SetCellValue(sheet性能测试曲线, 57, "B", this._testUserName);
 
 
            sheet性能测试曲线.ForceFormulaRecalculation = true;
 
            return true;
        }
 
    }
}