ningshuxia
2022-11-09 a7dc1069c4b0e9347337258f0a818b8e92c42bb6
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
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IStation.EtaCalculation
{
    /// <summary>
    /// 泵站分析
    /// </summary>
    public abstract class EtaAnalyCalculatorBase4Station  : EtaAnalyCalculatorBase, IEtaStationAnalyCalculator
    {   
 
        /// <summary>
        /// 
        /// </summary>
        protected int _machineCount = 0;//由外部输入,检验数据,保证外部数据没有遗漏
        /// <summary>
        /// 
        /// </summary>
        protected long _stationID = 0;
 
        /// <summary>
        /// 所有机泵
        /// </summary>
        protected List<IStation.Calculation.Eta.Model.PumpAnaResult> _allMachineList = null;
 
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public List<IStation.Calculation.Eta.Model.PumpAnaResult> GetAllMachineBundleList()
        {
            return _allMachineList;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public Calculation.Eta.Model.StationAnaInfoBundle GetAnaBundle()
        {
            Calculation.Eta.Model.StationAnaInfoBundle bundle = new Calculation.Eta.Model.StationAnaInfoBundle();
            bundle.StationID = this._stationID;
            bundle.AnaResult = this._stationAnaResult;
 
            return bundle;
        }
 
        /// <summary>
        /// 获取分析结果(机泵)
        /// </summary>
        /// <returns></returns>
        public virtual List<Model.EtaSingleRealRecordPure> GetAllSingleAnaRecord()
        {
            if(this._allMachineList == null)    
                return null;    
            List<Model.EtaSingleRealRecordPure> single_ana_result_list = new List<Model.EtaSingleRealRecordPure>();
            foreach (var item in this._allMachineList)
            {
                single_ana_result_list.Add(item.AnaResult);
            }
 
            return single_ana_result_list;
        }
        /// <summary>
        /// 分析结果(泵站)
        /// </summary>
        protected IStation.Model.EtaMultiRealRecordPure _stationAnaResult = null;
        /// <summary>
        /// 获取分析结果(泵站和支线)
        /// </summary>
        /// <returns></returns>
        public virtual IStation.Model.EtaMultiRealRecordPure GetStationAnaRecord()
        {
            return _stationAnaResult;
        }
 
        /// <summary>
        /// (支线)
        /// </summary>
        protected List<Model.EtaMultiRealRecordPure> _pipeAnaResultList = null;
        /// <summary>
        /// 获取分析结果(泵站和支线)
        /// </summary>
        /// <returns></returns>
        public virtual List<Model.EtaMultiRealRecordPure> GetAllPipeAnaRecord()
        {
            return _pipeAnaResultList;
        }
 
        /// <summary>
        /// /所有测点
        /// </summary>
        protected List<Model.EtaMonitorPointAnalyContextitem> _allMonitorList = null;
 
        /// <summary>
        /// 
        /// </summary>
        protected double _threshold_flow = 100;//流量计阀值(大于此值 就认为开通)
 
 
        /// <summary>
        /// 外部调用
        /// </summary>
        /// <param name="context"></param>
        /// <param name="error_info"></param>
        /// <returns></returns>
        public virtual bool Calculate(
            IStation.Model.EtaStationAnalyContextItem context, out string error_info)
        {
            error_info = "未实例化";
            return false;
        }
 
 
        /// <summary>
        /// 计算总管数据 
        /// </summary>
        /// <param name="total_flow"></param>
        /// <param name="result_pipe"></param>
        /// <param name="all_machine_list">子管路时只要输入相关泵即可,其余的泵,对于子管路来说就认为关机,泵站为空即可</param> 
        /// <returns></returns>
        protected virtual bool BuildConnectResult(
            double? total_flow,
            Model.EtaMultiRealRecordPure result_pipe,
            List<IStation.Calculation.Eta.Model.PumpAnaResult> all_machine_list = null)
        {
            if (_allMachineList == null)
                return false;
 
            if (all_machine_list == null  )//为空,表示分析的是泵站, 直接给所有泵即可
                all_machine_list  = this._allMachineList;
 
     
            List<double> all_flow = new List<double>();
            List<double> all_head = new List<double>();
            List<double> all_power = new List<double>();
 
            //用的是泵站的总数量,
            result_pipe.InitialRunList(this._allMachineList.Count());
 
            double qhTotal = 0; 
 
            #region  开机状态 和数量
            int pump_open_count = 0;
            bool allFlowMonitorOk = true;
            bool allPumpHeadOk = true;
            bool allPumpPowerOk = true;
         
            for (int i = 0; i < this._allMachineList.Count; i++)
            {
                var pump = all_machine_list.Find(x => x.MachineID == this._allMachineList[i].MachineID);
                if (pump == null)
                {//子管路时只要输入相关泵即可,其余的泵,对于子管路来说就认为关机
                    continue;
                }
 
 
                var result_pump = pump.AnaResult;
                if (result_pump == null)
                {
                    allFlowMonitorOk = false;
                    allPumpHeadOk = false;
                    allPumpPowerOk = false;
                    continue;
                }
                
                if (!pump.IsRunIng)
                {
                    result_pipe.SetPumpStatusByIndex(i, result_pump.HZa, result_pump.RSa);
                    continue;
                }
 
 
                bool validQ = false, validH = false;
 
                result_pipe.PutStationAnalyInfo(result_pump.AnalyInfo, pump.MachineID);
 
                pump_open_count++;
     
                result_pipe.SetPumpStatusByIndex(i, result_pump.HZa, result_pump.RSa);
 
                if (result_pump.IsHaveAnaTag(IStation.Model.EtaBasicRealRecord.InfoTag_RU))
                {
                    allPumpPowerOk = false;
                    allPumpHeadOk = false;
                    allFlowMonitorOk = false;
                }
 
                if (result_pump.IsHaveAnaTag(IStation.Model.EtaBasicRealRecord.InfoTag_Qa))
                {
                    allFlowMonitorOk = false;
                }
                else if (result_pump.Qa == null)
                {
                    allFlowMonitorOk = false;
                }
                else
                {
                    all_flow.Add(result_pump.Qa.Value);
                    validQ = true;
                }
 
                if (result_pump.IsHaveAnaTag(IStation.Model.EtaBasicRealRecord.InfoTag_Ha) ||
                    result_pump.IsHaveAnaTag(IStation.Model.EtaBasicRealRecord.InfoTag_P2))
                {
                    allPumpHeadOk = false;
                }
                else if (result_pump.Ha == null)
                {
                    allPumpHeadOk = false;
                }
                else if (result_pump.Ha < 1)
                {
                    allPumpHeadOk = false;
                }
                else
                {
                    all_head.Add(result_pump.Ha.Value);
                    validH = true;
                }
 
                if (validQ && validH)
                {
                    qhTotal += result_pump.Qa.Value * result_pump.Ha.Value;
                }
 
                if (result_pump.IsHaveAnaTag(IStation.Model.EtaBasicRealRecord.InfoTag_Pa))
                {
                    allPumpPowerOk = false;
                }
                else if (result_pump.Pa == null)
                {
                    allPumpPowerOk = false;
                }
                else if (result_pump.Pa < 1)
                {
                    allPumpPowerOk = false;
                }
                else
                {
                    all_power.Add(result_pump.Pa.Value);
                }
            }
 
            result_pipe.RunningCount = pump_open_count; 
            #endregion
 
 
            if (total_flow != null)
                result_pipe.Qa = total_flow.Value;
 
            if (pump_open_count > 0)
            {
                if (allFlowMonitorOk && result_pipe.Qa == null && all_flow.Count > 0)
                {
                    result_pipe.Qa = Math.Round(all_flow.Sum(), 1);
                }
 
                if (allPumpHeadOk && all_head.Count > 0)
                {
                    result_pipe.Ha = Math.Round(all_head.Average(), 3);
                }
 
                if (allPumpPowerOk && all_power.Count > 0)
                {
                    result_pipe.Pa = all_power.Sum();
                }
 
                if (allPumpPowerOk && result_pipe.Ha != null && result_pipe.Pa != null && result_pipe.Qa != null)
                {
                    //计算效率 旧代码
                    //double eta = Math.Round(Model.EtaSingleRealRecordPure.Calc_Eta(result_pipe.Qa.Value, result_pipe.Ha.Value, result_pipe.Pa.Value, WaterDensity, g), 1);
 
                    double eta = 0;
                    foreach (var item in all_machine_list)
                    {
                        var result = item.AnaResult;
                        if (result == null)
                            continue;
                        if (result.IsHaveAnaTag(IStation.Model.EtaBasicRealRecord.InfoTag_Qa) || result.IsHaveAnaTag(IStation.Model.EtaBasicRealRecord.InfoTag_Ha))
                            continue;
                        if (result.Ea.HasValue && result.Qa.HasValue && result.Ha.HasValue)
                        {
                            eta += (result.Qa.Value * result.Ha.Value / qhTotal) * result.Ea.Value;
                        }
                    }
                     
 
                    result_pipe.Ea = Math.Round(eta, 1);
                    result_pipe.UWPa = 0;
                    result_pipe.WPa = 0; 
                    // 检查效率
                    if (eta > 95)
                    {//有时, 大流量曲线部分,是曲线不精确, 造成Q H曲线不符合实际, 造成效率计算出问题                 
                        result_pipe.AnalyStatus = Model.Eta.eAnalyStatus.Abnormal;
                        result_pipe.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ea, eta.ToString());
                    }
                    else
                    {//计算 
                        if (result_pipe.AnalyStatus == Model.Eta.eAnalyStatus.Unkonw)
                            result_pipe.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
                        result_pipe.CalcUnitPower(); 
                    }
                }
                else
                {
                    result_pipe.AnalyStatus = Model.Eta.eAnalyStatus.Abnormal;
                }
            }
            else
            {//表示没有开机的
                result_pipe.SetEmptyPipe(this._machineCount);
            }
 
 
            return true;
        }
 
        #region 初始化测点列表
        /// <summary>
        /// 初始化测点列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="error_info"></param>
        /// <returns></returns>
        protected bool InitialMonitorList(
            Model.EtaStationAnalyContextItem context,
            out string error_info)
        {
            if (this._allMonitorList != null && this._allMonitorList.Count > 0)
            {//只用初始化一次即可
                error_info = null;
                return true;
            }
            List<Model.EtaPipeLineAnalyContextItem> PatternContextItems = context.PipeLineContextItems;
            this._allMonitorList = new List<Model.EtaMonitorPointAnalyContextitem>();
            foreach (var s in PatternContextItems)
            {
                if (s.MonitorPointContextItems != null)
                {
                    _allMonitorList.AddRange(s.MonitorPointContextItems);
                }
            }
            if (_allMonitorList.Count() == 0)
            {
                error_info = "没有任何监测数据";
                return false;
            }
            error_info = null;
            return true;
        }
 
        #endregion
 
        /// <summary>
        /// 初始化泵列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="error_info"></param>
        /// <returns></returns>
        protected virtual bool InitialPumpList(Model.EtaStationAnalyContextItem context, out string error_info)
        {
            error_info = "没有实例化";
            return false;
        }
 
        #region 构造机泵列表
        /// <summary>
        /// 构造机泵列表
        /// </summary>
        /// <param name="context">泵站上下文</param>
        /// <param name="machine_id_array"></param>
        /// <param name="monitor_id_run_status"></param>
        /// <param name="monitor_id_pump_flow"></param>
        /// <param name="is液位代替进口压力"></param>
        /// <param name="monitor_id_inlet_press"></param>
        /// <param name="monitor_id_outlet_press"></param>
        /// <param name="monitor_id_motor_power"></param>
        /// <param name="monitor_id_frequence"></param>
        /// <param name="monitor_id_zhuansu"></param>
        /// <param name="monitor_id_ele_curret"></param>
        /// <param name="error_info"></param>
        /// <returns></returns>
        protected List<IStation.Calculation.Eta.Model.PumpAnaResult> InitialPumpMachineList(
            Model.EtaStationAnalyContextItem context,
            long[] machine_id_array, //基本ID
            long[] monitor_id_run_status,//运行状态 
            long[] monitor_id_pump_flow,// 流量计
            bool is液位代替进口压力,
            long[] monitor_id_inlet_press,//进口压力计
            long[] monitor_id_outlet_press,//出口压力
            long[] monitor_id_motor_power,//瞬间功率
            long[] monitor_id_frequence,//频率
            long[] monitor_id_zhuansu,//转速
            long[] monitor_id_ele_curret,//电流
            out string error_info)
        {
            int machine_count = machine_id_array.Count();
 
            if (monitor_id_run_status == null || monitor_id_run_status.Count() != machine_count)
            {
                error_info = $"{context.Name}运行状态测点ID设置不正确!Error:67";
                return null;
            }
            if (monitor_id_pump_flow == null || monitor_id_pump_flow.Count() != machine_count)
            {
                error_info = $"{context.Name}流量测点ID设置不正确!Error:72";
                return null;
            }
            if (monitor_id_outlet_press == null || monitor_id_outlet_press.Count() != machine_count)
            {
                error_info = $"{context.Name}压力测点ID设置不正确!Error:77";
                return null;
            }
 
 
            error_info = null;
            List<IStation.Calculation.Eta.Model.PumpAnaResult> machine_list = new List<IStation.Calculation.Eta.Model.PumpAnaResult>(machine_count);
            for (int i = 0; i < machine_count; i++)
            {
                var machine_id = machine_id_array[i];
                Model.EtaEnginePumpAnalyContextItem machine_context = null;
                foreach (var item in context.PipeLineContextItems)
                {
                    if (item.Catalog != IStation.Product.Catalog_JiBeng)
                        continue;
 
                    machine_context = item.ProductContextItem as Model.EtaEnginePumpAnalyContextItem;
                    if (machine_context == null)
                        continue;
                    if (machine_id == machine_context.ObjectID)
                    {
                        var series_no = 0;
                        if (item.SerialNO.HasValue)
                        {
                            series_no = item.SerialNO.Value;
                        }
                        var bundle = new IStation.Calculation.Eta.Model.PumpAnaResult(machine_context)
                        {
                            SerialNO = series_no,
                            PipeLineID = machine_context.PipeLineID,
                            MachineID = machine_id
                        };
 
                        var result_pump = new Model.EtaSingleRealRecordPure();
 
                        result_pump.ObjectType = IStation.ObjectType.PipeLine;
                        result_pump.ObjectID = machine_context.PipeLineID;
 
                        result_pump.RSa = IStation.RunStatus.UnKnown;//默认未知
                        result_pump.AnalyStatus = Model.Eta.eAnalyStatus.Unkonw;
                        if (monitor_id_pump_flow != null && monitor_id_pump_flow.Count() > i)
                        {
                            bundle.MonitorID_PumpFlow = monitor_id_pump_flow[i];
                        }
                        if (monitor_id_run_status != null && monitor_id_run_status.Count() > i)
                        {
                            bundle.MonitorID_RunStatus = monitor_id_run_status[i];
                        }
                        bundle.Is液位代替进口压力 = is液位代替进口压力;
                        if (monitor_id_inlet_press != null && monitor_id_inlet_press.Count() > i)
                        {
                            bundle.MonitorID_InletPress = monitor_id_inlet_press[i];
                        }
                        if (monitor_id_outlet_press != null && monitor_id_outlet_press.Count() > i)
                        {
                            bundle.MonitorID_OutletPress = monitor_id_outlet_press[i];
                        }
                        if (monitor_id_motor_power != null && monitor_id_motor_power.Count() > i)
                        {
                            bundle.MonitorID_MotorPower = monitor_id_motor_power[i];
                        }
                        if (monitor_id_frequence != null && monitor_id_frequence.Count() > i)
                        {
                            bundle.MonitorID_Frequence = monitor_id_frequence[i];
                        }
                        if (monitor_id_zhuansu != null && monitor_id_zhuansu.Count() > i)
                        {
                            bundle.MonitorID_ZhuanSu = monitor_id_zhuansu[i];
                        }
                        if (monitor_id_ele_curret != null && monitor_id_ele_curret.Count() > i)
                        {
                            bundle.MonitorID_ele_current = monitor_id_ele_curret[i];
                        }
                        bundle.AnaResult = result_pump;
                        machine_list.Add(bundle);
                    }
 
                }
 
 
                if (machine_context == null)
                {
                    error_info = "此机泵无法找到对应管路设置 , 机泵ID=" + machine_id_array[i];
                    return null;
                }
            }
 
            if (machine_list.Count() != machine_count)
            {
                error_info = string.Format("错误代码Error:230, 能效实时分析任务中,机泵无法全部获取!stationID={0}", this._stationID);
 
                return null;
            }
 
            var sort_machine_list = (from x in machine_list orderby x.SerialNO select x).ToList();
 
            return sort_machine_list;
        }
        #endregion
 
        #region 分析 泵的运行状态(开机关机)
        /// <summary>
        /// 分析单泵的运行状态
        /// </summary>
        /// <param name="error_info"></param>
        /// <returns></returns>
        protected bool AnaAllPumpRunStatus(out string error_info)
        {
            for (int i = 0; i < this._allMachineList.Count(); i++)
            {
                var pump_context = this._allMachineList[i];
 
                if (!AnaPumpRunStatus(pump_context, out error_info))
                {//分析单泵
                    return false;
                }
 
                if (pump_context.AnaResult.RSa == IStation.RunStatus.Shut)
                {
                    pump_context.AnaResult.Qa = 0;
                    pump_context.AnaResult.Ha = 0;
                    pump_context.AnaResult.Pa = 0;
                    pump_context.AnaResult.Ea = 0;
                    pump_context.AnaResult.UWPa = 0;
                    pump_context.AnaResult.WPa = 0;
 
                    if (pump_context.AnaResult.AnalyStatus ==  Model.Eta.eAnalyStatus.Unkonw)
                        pump_context.AnaResult.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
                }
 
            }
 
 
 
            error_info = null;
            return true;
        }
 
        /// <summary>
        /// 分析单泵的运行状态
        /// </summary>
        /// <param name="pump_context"></param>
        /// <param name="error_info"></param>
        /// <returns></returns>
        protected bool AnaPumpRunStatus( IStation.Calculation.Eta.Model.PumpAnaResult pump_context, out string error_info)
        {
            if (pump_context == null)
            {
                error_info = "Error 375";
                return false;
            }
 
 
            #region 开停机状态,以及频率, 电流
            var ana_context = pump_context.AnaResult;
            if (ana_context == null)
            {
                error_info = "AnaResult 为空 错误代码! Error:359";
                return false;
            }
            bool isAnaOk = false;
            if (pump_context.MonitorID_RunStatus > 0)
            {
                var monitor_run = _allMonitorList.Find(x => x.ObjectID == pump_context.MonitorID_RunStatus);
 
                if (monitor_run == null)
                {
                    ana_context.AnalyStatus =  Model.Eta.eAnalyStatus.Missing;
                    ana_context.PutAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_RU, null);
                }
                else if (monitor_run.DataValue > 0.1)
                {
                    isAnaOk = true;
                    ana_context.RSa = IStation.RunStatus.Run;
                }
                else
                {
                    isAnaOk = true;
                    ana_context.RSa = IStation.RunStatus.Shut;
                    ana_context.Qa = 0;
                    ana_context.Ha = 0;
                    ana_context.Pa = 0;
                }
            }
 
            #endregion
 
            bool isOk频率 = false;
            bool isAddTag_hz = false;
            //分析频率
            if (isAnaOk)
            {
                #region 开机状态分析正常
                if (pump_context.IsRunIng)
                {
                    if (!pump_context.IsFrequency)
                    {
                        isOk频率 = true;
                        ana_context.HZa = 50;
                    }
                    else
                    {
                        if (pump_context.MonitorID_Frequence > 0)
                        {
                            #region 变频, 且已开机
                            var monitor_frequence = _allMonitorList.Find(x => x.ObjectID == pump_context.MonitorID_Frequence);
                            if (monitor_frequence == null)
                            {
                                isAddTag_hz = true;
                                ana_context.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                                ana_context.PutAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_HZ, null);
                            }
                            else if (monitor_frequence.DataValue < 10 || monitor_frequence.DataValue > 55)
                            {//数据不正常
                                ana_context.HZa  = monitor_frequence.DataValue;
                                ana_context.AnalyStatus = Model.Eta.eAnalyStatus.Abnormal;
                                ana_context.PutAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_HZ, null);
                            }
                            else
                            {
                                isOk频率 = true;
                                ana_context.HZa = monitor_frequence.DataValue;
                            }
                            #endregion
                        }
                        else
                        {
                            isAddTag_hz = true;
                            ana_context.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                            ana_context.PutAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_HZ, null);
                        }
                    }
                }
                else
                {
                    isOk频率 = true;
                    ana_context.HZa = 0;
                }
                #endregion
            }
            else
            {
                #region 开机状态分析不正常, 看看用频率判断开停机行不行
                if (pump_context.MonitorID_Frequence > 0)
                {
                    var monitor_frequence = _allMonitorList.Find(x => x.ObjectID == pump_context.MonitorID_Frequence);
                    if (monitor_frequence == null)
                    {
                        ana_context.AnalyStatus =  Model.Eta.eAnalyStatus.Missing;
                        ana_context.PutAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_HZ, null);
                    }
                    else if (monitor_frequence.DataValue < 10 || monitor_frequence.DataValue > 55)
                    {//数据不正常
                        ana_context.HZa = monitor_frequence.DataValue;
                        ana_context.AnalyStatus = Model.Eta.eAnalyStatus.Abnormal;
                        ana_context.PutAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_HZ, null);
                    }
                    else
                    {//数据正常
                        isOk频率 = true;
                        ana_context.HZa = monitor_frequence.DataValue;
                        ana_context.RSa = IStation.RunStatus.Run;//表示开机了
                    }
 
                }
                #endregion
            }
 
 
            //
            var monitor_id_转速 = pump_context.MonitorID_ZhuanSu;
            if (monitor_id_转速 > 0 && !isOk频率)
            {
                var monitor_zhuansu = _allMonitorList.Find(x => x.ObjectID == monitor_id_转速);
                if (monitor_zhuansu == null)
                {
                    if (!isAddTag_hz)
                    {
                        ana_context.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                        ana_context.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_HZ, null);
                    }
                }
                else
                {
                    var zhuansu = monitor_zhuansu.DataValue;
                    if (zhuansu < 10)
                    {
                        ana_context.HZa = 0;
                        ana_context.AnalyStatus =  Model.Eta.eAnalyStatus.Abnormal;
                        ana_context.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_HZ, null);
                    }
                    else
                    {
                        if (pump_context.Context != null)
                        {
                            if (pump_context.Context.RatedParas.N < 10)
                            {
                                ana_context.AnalyStatus = Model.Eta.eAnalyStatus.Abnormal;
                                ana_context.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_HZ, "额定转速未设置");
                            }
                            else
                            {
                                if (isAddTag_hz)
                                {
                                    ana_context.RemoveAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_HZ);
                                }
                                ana_context.HZa = Math.Round(50 * zhuansu / pump_context.Context.RatedParas.N, 2);
                            }
                        }
                    }
                }
            }
 
 
 
            //用电流判断是否开机
            if (!isAnaOk)
            {
                #region  用电流判断是否开机
                if (pump_context.MonitorID_ele_current > 0)
                {
                    var monitor_ele_current = _allMonitorList.Find(x => x.ObjectID == pump_context.MonitorID_ele_current);
                    if (monitor_ele_current == null)
                    {
                        ana_context.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                        ana_context.PutAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_Ia, null);
                    }
                    else if (monitor_ele_current.DataValue < 1)
                    {//数据不正常
                        ana_context.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                        ana_context.PutAnalyInfo(Model.EtaSingleRealRecordPure.InfoTag_Ia, null);
                    }
                    else
                    {//数据正常 
                        ana_context.RSa = IStation.RunStatus.Run;//表示开机了
                    }
                }
                #endregion
            }
 
 
            error_info = null;
            return true;
        }
 
        #endregion
 
 
        /// <summary>
        /// 根据压差计算流量扬程点
        /// </summary>
        /// <param name="pump_curve"></param>
        /// <param name="inlet_dia"></param>
        /// <param name="inlet_press"></param>
        /// <param name="outlet_dia"></param>
        /// <param name="outlet_press" ></param>
        /// <param name="hz"></param>
        /// <returns></returns>
        protected IStation.Model.CurvePoint GetFolwByPress(
            IStation.Model.CurveExpress pump_curve,
            double inlet_dia, double inlet_press,
            double outlet_dia, double outlet_press,
            double hz)
        {
            //转成米
            double h4Press = UnitConvert_MPa2M(outlet_press - inlet_press);
 
            IStation.Model.CurveExpress curve_qh = null;
            if (hz < 49 && hz > 20)
            {//进行曲线换算
                curve_qh = CalcCurveQhByHz(pump_curve, hz);
            }
            else
            {//原始曲线即可
                curve_qh = pump_curve;
            }
            if (curve_qh == null)
                return null;
 
            //先用压差查询流量   
            List<IStation.Model.CurvePoint> listQ0 = IStation.Model.FitCurveHelper.GetInterPointExX(curve_qh, h4Press, 50, 1.5);//放大一点
            if (listQ0 == null || listQ0.Count == 0)
            {
                return null;
            }
 
            var m_inlet_dia = inlet_dia / 1000;//转成m
            var m_outlet_dia = outlet_dia / 1000;//转成m
 
            double OtherPressCoeff = 4 / Math.PI / 3600;
            //OtherPressCoeff = 4 * 1000 / Math.PI / 3.6;
            double dieDai_q = listQ0.Last().X;//用于计算的流量
            double dieDai_h = 0;
            double last_dieDai_q = dieDai_q;
            for (int calcNo = 1; calcNo <= 3; calcNo++)//迭代三次
            {
                if (last_dieDai_q < 1)
                {//流量不可能过小
                    return null;
                }
                double rPipeInV = 0;
                if (inlet_dia > 0)
                {
                    rPipeInV = OtherPressCoeff * dieDai_q / m_inlet_dia / m_inlet_dia;
                }
 
                double rPipeOutV = 0;
                if (outlet_dia > 0)
                {
                    rPipeOutV = OtherPressCoeff * dieDai_q / m_outlet_dia / m_outlet_dia;
                }
 
 
                double rVDif = (rPipeOutV * rPipeOutV - rPipeInV * rPipeInV) / 9.81 / 2.0;
                dieDai_h = h4Press + rVDif;
 
                List<IStation.Model.CurvePoint> listQ = IStation.Model.FitCurveHelper.GetInterPointExX(curve_qh, dieDai_h, 50, 1.5);//放大一点
                if (listQ == null || listQ.Count() == 0)
                {
                    return new IStation.Model.CurvePoint(dieDai_q, dieDai_h);
                }
                dieDai_q = listQ.Last().X;
                if (Math.Abs(dieDai_q - last_dieDai_q) / last_dieDai_q < 0.005)
                {
                    return new IStation.Model.CurvePoint(dieDai_q, dieDai_h);
                }
                //继续迭代
                if (dieDai_q > last_dieDai_q)
                {
                    dieDai_q = dieDai_q - Math.Abs(dieDai_q - last_dieDai_q) / 2;
                }
                else
                {
                    dieDai_q = dieDai_q + Math.Abs(dieDai_q - last_dieDai_q) / 2;
                }
 
                last_dieDai_q = dieDai_q;
            }
 
            return new IStation.Model.CurvePoint(dieDai_q, dieDai_h);
        }
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="curve_QH"></param>
        /// <param name="hz"></param>
        /// <returns></returns>
        public static IStation.Model.CurveExpress CalcCurveQhByHz(
            IStation.Model.CurveExpress curve_QH, double hz)
        {
            if (curve_QH == null)
                return null;
            if (hz > 49.5)
                return curve_QH;
 
            double f_ratio = hz / 50.0;
            var points = IStation.Model.FitCurveHelper.GetFitPoints(curve_QH, 12);
 
            List<IStation.Model.CurvePoint> simu_points = new List<IStation.Model.CurvePoint>();
            foreach (var pt in points)
            {
                double xshsFlow = pt.X * f_ratio;
                double xshsHead = pt.Y * f_ratio * f_ratio;
                simu_points.Add(new IStation.Model.CurvePoint(xshsFlow, xshsHead));
            }
 
            return new IStation.Model.CurveExpress(simu_points);
        }
 
 
 
        #region  单泵分析
        /// <summary>
        /// 单泵流量计(运行状态待分析)
        /// </summary>
        /// <param name="context_pump"></param>
        /// <returns></returns>
        protected bool Analy_有单泵流量计_运行状态已分析_工频泵(
            ref IStation.Calculation.Eta.Model.PumpAnaResult context_pump)
        {
            var ana_result = context_pump.AnaResult;
            if (ana_result == null)
                return false;
 
            bool is液位代替出口压力 = context_pump.Is液位代替出口压力;
            bool is液位代替进口压力 = context_pump.Is液位代替进口压力;
            long monitor_id_进口压力 = context_pump.MonitorID_InletPress;
            long monitor_id_出口压力 = context_pump.MonitorID_OutletPress;
            long monitor_id_瞬时流量 = context_pump.MonitorID_PumpFlow;
            long monitor_id_瞬时功率 = context_pump.MonitorID_MotorPower;
 
 
 
            if (!context_pump.IsRunIng)
            {//表示关机
                context_pump.Ana_flow_ok = true;//没有开机就认为是成功
                context_pump.Ana_head_ok = true;
                context_pump.Ana_eta_ok = true;
                context_pump.Ana_power_ok = true;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
                ana_result.RSa = IStation.RunStatus.Shut;
                ana_result.Qa = 0;
                ana_result.Ha = 0;
                ana_result.Pa = 0;
                ana_result.HZa  = 0;
                return true;
            }
 
            ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
 
 
            context_pump.Ana_flow_ok = false;
            context_pump.Ana_head_ok = false;
            context_pump.Ana_eta_ok = false;
 
            #region 流量
            double total_flow = 0;
            var monitor_flow = _allMonitorList.Find(x => x.ObjectID == monitor_id_瞬时流量);
            if (monitor_flow == null)
            {
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Qa, null);
                context_pump.Ana_flow_ok = false;
            }
            else
            {
                ana_result.Qa = monitor_flow.DataValue;
                total_flow = monitor_flow.DataValue;
                if (monitor_flow.DataValue < _threshold_flow)
                {
                    ana_result.Qa = monitor_flow.DataValue;
                    ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Abnormal;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Qa, null);
                    context_pump.Ana_flow_ok = false;
                }
                context_pump.Ana_flow_ok = true;
            }
 
            #endregion
 
 
            #region  功率
            double total_power = 0;
            var monitor_power = _allMonitorList.Find(x => x.ObjectID == monitor_id_瞬时功率);
            if (monitor_power == null)
            {
                context_pump.Ana_power_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, null);
            }
            else
            {
                total_power = monitor_power.DataValue;
                if (total_power < 1)
                {
                    context_pump.Ana_power_ok = false;
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, total_power.ToString());
                }
                else
                {
                    context_pump.Ana_power_ok = true;
                }
                ana_result.Pa = total_power;
            }
            #endregion
 
 
            #region 频率
            ana_result.HZa = 50;
            #endregion
 
 
            #region  进口压力
            var monitor_inlet_press = _allMonitorList.Find(x => x.ObjectID == monitor_id_进口压力);
            if (monitor_inlet_press == null)
            {
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P1, null);
                return false;
            }
            double p1m = monitor_inlet_press.DataValue;
            if (is液位代替进口压力)
            {//液位一般都是m
                p1m = UnitConvert_M2MPa(p1m);
            }
 
            if (monitor_inlet_press.Elevation != null)
            {//判断是否有标高
                p1m += UnitConvert_M2MPa(monitor_inlet_press.Elevation.Value);
            }
 
            double mm_inlet_dia = 0;//用 mm
            if (monitor_inlet_press.PipeDia.HasValue)
            {
                mm_inlet_dia = monitor_inlet_press.PipeDia.Value;
            }
            #endregion
 
 
            #region  出口压力
 
            var monitor_outlet_press = _allMonitorList.Find(x => x.ObjectID == monitor_id_出口压力);
            if (monitor_outlet_press == null)
            {
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P2, null);
                return false;
            }
            double p2m = monitor_outlet_press.DataValue;
            if (is液位代替出口压力)
            {//液位一般都是m
                p2m = UnitConvert_M2MPa(p2m);
            }
            if (monitor_outlet_press.Elevation != null)
            {//判断是否有标高
                p2m += UnitConvert_M2MPa(monitor_outlet_press.Elevation.Value);
            }
 
            double mm_outlet_dia = 0;//用 mm
            if (monitor_outlet_press.PipeDia.HasValue)
            {
                mm_outlet_dia = monitor_outlet_press.PipeDia.Value;
            }
 
            #endregion
 
 
            #region 计算扬程
            double OtherPressCoeff = 4 * 1000 / Math.PI / 3.6;
            double rPipeInV = 0;
            if (mm_inlet_dia > 10)
            {
                rPipeInV = OtherPressCoeff * total_flow / mm_inlet_dia / mm_inlet_dia;
            }
 
            double rPipeOutV = 0;
            if (mm_outlet_dia > 10)
            {
                rPipeOutV = OtherPressCoeff * total_flow / mm_outlet_dia / mm_outlet_dia;
            }
 
            double rVDif = (rPipeOutV * rPipeOutV - rPipeInV * rPipeInV) / (g * 2.0);
            double total_head = Math.Round(UnitConvert_MPa2M(p2m - p1m) + rVDif, 2);
            ana_result.Ha = total_head;
            //检查扬程 
            if (total_head > 800)
            {
                context_pump.Ana_head_ok = false;
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
            }
            else if (total_head < 1)
            {
                context_pump.Ana_head_ok = false;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
            }
            else
            {
                context_pump.Ana_head_ok = true;
            }
            #endregion
 
 
 
 
            ana_result.CalcUnitPower();
 
            context_pump.Ana_eta_ok = false;
 
            if (total_power > 1 && context_pump.Ana_power_ok && context_pump.Ana_head_ok && context_pump.Ana_flow_ok)
            { 
                //计算效率
                double eta = Math.Round(Model.EtaSingleRealRecordPure.Calc_Eta(total_flow, total_head, total_power, WaterDensity, g), 1);
                ana_result.Ea = eta;
 
                // 检查效率
                if (eta > 95 || eta < 40)
                {//有时, 大流量曲线部分,是曲线不精确, 造成Q H曲线不符合实际, 造成效率计算出问题 
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ea, eta.ToString());
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                }
                else
                {//计算 
                    if (ana_result.AnalyStatus ==  Model.Eta.eAnalyStatus.Unkonw)
                        ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
 
                    context_pump.Ana_eta_ok = true;
                }
            }
 
            return true;
        }
 
        /// <summary>
        /// 单泵流量计(运行状态待分析)
        /// </summary>
        /// <param name="context_pump"></param>
        /// <returns></returns>
        protected bool Analy_有单泵流量计_运行状态已分析_变频泵(
            ref IStation.Calculation.Eta.Model.PumpAnaResult context_pump)
        {
            var ana_result = context_pump.AnaResult;
            if (ana_result == null)
                return false;
            bool is液位代替出口压力 = context_pump.Is液位代替出口压力;
            bool is液位代替进口压力 = context_pump.Is液位代替进口压力;
            long monitor_id_进口压力 = context_pump.MonitorID_InletPress;
            long monitor_id_出口压力 = context_pump.MonitorID_OutletPress;
            long monitor_id_瞬时流量 = context_pump.MonitorID_PumpFlow;
            long monitor_id_瞬时功率 = context_pump.MonitorID_MotorPower;
           // long monitor_id_频率 = context_pump.MonitorID_Frequence;
           // long monitor_id_转速 = context_pump.MonitorID_ZhuanSu;
 
            if (!context_pump.IsRunIng)
            {//表示关机
                context_pump.Ana_flow_ok = true;//没有开机就认为是成功
                context_pump.Ana_head_ok = true;
                context_pump.Ana_eta_ok = true;
                context_pump.Ana_power_ok = true;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
                ana_result.RSa = IStation.RunStatus.Shut;
                ana_result.Qa = 0;
                ana_result.Ha = 0;
                ana_result.Pa = 0;
                ana_result.HZa = 0;
                return true;
            }
 
            ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
 
            context_pump.Ana_flow_ok = false;
            context_pump.Ana_head_ok = false;
            context_pump.Ana_eta_ok = false;
 
            #region 流量
            double total_flow = 0;
            var monitor_flow = _allMonitorList.Find(x => x.ObjectID == monitor_id_瞬时流量);
            if (monitor_flow == null)
            {
                ana_result.Qa = null;
                context_pump.Ana_flow_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Qa, null);
            }
            else
            {
                ana_result.Qa = monitor_flow.DataValue;
                total_flow = monitor_flow.DataValue;
                if (monitor_flow.DataValue < _threshold_flow)
                {
                    ana_result.Qa = monitor_flow.DataValue;
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Qa, null);
                    context_pump.Ana_flow_ok = false;
                }
                else
                {
                    context_pump.Ana_flow_ok = true;
                }
            }
 
            #endregion
 
 
            #region  功率
            double total_power = 0;
            var monitor_power = _allMonitorList.Find(x => x.ObjectID == monitor_id_瞬时功率);
            if (monitor_power == null)
            {
                context_pump.Ana_power_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, null);
            }
            else
            {
                total_power = monitor_power.DataValue;
                if (total_power < 1)
                {
                    context_pump.Ana_power_ok = false;
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, total_power.ToString());
                }
                else
                {
                    context_pump.Ana_power_ok = true;
                }
                ana_result.Pa = total_power;
            }
            #endregion
 
 
            #region  进口压力
            var monitor_inlet_press = _allMonitorList.Find(x => x.ObjectID == monitor_id_进口压力);
            if (monitor_inlet_press == null)
            {
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P1, null);
                return false;
            }
 
            double p1m = monitor_inlet_press.DataValue;
            if (is液位代替进口压力)
            {//液位一般都是m
                p1m = UnitConvert_M2MPa(p1m);
            }
 
            if (monitor_inlet_press.Elevation != null)
            {//判断是否有标高
                p1m += UnitConvert_M2MPa(monitor_inlet_press.Elevation.Value);
            }
 
            double mm_inlet_dia = 0;//用 mm
            if (monitor_inlet_press.PipeDia.HasValue)
            {
                mm_inlet_dia = monitor_inlet_press.PipeDia.Value;
            }
            #endregion
 
 
            #region  出口压力
 
            var monitor_outlet_press = _allMonitorList.Find(x => x.ObjectID == monitor_id_出口压力);
            if (monitor_outlet_press == null)
            {
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P2, null);
                return false;
            }
            double p2m = monitor_outlet_press.DataValue;
            if (is液位代替出口压力)
            {//液位一般都是m
                p2m = UnitConvert_M2MPa(p2m);
            }
            if (monitor_outlet_press.Elevation != null)
            {//判断是否有标高
                p2m += UnitConvert_M2MPa(monitor_outlet_press.Elevation.Value);
            }
 
            double mm_outlet_dia = 0;//用 mm
            if (monitor_outlet_press.PipeDia.HasValue)
            {
                mm_outlet_dia = monitor_outlet_press.PipeDia.Value;
            }
 
            #endregion
 
 
            #region 计算扬程
            double OtherPressCoeff = 4 * 1000 / Math.PI / 3.6;
            double rPipeInV = 0;
            if (mm_inlet_dia > 10)
            {
                rPipeInV = OtherPressCoeff * total_flow / mm_inlet_dia / mm_inlet_dia;
            }
 
            double rPipeOutV = 0;
            if (mm_outlet_dia > 10)
            {
                rPipeOutV = OtherPressCoeff * total_flow / mm_outlet_dia / mm_outlet_dia;
            }
 
            double rVDif = (rPipeOutV * rPipeOutV - rPipeInV * rPipeInV) / (g * 2.0);
            double total_head = Math.Round(UnitConvert_MPa2M(p2m - p1m) + rVDif, 2);
            ana_result.Ha = total_head;
            //检查扬程
            if (total_head > 800)
            {
                context_pump.Ana_head_ok = false;
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
            }
            else if (total_head < 1)
            {
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                context_pump.Ana_head_ok = false;
            }
            else
            {
                context_pump.Ana_head_ok = true;
            }
            #endregion
 
 
 
 
            ana_result.CalcUnitPower();
 
            context_pump.Ana_eta_ok = false;
 
            if (total_power > 1 && total_flow > 1 &&
                context_pump.Ana_head_ok && context_pump.Ana_power_ok)
            { 
                //计算效率
                double eta = Math.Round(Model.EtaSingleRealRecordPure.Calc_Eta(total_flow, total_head, total_power, WaterDensity, g), 1);
 
                ana_result.Ea = eta;
 
                // 检查效率
                if (eta > 95 || eta < 40)
                {//有时, 大流量曲线部分,是曲线不精确, 造成Q H曲线不符合实际, 造成效率计算出问题 
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ea, eta.ToString());
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                }
                else
                {//计算 
                    if (ana_result.AnalyStatus == Model.Eta.eAnalyStatus.Unkonw)
                        ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
 
                    context_pump.Ana_eta_ok = true;
                }
            }
 
            return true;
        }
 
 
        /// <summary>
        /// 单泵流量计
        /// </summary>
        /// <param name="pump_flow"></param> 
        /// <param name="pump"></param>
        /// <returns></returns>
        protected bool Analy_有单泵流量计_运行状态已分析_变频泵(
            double pump_flow,//
            ref IStation.Calculation.Eta.Model.PumpAnaResult pump)
        {
            if (pump == null)
                return false;
            var ana_result = pump.AnaResult;
            if (ana_result == null)
                ana_result = new IStation.Model.EtaSingleRealRecordPure();
 
            long monitor_id_进口压力 = pump.MonitorID_InletPress;
            long monitor_id_出口压力 = pump.MonitorID_OutletPress;
            long monitor_id_瞬时功率 = pump.MonitorID_MotorPower;
 
            Model.EtaMonitorPointAnalyContextitem monitor_record_进口压力 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_进口压力);
            Model.EtaMonitorPointAnalyContextitem monitor_record_出口压力 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_出口压力);
            Model.EtaMonitorPointAnalyContextitem monitor_record_瞬时功率 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_瞬时功率);
 
 
 
            pump.Ana_head_ok = false;
            pump.Ana_eta_ok = false;
            pump.Ana_flow_ok = true;
 
            ana_result.Qa = pump_flow;
 
            #region  功率
            double total_power = 0;
            if (monitor_record_瞬时功率 == null)
            {
                pump.Ana_power_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, null);
            }
            else
            {
                total_power = monitor_record_瞬时功率.DataValue;
                if (total_power < 1)
                {
                    pump.Ana_power_ok = false;
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, total_power.ToString());
                }
                else
                {
                    pump.Ana_power_ok = true;
                }
                ana_result.Pa = total_power;
            }
 
            #endregion
 
 
            #region  进口压力 
            if (monitor_record_进口压力 == null)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P1, null);
                return false;
            }
            double p1m = monitor_record_进口压力.DataValue;
            if (pump.Is液位代替进口压力)
            {//液位一般都是m
                p1m = UnitConvert_M2MPa(p1m);
            }
 
            if (monitor_record_进口压力.Elevation != null)
            {//判断是否有标高
                p1m += UnitConvert_M2MPa(monitor_record_进口压力.Elevation.Value);
            }
 
            double mm_inlet_dia = 0;//用 mm
            if (monitor_record_进口压力.PipeDia.HasValue)
            {
                mm_inlet_dia = monitor_record_进口压力.PipeDia.Value;
            }
            #endregion
 
 
            #region  出口压力 
            if (monitor_record_出口压力 == null)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P2, null);
                return false;
            }
            double p2m = monitor_record_出口压力.DataValue;
            if (monitor_record_出口压力.Elevation != null)
            {//判断是否有标高
                p2m += UnitConvert_M2MPa(monitor_record_出口压力.Elevation.Value);
            }
 
            double mm_outlet_dia = 0;//用 mm
            if (monitor_record_出口压力.PipeDia.HasValue)
            {
                mm_outlet_dia = monitor_record_出口压力.PipeDia.Value;
            }
 
            #endregion
 
 
            #region 计算扬程
            pump.Ana_head_ok = false;
            double OtherPressCoeff = 4 * 1000 / Math.PI / 3.6;
            double rPipeInV = 0;
            if (mm_inlet_dia > 10)
            {
                rPipeInV = OtherPressCoeff * pump_flow / mm_inlet_dia / mm_inlet_dia;
            }
 
            double rPipeOutV = 0;
            if (mm_outlet_dia > 10)
            {
                rPipeOutV = OtherPressCoeff * pump_flow / mm_outlet_dia / mm_outlet_dia;
            }
 
 
            double rVDif = (rPipeOutV * rPipeOutV - rPipeInV * rPipeInV) / (g * 2.0);
            double total_head = Math.Round(UnitConvert_MPa2M(p2m - p1m) + rVDif, 2);
            ana_result.Ha = total_head;
            if (total_head > 800)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
            }
            else if (total_head < 1)
            {
                pump.Ana_head_ok = false;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
            }
            else
            {
                pump.Ana_head_ok = true;
            }
            #endregion
 
 
 
 
 
            ana_result.CalcUnitPower();
 
 
            pump.Ana_eta_ok = false;
 
            if (total_power > 1 && pump_flow > 1 && pump.Ana_head_ok)
            { 
                //计算效率
                double eta = Math.Round(Model.EtaSingleRealRecordPure.Calc_Eta(pump_flow, total_head, total_power, WaterDensity, g), 1);
                ana_result.Ea = eta;
 
                // 检查效率
                if (eta > 95 || eta < 40)
                {//有时, 大流量曲线部分,是曲线不精确, 造成Q H曲线不符合实际, 造成效率计算出问题 
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ea, eta.ToString());
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                }
                else
                {//计算 
                    ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
 
                    pump.Ana_eta_ok = true;
                }
            }
            pump.AnaResult = ana_result;
            return true;
        }
 
 
        /// <summary>
        /// 无流量计分析
        /// </summary>
        /// <param name="averge_flow"></param> 
        /// <param name="pump"></param>
        /// <returns></returns>
        protected bool Analy_无单泵流量计_运行状态已分析_变频泵(
            double averge_flow,//平均流量(用于预算) 
            ref IStation.Calculation.Eta.Model.PumpAnaResult pump)
        {
            if (pump == null)
                return false;
            var ana_result = pump.AnaResult;
            if (ana_result == null)
                ana_result = new IStation.Model.EtaSingleRealRecordPure();
 
            pump.Ana_flow_ok = false;
            pump.Ana_head_ok = false;
            pump.Ana_eta_ok = false;
 
            long monitor_id_进口压力 = pump.MonitorID_InletPress;
            long monitor_id_出口压力 = pump.MonitorID_OutletPress;
            long monitor_id_瞬时功率 = pump.MonitorID_MotorPower;
 
            Model.EtaMonitorPointAnalyContextitem monitor_record_进口压力 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_进口压力);
            Model.EtaMonitorPointAnalyContextitem monitor_record_出口压力 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_出口压力);
            Model.EtaMonitorPointAnalyContextitem monitor_record_瞬时功率 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_瞬时功率);
 
 
            #region  功率
            double total_power = 0;
            if (monitor_record_瞬时功率 == null)
            {
                pump.Ana_power_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, null);
            }
            else
            {
                total_power = monitor_record_瞬时功率.DataValue;
                if (total_power < 1)
                {
                    pump.Ana_power_ok = false;
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, total_power.ToString());
                }
                else
                {
                    pump.Ana_power_ok = true;
                }
                ana_result.Pa = total_power;
            }
            #endregion
 
 
            #region  进口压力 
            if (monitor_record_进口压力 == null)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P1, null);
                return false;
            }
            double p1m = monitor_record_进口压力.DataValue;
            if (monitor_record_进口压力.Elevation != null)
            {//判断是否有标高
                p1m += UnitConvert_M2MPa(monitor_record_进口压力.Elevation.Value);
            }
            if (pump.Is液位代替进口压力)
            {//液位一般都是m
                p1m = UnitConvert_M2MPa(p1m);
            }
 
            double mm_inlet_dia = 0;//用 mm
            if (monitor_record_进口压力.PipeDia.HasValue)
            {
                mm_inlet_dia = monitor_record_进口压力.PipeDia.Value;
            }
            #endregion
 
 
            #region  出口压力 
            if (monitor_record_出口压力 == null)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P2, null);
                return false;
            }
            double p2m = monitor_record_出口压力.DataValue;
            if (monitor_record_出口压力.Elevation != null)
            {//判断是否有标高
                p2m += UnitConvert_M2MPa(monitor_record_出口压力.Elevation.Value);
            }
 
            double mm_outlet_dia = 0;//用 mm
            if (monitor_record_出口压力.PipeDia.HasValue)
            {
                mm_outlet_dia = monitor_record_出口压力.PipeDia.Value;
            }
 
            #endregion
 
 
            #region 计算扬程
            double OtherPressCoeff = 4 * 1000 / Math.PI / 3.6;
            double rPipeInV = 0;
            if (mm_inlet_dia > 10)
            {
                rPipeInV = OtherPressCoeff * averge_flow / mm_inlet_dia / mm_inlet_dia;
            }
 
            double rPipeOutV = 0;
            if (mm_outlet_dia > 10)
            {
                rPipeOutV = OtherPressCoeff * averge_flow / mm_outlet_dia / mm_outlet_dia;
            }
 
 
            double rVDif = (rPipeOutV * rPipeOutV - rPipeInV * rPipeInV) / (g * 2.0);
            double total_head = Math.Round(UnitConvert_MPa2M(p2m - p1m) + rVDif, 2);
            ana_result.Ha = total_head;
 
            //检查扬程
            if (total_head > 800)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
            }
            else if (total_head < 1)
            {
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                pump.Ana_head_ok = false;
            }
            else
            {
                pump.Ana_head_ok = true;
            }
 
            #endregion
 
 
 
            #region 根据曲线计算流量
            pump.Ana_flow_ok = false;
            if (pump.Ana_head_ok)
            {
                var machine = pump.Context;
                if (machine == null || machine.CurveQH == null)
                {
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Curve, null);
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    return false;
                }
                if (ana_result.HZa <= 1)
                {
                    return false;
                }
                ////根据曲线计算
                var wrk_pt = GetFolwByPress(machine.CurveQH, mm_inlet_dia, p1m, mm_outlet_dia, p2m, ana_result.HZa);
                if (wrk_pt == null)
                {  //如果无法分析,就简单用进出口压差表示扬程
                    var h = Math.Round(UnitConvert_MPa2M(p2m - p1m), 2);
                    ana_result.Ha = h;
                    pump.Ana_flow_ok = false;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Curve, h.ToString("N2"));
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    return false;
                }
                pump.Ana_flow_ok = true;
                double qa = Math.Round(wrk_pt.X, 1);
                ana_result.Qa = qa;
            }
 
 
            #endregion
 
 
 
 
 
            ana_result.CalcUnitPower();
 
            pump.Ana_eta_ok = false;
 
            if (total_power > 1 && pump.Ana_flow_ok && pump.Ana_head_ok && pump.Ana_power_ok)
            { 
                //计算效率
                double eta = Math.Round(Model.EtaSingleRealRecordPure.Calc_Eta(averge_flow, total_head, total_power, WaterDensity, g), 1);
                ana_result.Ea = eta;
 
                // 检查效率
                if (eta > 95 || eta < 40)
                {//有时, 大流量曲线部分,是曲线不精确, 造成Q H曲线不符合实际, 造成效率计算出问题 
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ea, eta.ToString());
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                }
                else
                {//计算 
                    if (ana_result.AnalyStatus == Model.Eta.eAnalyStatus.Unkonw)
                        ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
 
                    pump.Ana_eta_ok = true;
                }
            }
 
 
            return true;
        }
 
        /// <summary>
        /// 无流量计分析
        /// </summary>
        /// <param name="averge_flow"></param> 
        /// <param name="pump"></param>
        /// <returns></returns>
        protected bool Analy_无单泵流量计_运行状态已分析_工频泵(
            double averge_flow,//平均流量(用于预算) 
            ref IStation.Calculation.Eta.Model.PumpAnaResult pump)
        {
            if (pump == null)
                return false;
            var ana_result = pump.AnaResult;
            if (ana_result == null)
                ana_result = new IStation.Model.EtaSingleRealRecordPure();
 
            pump.Ana_flow_ok = false;
            pump.Ana_head_ok = false;
            pump.Ana_eta_ok = false;
 
            long monitor_id_进口压力 = pump.MonitorID_InletPress;
            long monitor_id_出口压力 = pump.MonitorID_OutletPress;
            long monitor_id_瞬时功率 = pump.MonitorID_MotorPower;
 
            Model.EtaMonitorPointAnalyContextitem monitor_record_进口压力 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_进口压力);
            Model.EtaMonitorPointAnalyContextitem monitor_record_出口压力 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_出口压力);
            Model.EtaMonitorPointAnalyContextitem monitor_record_瞬时功率 = this._allMonitorList.Find(x => x.ObjectID == monitor_id_瞬时功率);
 
 
 
            #region  功率
            double total_power = 0;
            if (monitor_record_瞬时功率 == null)
            {
                pump.Ana_power_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, null);
            }
            else
            {
                total_power = monitor_record_瞬时功率.DataValue;
                if (total_power < 1)
                {
                    pump.Ana_power_ok = false;
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Pa, total_power.ToString());
                }
                else
                {
                    pump.Ana_power_ok = true;
                }
                ana_result.Pa = total_power;
            }
            #endregion
 
 
            #region  进口压力 
            if (monitor_record_进口压力 == null)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P1, null);
                return false;
            }
            double p1m = monitor_record_进口压力.DataValue;
            if (monitor_record_进口压力.Elevation != null)
            {//判断是否有标高
                p1m += UnitConvert_M2MPa(monitor_record_进口压力.Elevation.Value);
            }
            if (pump.Is液位代替进口压力)
            {//液位一般都是m
                p1m = UnitConvert_M2MPa(p1m);
            }
            double mm_inlet_dia = 0;//用 mm
            if (monitor_record_进口压力.PipeDia.HasValue)
            {
                mm_inlet_dia = monitor_record_进口压力.PipeDia.Value;
            }
            #endregion
 
 
            #region  出口压力 
            if (monitor_record_出口压力 == null)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Missing;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_P2, null);
                return false;
            }
            double p2m = monitor_record_出口压力.DataValue;
            if (monitor_record_出口压力.Elevation != null)
            {//判断是否有标高
                p2m += UnitConvert_M2MPa(monitor_record_出口压力.Elevation.Value);
            }
 
            double mm_outlet_dia = 0;//用 mm
            if (monitor_record_出口压力.PipeDia.HasValue)
            {
                mm_outlet_dia = monitor_record_出口压力.PipeDia.Value;
            }
 
            #endregion
 
 
            #region 计算扬程
            double OtherPressCoeff = 4 * 1000 / Math.PI / 3.6;
            double rPipeInV = 0;
            if (mm_inlet_dia > 10)
            {
                rPipeInV = OtherPressCoeff * averge_flow / mm_inlet_dia / mm_inlet_dia;
            }
 
            double rPipeOutV = 0;
            if (mm_outlet_dia > 10)
            {
                rPipeOutV = OtherPressCoeff * averge_flow / mm_outlet_dia / mm_outlet_dia;
            }
 
 
            double rVDif = (rPipeOutV * rPipeOutV - rPipeInV * rPipeInV) / (g * 2.0);
            double total_head = Math.Round(UnitConvert_MPa2M(p2m - p1m) + rVDif, 2);
            ana_result.Ha = total_head;
 
            //检查扬程
            if (total_head > 800)
            {
                pump.Ana_head_ok = false;
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
            }
            else if (total_head < 1)
            {
                pump.Ana_head_ok = false;
                ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ha, total_head.ToString());
                ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                return false;
            }
            else
            {
                pump.Ana_head_ok = true;
            }
 
 
            #endregion
 
 
 
            #region 根据曲线计算流量
            pump.Ana_flow_ok = false;
            if (pump.Ana_head_ok)
            {
                var machine = pump.Context;
                if (machine == null || machine.CurveQH == null)
                {
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Curve, null);
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    return false;
                }
 
                ////根据曲线计算
                var wrk_pt = GetFolwByPress(machine.CurveQH, mm_inlet_dia, p1m, mm_outlet_dia, p2m, 50);
                if (wrk_pt == null)
                {  //如果无法分析,就简单用进出口压差表示扬程
                    var h = Math.Round(UnitConvert_MPa2M(p2m - p1m), 2);
                    ana_result.Ha = h;
                    pump.Ana_flow_ok = false;
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Curve, h.ToString("N2"));
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                    return false;
                }
                pump.Ana_flow_ok = true;
                double qa = Math.Round(wrk_pt.X, 1);
                ana_result.Qa = qa;
            }
 
 
            #endregion
 
 
 
 
            ana_result.CalcUnitPower();
 
            pump.Ana_eta_ok = false;
 
            if (total_power > 1 && pump.Ana_flow_ok && pump.Ana_head_ok && pump.Ana_power_ok)
            { 
 
                //计算效率
                double eta = Math.Round(Model.EtaSingleRealRecordPure.Calc_Eta(averge_flow, total_head, total_power, WaterDensity, g), 1);
                ana_result.Ea = eta;
 
                // 检查效率
                if (eta > 95 || eta < 40)
                {//有时, 大流量曲线部分,是曲线不精确, 造成Q H曲线不符合实际, 造成效率计算出问题 
                    ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ea, eta.ToString());
                    ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                }
                else
                {//计算 
                    if (ana_result.AnalyStatus == Model.Eta.eAnalyStatus.Unkonw)
                        ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
 
                    pump.Ana_eta_ok = true;
                }
            }
 
 
            return true;
        }
 
        #endregion
 
        #region 多泵运行
        /// <summary>
        /// 多泵运行(注意不要有子节点的管路了,下面都是泵才行):返回的只有开机的Result
        /// </summary>
        /// <param name="monitor_value_total_flow"></param>
        /// <param name="all_pump_result_list"></param>
        /// <returns></returns>
        protected bool Analy_多泵并联运行_单管出口(
            double monitor_value_total_flow,
            List<IStation.Calculation.Eta.Model.PumpAnaResult> all_pump_result_list)
        {
            //获取所有开机的
            List<IStation.Calculation.Eta.Model.PumpAnaResult> open_pump_result_list = new List<IStation.Calculation.Eta.Model.PumpAnaResult>();
            for (int i = 0; i < all_pump_result_list.Count(); i++)
            {
                if (all_pump_result_list[i].IsRunIng)
                {
                    open_pump_result_list.Add(all_pump_result_list[i]);
                }
            }
 
            int open_pump_count = open_pump_result_list.Count;
            if (open_pump_count == 0)
            {
                return true;
            }
 
            bool isAllOk_flow = true;
            double ana_total_flow = 0;//分析的总流量
            //获取所有开机的
            for (int i = 0; i < open_pump_count; i++)
            {
                var pump_context = open_pump_result_list[i];
 
                if (pump_context.IsFrequency)
                {
                    Analy_无单泵流量计_运行状态已分析_变频泵(
    monitor_value_total_flow / open_pump_count,
    ref pump_context);
                }
                else
                {
                    Analy_无单泵流量计_运行状态已分析_工频泵(
    monitor_value_total_flow / open_pump_count,
    ref pump_context);
                }
 
                if (!pump_context.Ana_flow_ok)
                    isAllOk_flow = false;
                if (!pump_context.Ana_head_ok)
                    isAllOk_flow = false;
 
                if (pump_context.AnaResult.Qa == null)
                {
                    isAllOk_flow = false;
                }
                else
                {
                    ana_total_flow += pump_context.AnaResult.Qa.Value;
                }
            }
 
            #region 按总流量进行等比分
            if (isAllOk_flow)
            {
                for (int i = 0; i < open_pump_count; i++)
                {
                    var ana_result = open_pump_result_list[i].AnaResult;
 
                    ana_result.Qa = Math.Round(ana_result.Qa.Value * monitor_value_total_flow / ana_total_flow, 1);
                    ana_result.UWPa = 0;
                    ana_result.WPa = 0;
                    if (ana_result.Pa != null && ana_result.Pa > 1)
                    {
                        double eta = Math.Round(Model.EtaSingleRealRecordPure.Calc_Eta(ana_result.Qa.Value, ana_result.Ha.Value, ana_result.Pa.Value, WaterDensity, g), 1);
                        ana_result.Ea = eta;
 
                        // 检查效率
                        if (eta > 95 || eta < 40)
                        {//有时, 大流量曲线部分,是曲线不精确, 造成Q H曲线不符合实际, 造成效率计算出问题 
                            ana_result.PutAnalyInfo(IStation.Model.EtaSingleRealRecordPure.InfoTag_Ea, eta.ToString());
                            ana_result.AnalyStatus = IStation.Model.Eta.eAnalyStatus.Abnormal;
                        }
                        else
                        {//计算 
                            if (ana_result.AnalyStatus == Model.Eta.eAnalyStatus.Unkonw)
                                ana_result.AnalyStatus = Model.Eta.eAnalyStatus.Normal;
                            ana_result.CalcUnitPower(); 
                        }
                    }
                }
            }
 
            #endregion
 
            return true;
        }
 
 
        #endregion
    }
}