Shuxia Ning
2024-07-17 fd681339c81201ed6fb3303647ecab89e3e6c0c1
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
namespace IStation
{
    /// <summary>
    /// 全局辅助类
    /// </summary>
    public class GlobalHelper
    {
 
        #region 默认配置
 
        #region 泵标志
 
        #region 一输
 
        public readonly static int Flag11 = 11;
        public readonly static int Flag12 = 12;
        public readonly static int Flag13 = 13;
        public readonly static int Flag14 = 14;
        public readonly static int Flag15 = 15;
        public readonly static int Flag16 = 16;
        public readonly static int Flag17 = 17;
        public readonly static int Flag18 = 18;
 
        public readonly static List<int> Station1FlagList = new List<int>() { Flag11, Flag12, Flag13, Flag14, Flag15, Flag16, Flag17, Flag18 };
        public readonly static List<int> Station1SameTypeFlagGroupFirst = new List<int>() { Flag11, Flag12, Flag13, Flag14, Flag16, Flag17, Flag18 };
        public readonly static List<int> Station1SameTypeFlagGroupSecond = new List<int>() { Flag15 };
 
        #endregion
 
        #region 二输
 
        public readonly static int Flag21 = 21;
        public readonly static int Flag22 = 22;
        public readonly static int Flag23 = 23;
        public readonly static int Flag24 = 24;
        public readonly static int Flag25 = 25;
        public readonly static int Flag26 = 26;
        public readonly static int Flag27 = 27;
 
        public readonly static List<int> Station2FlagList = new List<int>() { Flag21, Flag22, Flag23, Flag24, Flag25, Flag26, Flag27 };
        public readonly static List<int> Station2SameTypeFlagGroupFirst = new List<int>() { Flag22, Flag23, Flag24, Flag25, Flag26 };
        public readonly static List<int> Station2SameTypeFlagGroupSecond = new List<int>() { Flag21, Flag27 };
 
        #endregion 
 
        /// <summary>
        /// 是否变频
        /// </summary>
        /// <param name="flag"></param>
        /// <returns></returns>
        public static bool IsFrequency(int flag)
        {
            if (flag == Flag15 || flag == Flag16)
            {
                return false;
            }
            return true;
        }
 
        #endregion
 
        #region 众毅Scada对接标签
 
        #region 二取 
        public readonly static string 长江水位 = "10001";
        public readonly static string 二取前池液位 = "10002";
        public readonly static string 陈行水库水位 = "10003";
 
        public readonly static string 二取1泵_有功功率 = "10090";
        public readonly static string 二取2泵_有功功率 = "10091";
        public readonly static string 二取3泵_有功功率 = "10092";
        public readonly static string 二取4泵_有功功率 = "10093";
        public readonly static string 二取5泵_有功功率 = "10094";
 
        public readonly static string 二取1泵_出口压力 = "10014";
        public readonly static string 二取2泵_出口压力 = "10015";
        public readonly static string 二取3泵_出口压力 = "10016";
        public readonly static string 二取4泵_出口压力 = "10017";
        public readonly static string 二取5泵_出口压力 = "10018";
 
        public readonly static string 二取1泵_水泵_运行状态 = "10072";
        public readonly static string 二取2泵_水泵_运行状态 = "10073";
        public readonly static string 二取3泵_水泵_运行状态 = "10074";
        public readonly static string 二取4泵_水泵_运行状态 = "10075";
        public readonly static string 二取5泵_水泵_运行状态 = "10076";
 
        public readonly static string 二取1泵_有功电能 = "10109";
        public readonly static string 二取2泵_有功电能 = "10110";
        public readonly static string 二取3泵_有功电能 = "10111";
        public readonly static string 二取4泵_有功电能 = "10112";
        public readonly static string 二取5泵_有功电能 = "10113";
 
        public readonly static string 二取1泵_累计流量 = "10054";
        public readonly static string 二取2泵_累计流量 = "10055";
        public readonly static string 二取3泵_累计流量 = "10056";
        public readonly static string 二取4泵_累计流量 = "10057";
        public readonly static string 二取5泵_累计流量 = "10058";
 
        public readonly static string 二取1泵_瞬时流量 = "10034";
        public readonly static string 二取2泵_瞬时流量 = "10035";
        public readonly static string 二取3泵_瞬时流量 = "10036";
        public readonly static string 二取4泵_瞬时流量 = "10037";
        public readonly static string 二取5泵_瞬时流量 = "10038";
 
        public readonly static string 二取1泵_累计运行时间 = "10167";
        public readonly static string 二取2泵_累计运行时间 = "10168";
        public readonly static string 二取3泵_累计运行时间 = "10169";
        public readonly static string 二取4泵_累计运行时间 = "10170";
        public readonly static string 二取5泵_累计运行时间 = "10171";
 
 
        #endregion
 
        #region 一输
 
        public readonly static string 嘉定1线_瞬时流量 = "10138";
        public readonly static string 嘉定2线_瞬时流量 = "10139";
        public readonly static string 嘉定3线_瞬时流量 = "10140";
 
 
        public readonly static string 嘉定1线_瞬时流量_长江管网图 = "10159";
        public readonly static string 嘉定2线_瞬时流量_长江管网图 = "10160";
        public readonly static string 嘉定3线_瞬时流量_长江管网图 = "10161";
 
 
        public readonly static string 嘉定1线_表头累计 = "10143";
        public readonly static string 嘉定2线_表头累计 = "10144";
        public readonly static string 嘉定3线_表头累计 = "10145";
 
 
        public readonly static string 嘉定1线_累计流量_长江管网图 = "10164";
        public readonly static string 嘉定2线_累计流量_长江管网图 = "10165";
        public readonly static string 嘉定3线_累计流量_长江管网图 = "10166";
 
 
        public readonly static string 嘉定1线_压力 = "10128";
        public readonly static string 嘉定2线_压力 = "10129";
        public readonly static string 嘉定3线_压力 = "10130";
 
 
        public readonly static string 嘉定1线_压力_长江管网图 = "10154";
        public readonly static string 嘉定2线_压力_长江管网图 = "10155";
        public readonly static string 嘉定3线_压力_长江管网图 = "10156";
 
 
        public readonly static string 一输_老前池南侧液位 = "10011";
        public readonly static string 一输_老前池北侧液位 = "10012";
        public readonly static string 一输_新前池液位 = "10013";
 
 
        public readonly static string 一输11泵_出口压力 = "10026";
        public readonly static string 一输12泵_出口压力 = "10027";
        public readonly static string 一输13泵_出口压力 = "10028";
        public readonly static string 一输14泵_出口压力 = "10029";
        public readonly static string 一输15泵_出口压力 = "10030";
        public readonly static string 一输16泵_出口压力 = "10031";
        public readonly static string 一输17泵_出口压力 = "10032";
        public readonly static string 一输18泵_出口压力 = "10033";
 
 
        public readonly static string 一输11泵_转速 = "10084";
        public readonly static string 一输12泵_转速 = "10085";
        public readonly static string 一输13泵_转速 = "10086";
        public readonly static string 一输14泵_转速 = "10087";
        public readonly static string 一输17泵_转速 = "10088";
        public readonly static string 一输18泵_转速 = "10089";
 
        public readonly static string 一输11泵_频率 = "10066";
        public readonly static string 一输12泵_频率 = "10067";
        public readonly static string 一输13泵_频率 = "10068";
        public readonly static string 一输14泵_频率 = "10069";
        public readonly static string 一输17泵_频率 = "10070";
        public readonly static string 一输18泵_频率 = "10071";
 
 
        public readonly static string 一输11泵_运行状态 = "10046";
        public readonly static string 一输12泵_运行状态 = "10047"; //  10150 is null
        public readonly static string 一输13泵_运行状态 = "10048";
        public readonly static string 一输14泵_运行状态 = "10049";
        public readonly static string 一输15泵_运行状态 = "10050";
        public readonly static string 一输16泵_运行状态 = "10051";
        public readonly static string 一输17泵_运行状态 = "10052";
        public readonly static string 一输18泵_运行状态 = "10053";
 
        public readonly static string 一输11泵_运行时间 = "10172";
        public readonly static string 一输12泵_运行时间 = "10173";
        public readonly static string 一输13泵_运行时间 = "10174";
        public readonly static string 一输14泵_运行时间 = "10175";
 
        public readonly static string 一输11泵_累计运行时间 = "10187";
        public readonly static string 一输12泵_累计运行时间 = "10188";
        public readonly static string 一输13泵_累计运行时间 = "10189";
        public readonly static string 一输14泵_累计运行时间 = "10190";
        public readonly static string 一输15泵_累计运行时间 = "10176";
        public readonly static string 一输16泵_累计运行时间 = "10177";
        public readonly static string 一输17泵_累计运行时间 = "10178";
        public readonly static string 一输18泵_累计运行时间 = "10179";
 
        public readonly static string 一输11泵_有功功率 = "10101";
        public readonly static string 一输12泵_有功功率 = "10102";
        public readonly static string 一输13泵_有功功率 = "10103";
        public readonly static string 一输14泵_有功功率 = "10104";
        public readonly static string 一输15泵_有功功率 = "10105";
        public readonly static string 一输16泵_有功功率 = "10106";
        public readonly static string 一输17泵_有功功率 = "10107";
        public readonly static string 一输18泵_有功功率 = "10108";
 
 
 
        #endregion
 
        #region 二输
 
        public readonly static string DN2400_出厂压力 = "10141";
        public readonly static string DN2700_出厂压力 = "10142";
 
        public readonly static string DN2400_出厂压力_长江管网图 = "10152";
        public readonly static string DN2700_出厂压力_长江管网图 = "10153";
 
        public readonly static string DN2400总管_瞬时流量 = "10146";
        public readonly static string DN2700总管_瞬时流量 = "10147";
 
        public readonly static string DN2400总管_瞬时流量_长江管网图 = "10157";
        public readonly static string DN2700总管_瞬时流量_长江管网图 = "10158";
 
        public readonly static string DN2400总管_实际累计流量 = "10148";
        public readonly static string DN2700总管_实际累计流量 = "10149";
 
        public readonly static string DN2400总管_累计流量_长江管网图 = "10162";
        public readonly static string DN2700总管_累计流量_长江管网图 = "10163";
 
 
        public readonly static string 二输21泵_泵井液位 = "10004";
        public readonly static string 二输22泵_泵井液位 = "10005";
        public readonly static string 二输23泵_泵井液位 = "10006";
        public readonly static string 二输24泵_泵井液位 = "10007";
        public readonly static string 二输25泵_泵井液位 = "10008";
        public readonly static string 二输26泵_泵井液位 = "10009";
        public readonly static string 二输27泵_泵井液位 = "10010";
 
 
        public readonly static string 二输21泵_出水压力 = "10019";
        public readonly static string 二输22泵_出水压力 = "10020";
        public readonly static string 二输23泵_出水压力 = "10021";
        public readonly static string 二输24泵_出水压力 = "10022";
        public readonly static string 二输25泵_出水压力 = "10023";
        public readonly static string 二输26泵_出水压力 = "10024";
        public readonly static string 二输27泵_出水压力 = "10025";
 
 
        public readonly static string 二输21泵_瞬时流量 = "10039";
        public readonly static string 二输22泵_瞬时流量 = "10040";
        public readonly static string 二输23泵_瞬时流量 = "10041";
        public readonly static string 二输24泵_瞬时流量 = "10042";
        public readonly static string 二输25泵_瞬时流量 = "10043";
        public readonly static string 二输26泵_瞬时流量 = "10044";
        public readonly static string 二输27泵_瞬时流量 = "10045";
 
 
        public readonly static string 二输21泵_累计流量 = "10059";
        public readonly static string 二输22泵_累计流量 = "10060";
        public readonly static string 二输23泵_累计流量 = "10061";
        public readonly static string 二输24泵_累计流量 = "10062";
        public readonly static string 二输25泵_累计流量 = "10063";
        public readonly static string 二输26泵_累计流量 = "10064";
        public readonly static string 二输27泵_累计流量 = "10065";
 
 
        public readonly static string 二输21泵_有功电能 = "10131";
        public readonly static string 二输22泵_有功电能 = "10132";
        public readonly static string 二输23泵_有功电能 = "10133";
        public readonly static string 二输24泵_有功电能 = "10134";
        public readonly static string 二输25泵_有功电能 = "10135";
        public readonly static string 二输26泵_有功电能 = "10136";
        public readonly static string 二输27泵_有功电能 = "10137";
 
 
        public readonly static string 二输22泵_频率 = "10095";
        public readonly static string 二输23泵_频率 = "10096";
        public readonly static string 二输24泵_频率 = "10097";
        public readonly static string 二输25泵_频率 = "10098";
        public readonly static string 二输26泵_频率 = "10099";
        public readonly static string 二输27泵_频率 = "10100";
 
 
        public readonly static string 二输21泵_转速 = "10114";
        public readonly static string 二输22泵_转速 = "10115";
        public readonly static string 二输23泵_转速 = "10116";
        public readonly static string 二输24泵_转速 = "10117";
        public readonly static string 二输25泵_转速 = "10118";
        public readonly static string 二输26泵_转速 = "10119";
        public readonly static string 二输27泵_转速 = "10120";
 
 
        public readonly static string 二输21泵_有功功率 = "10121";
        public readonly static string 二输22泵_有功功率 = "10122";
        public readonly static string 二输23泵_有功功率 = "10123";
        public readonly static string 二输24泵_有功功率 = "10124";
        public readonly static string 二输25泵_有功功率 = "10125";
        public readonly static string 二输26泵_有功功率 = "10126"; // "10151"; is null
        public readonly static string 二输27泵_有功功率 = "10127";
 
 
        public readonly static string 二输21泵_运行状态 = "10077";
        public readonly static string 二输22泵_运行状态 = "10078";
        public readonly static string 二输23泵_运行状态 = "10079";
        public readonly static string 二输24泵_运行状态 = "10080";
        public readonly static string 二输25泵_运行状态 = "10081";
        public readonly static string 二输26泵_运行状态 = "10082";
        public readonly static string 二输27泵_运行状态 = "10083";
 
 
        public readonly static string 二输21泵_运行时间 = "10180";
        public readonly static string 二输22泵_运行时间 = "10181";
        public readonly static string 二输23泵_运行时间 = "10182";
        public readonly static string 二输24泵_运行时间 = "10183";
        public readonly static string 二输25泵_运行时间 = "10184";
        public readonly static string 二输26泵_运行时间 = "10185";
        public readonly static string 二输27泵_运行时间 = "10186";
 
        #endregion
 
        #endregion
 
        #region 泵标志 和 众毅Scada对接标签 映射
 
 
        /// <summary>
        /// 泵标志运行状态映射字典 1输水 
        /// </summary>
        public readonly static Dictionary<int, string> FlagRunStatusMappingDict1 = new() {
            {Flag11, 一输11泵_运行状态},
            {Flag12, 一输12泵_运行状态},
            {Flag13, 一输13泵_运行状态},
            {Flag14, 一输14泵_运行状态},
            {Flag15, 一输15泵_运行状态},
            {Flag16, 一输16泵_运行状态},
            {Flag17, 一输17泵_运行状态},
            {Flag18, 一输18泵_运行状态}
        };
 
        /// <summary>
        /// 泵标志运行状态映射字典 2输水 
        /// </summary>
        public readonly static Dictionary<int, string> FlagRunStatusMappingDict2 = new() {
            {Flag21, 二输21泵_运行状态},
            {Flag22, 二输22泵_运行状态},
            {Flag23, 二输23泵_运行状态},
            {Flag24, 二输24泵_运行状态},
            {Flag25, 二输25泵_运行状态},
            {Flag26, 二输26泵_运行状态},
            {Flag27, 二输27泵_运行状态}
        };
 
        /// <summary>
        /// 泵标志进口水位映射字典 1输水
        /// </summary>
        public readonly static Dictionary<int, string> FlagInletWaterLevelMappingDict1 = new() {
            {Flag11, 一输_老前池南侧液位},
            {Flag12, 一输_老前池南侧液位},
            {Flag13, 一输_老前池南侧液位},
            {Flag14, 一输_老前池北侧液位},
            {Flag15, 一输_老前池北侧液位},
            {Flag16, 一输_新前池液位},
            {Flag17, 一输_新前池液位},
            {Flag18, 一输_新前池液位}
        };
 
 
        /// <summary>
        /// 泵标志进口水位映射字典 2输水
        /// </summary>
        public readonly static Dictionary<int, string> FlagInletWaterLevelMappingDict2 = new() {
            {Flag21, 二输21泵_泵井液位},
            {Flag22, 二输22泵_泵井液位},
            {Flag23, 二输23泵_泵井液位},
            {Flag24, 二输24泵_泵井液位},
            {Flag25, 二输25泵_泵井液位},
            {Flag26, 二输26泵_泵井液位},
            {Flag27, 二输27泵_泵井液位}
        };
 
 
 
        /// <summary>
        /// 泵标志转速映射字典 1输水
        /// </summary>
        public readonly static Dictionary<int, string> FlagNrMappingDict1 = new() {
            {Flag11, 一输11泵_转速},
            {Flag12, 一输12泵_转速},
            {Flag13, 一输13泵_转速},
            {Flag14, 一输14泵_转速},
            {Flag15, 一输15泵_运行状态},
            {Flag16, 一输16泵_运行状态},
            {Flag17, 一输17泵_转速},
            {Flag18, 一输18泵_转速}
        };
 
 
        /// <summary>
        /// 泵标志转速映射字典 2输水
        /// </summary>
        public readonly static Dictionary<int, string> FlagNrMappingDict2 = new() {
            {Flag21, 二输21泵_转速},
            {Flag22, 二输22泵_转速},
            {Flag23, 二输23泵_转速},
            {Flag24, 二输24泵_转速},
            {Flag25, 二输25泵_转速},
            {Flag26, 二输26泵_转速},
            {Flag27, 二输27泵_转速}
        };
 
        #endregion
 
        #region 模型映射
 
        /// <summary>
        /// 模型流量点映射字典
        /// </summary>
        public readonly static Dictionary<string, string> ModelFlowIdMappingDict = new(){
            { "Pjd1", 嘉定1线_瞬时流量_长江管网图},
            { "Pjd2", 嘉定2线_瞬时流量_长江管网图},
            { "Pjd3", 嘉定3线_瞬时流量_长江管网图},
            { "Pdn2400", DN2400总管_瞬时流量_长江管网图},
            { "Pdn2700", DN2700总管_瞬时流量_长江管网图},
            { "Ppump21", 二输21泵_瞬时流量},
            { "Ppump22", 二输22泵_瞬时流量},
            { "Ppump23", 二输23泵_瞬时流量},
            { "Ppump24", 二输24泵_瞬时流量},
            { "Ppump25", 二输25泵_瞬时流量},
            { "Ppump26", 二输26泵_瞬时流量},
            { "Ppump27", 二输27泵_瞬时流量}
        };
 
        /// <summary>
        /// 模型压力点映射字典
        /// </summary>
        public readonly static Dictionary<string, string> ModelPressureIdMappingDict = new() {
            { "Jjd1", 嘉定1线_压力_长江管网图},
            { "Jjd2", 嘉定2线_压力_长江管网图},
            { "Jjd3", 嘉定3线_压力_长江管网图},
            { "Jpump11", 一输11泵_出口压力},
            { "Jpump12", 一输12泵_出口压力},
            { "Jpump13", 一输13泵_出口压力},
            { "Jpump14", 一输14泵_出口压力},
            { "Jpump15", 一输15泵_出口压力},
            { "Jpump16", 一输16泵_出口压力},
            { "Jpump17", 一输17泵_出口压力},
            { "Jpump18", 一输18泵_出口压力},
            { "Jdn2400", DN2400_出厂压力_长江管网图},
            { "Jdn2700", DN2700_出厂压力_长江管网图},
            { "Jpump21", 二输21泵_出水压力},
            { "Jpump22", 二输22泵_出水压力},
            { "Jpump23", 二输23泵_出水压力},
            { "Jpump24", 二输24泵_出水压力},
            { "Jpump25", 二输25泵_出水压力},
            { "Jpump26", 二输26泵_出水压力},
            { "Jpump27", 二输27泵_出水压力}
        };
 
        /// <summary>
        /// 模型模式点映射字典
        /// </summary>
        public readonly static Dictionary<string, string> ModelPatternIdMappingDict = new() {
            {"Pump11", 一输11泵_转速},
            {"Pump12", 一输12泵_转速},
            {"Pump13", 一输13泵_转速},
            {"Pump14", 一输14泵_转速},
            {"Pump15", 一输15泵_运行状态},
            {"Pump16", 一输16泵_运行状态},
            {"Pump17", 一输17泵_转速},
            {"Pump18", 一输18泵_转速},
            {"R3", 一输_老前池南侧液位},
            {"R2", 一输_老前池北侧液位 },
            {"R1", 一输_新前池液位},
            {"SFJD1", 嘉定1线_瞬时流量_长江管网图},
            {"SFJD2", 嘉定2线_瞬时流量_长江管网图},
            {"SFJD3", 嘉定3线_瞬时流量_长江管网图},
            {"RPump21", 二输21泵_泵井液位},
            {"RPump22", 二输22泵_泵井液位},
            {"RPump23", 二输23泵_泵井液位},
            {"RPump24", 二输24泵_泵井液位},
            {"RPump25", 二输25泵_泵井液位},
            {"RPump26", 二输26泵_泵井液位},
            {"RPump27", 二输27泵_泵井液位},
            {"SFPump21", 二输21泵_瞬时流量},
            {"SFPump22", 二输22泵_瞬时流量},
            {"SFPump23", 二输23泵_瞬时流量},
            {"SFPump24", 二输24泵_瞬时流量},
            {"SFPump25", 二输25泵_瞬时流量},
            {"SFPump26", 二输26泵_瞬时流量},
            {"SFPump27", 二输27泵_瞬时流量},
            {"Pump21", 二输21泵_转速},
            {"Pump22", 二输22泵_转速},
            {"Pump23", 二输23泵_转速},
            {"Pump24", 二输24泵_转速},
            {"Pump25", 二输25泵_转速},
            {"Pump26", 二输26泵_转速},
            {"Pump27", 二输27泵_转速},
            {"SFDN2400", DN2400总管_瞬时流量_长江管网图},
            {"SFDN2700", DN2700总管_瞬时流量_长江管网图}
        };
 
        /// <summary>
        /// 模型压力点(kPa)列表
        /// </summary>
        public readonly static List<string> ModelPressureIdkPaList = new()
        {
            嘉定1线_压力,
            嘉定2线_压力,
            嘉定3线_压力,
            嘉定1线_压力_长江管网图,
            嘉定2线_压力_长江管网图,
            嘉定3线_压力_长江管网图,
            一输11泵_出口压力,
            一输12泵_出口压力,
            一输13泵_出口压力,
            一输14泵_出口压力,
            一输15泵_出口压力,
            一输16泵_出口压力,
            一输17泵_出口压力,
            一输18泵_出口压力
        };
 
        /// <summary>
        /// 模型泵转速字典
        /// </summary>
        public static readonly Dictionary<string, double> ModelPumpNrDict = new() {
            { "Pump11",590},
            { "Pump12",590},
            { "Pump13",590},
            { "Pump14",590},
            { "Pump17",590},
            { "Pump18",590},
            { "Pump21",740},
            { "Pump22",495},
            { "Pump23",495},
            { "Pump24",495},
            { "Pump25",495},
            { "Pump26",495},
            { "Pump27",740}
        };
 
        /// <summary>
        /// 模型泵标识映射字典
        /// </summary>
        public static readonly Dictionary<int, string> ModelPumpIdMappingDict = new() {
            { Flag11,"Pump11"},
            { Flag12,"Pump12"},
            { Flag13,"Pump13"},
            { Flag14,"Pump14"},
            { Flag15,"Pump15"},
            { Flag16,"Pump16"},
            { Flag17,"Pump17"},
            { Flag18,"Pump18"},
 
            { Flag21,"Pump21"},
            { Flag22,"Pump22"},
            { Flag23,"Pump23"},
            { Flag24,"Pump24"},
            { Flag25,"Pump25"},
            { Flag26,"Pump26"},
            { Flag27,"Pump27"}
        };
 
        #endregion
 
        #endregion
 
        #region 获取 配置字典
 
        /// <summary>
        /// 获取 泵标志运行状态映射字典
        /// </summary>
        public static Dictionary<int, string> GetFlagRunStatusMappingDict()
        {
            var flag_run_status_mapping_dict = new Dictionary<int, string>();
            foreach (var item in FlagRunStatusMappingDict1)
            {
                flag_run_status_mapping_dict.Add(item.Key, item.Value);
            }
            foreach (var item in FlagRunStatusMappingDict2)
            {
                flag_run_status_mapping_dict.Add(item.Key, item.Value);
            }
 
            return flag_run_status_mapping_dict;
        }
 
        /// <summary>
        /// 获取 泵标志转速映射字典
        /// </summary>
        public static Dictionary<int, string> GetFlagNrMappingDict()
        {
            var flag_nr_mapping_dict = new Dictionary<int, string>();
            foreach (var item in FlagNrMappingDict1)
            {
                flag_nr_mapping_dict.Add(item.Key, item.Value);
            }
            foreach (var item in FlagNrMappingDict2)
            {
                flag_nr_mapping_dict.Add(item.Key, item.Value);
            }
 
            return flag_nr_mapping_dict;
        }
 
        #endregion
 
        #region 获取Scada 
 
        /// <summary>
        /// 众毅实时数据
        /// </summary>
        public class ZyRealTimeDataDto
        {
 
            /// <summary>
            /// 
            /// </summary>
            public string msg { get; set; }
 
            /// <summary>
            /// 
            /// </summary>
            public Dictionary<string, Dictionary<string, string>> data { get; set; }
 
            /// <summary>
            /// 
            /// </summary>
            public int status { get; set; }
        }
 
        /// <summary>
        /// 获取实时众毅Scada数据列表
        /// </summary>
        public static string GetRealTimeZyScadaList(out List<Model.ZyScada> zy_scada_list, bool use_debug = false)
        {
            zy_scada_list = new List<Model.ZyScada>();
            if (!Settings.ParasHelper.ZyDocking.Enable)
            {
                if (use_debug)
                {
                    var debug_zy_scada_file = Settings.ParasHelper.LocalFile.DataFolderDirectory + "\\" + "zy_scada_debug.txt";
                    if (File.Exists(debug_zy_scada_file))
                    {
                        var debug_zy_scada_json = File.ReadAllText(debug_zy_scada_file);
                        var dto = JsonHelper.Json2Object<ZyRealTimeDataDto>(debug_zy_scada_json);
                        zy_scada_list = ConvertRealTimeZyScadaList(dto?.data);
                    }
                }
                return "ZyDocking 未启用";
            }
 
            var url = Settings.ParasHelper.ZyDocking.RealTimeScadaHttpUrl;
            if (string.IsNullOrEmpty(url))
            {
                return "RealTimeScadaHttpUrl 为空";
            }
 
            try
            {
                var response_text = Yw.Untity.HttpRequestHelper.Get(url);
                var dto = JsonHelper.Json2Object<ZyRealTimeDataDto>(response_text);
                var data = dto?.data;
                if (dto.data == null || !dto.data.Any())
                {
                    return "response_text 解析失败!";
                }
                zy_scada_list = ConvertRealTimeZyScadaList(dto.data);
            }
            catch (System.Exception ex)
            {
                return ex.Message;
            }
            if (!zy_scada_list.Any())
            {
                return "zy_scada_list 无数据";
            }
 
            return string.Empty;
        }
 
 
        /// <summary>
        /// 转换实时众毅Scada数据列表
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        private static List<Model.ZyScada> ConvertRealTimeZyScadaList(Dictionary<string, Dictionary<string, string>> data)
        {
            if (data == null || !data.Any())
                return default;
            var zy_scada_list = new List<Model.ZyScada>();
            foreach (var item in data)
            {
                var zy_scada = new Model.ZyScada();
                zy_scada.Code = item.Key;
                zy_scada.Tag = item.Value["key"];
 
                if (DateTime.TryParse(item.Value["time"], out DateTime t))
                    zy_scada.Time = t;
                if (double.TryParse(item.Value["vals"], out double v))
                    zy_scada.Value = v;
 
                zy_scada_list.Add(zy_scada);
            }
            return zy_scada_list;
        }
 
        #endregion
 
        #region 获取调度算法入参
 
        /// <summary>
        /// 获取泵站运行标志列表
        /// </summary>
        /// <param name="zy_scada_list">众毅Scada列表</param>
        /// <param name="station1_open_flag_list">运行标志列表 1输水</param>
        /// <param name="station2_open_flag_list">运行标志列表 2输水</param>
        public static void GetStationOpenFlagList(List<Model.ZyScada> zy_scada_list, out List<int> station1_open_flag_list, out List<int> station2_open_flag_list)
        {
            station1_open_flag_list = new List<int>();
            station2_open_flag_list = new List<int>();
            if (zy_scada_list == null || !zy_scada_list.Any())
                return;
            foreach (var mapping in FlagRunStatusMappingDict1)
            {
                var flag = mapping.Key;
                var code = mapping.Value;
                var zy_scada = zy_scada_list.Find(x => x.Code == code);
                if (zy_scada != null && zy_scada.Value == 1)
                {
                    station1_open_flag_list.Add(flag);
                }
            }
 
            foreach (var mapping in FlagRunStatusMappingDict2)
            {
                var flag = mapping.Key;
                var code = mapping.Value;
                var zy_scada = zy_scada_list.Find(x => x.Code == code);
                if (zy_scada != null && zy_scada.Value == 1)
                {
                    station2_open_flag_list.Add(flag);
                }
            }
        }
 
 
        /// <summary>
        /// 获取泵进口水位字典
        /// </summary>
        /// <param name="zy_scada_list">众毅Scada列表</param>
        /// <param name="station1_flag_inlet_water_level_dict">泵进口水位字典 1输水</param>
        /// <param name="station2_flag_inlet_water_level_dict">泵进口水位字典 2输水</param>
        public static void GetFlagInletWaterLevelDict(List<Model.ZyScada> zy_scada_list, out Dictionary<int, double> station1_flag_inlet_water_level_dict, out Dictionary<int, double> station2_flag_inlet_water_level_dict)
        {
            station1_flag_inlet_water_level_dict = new Dictionary<int, double>();
            station2_flag_inlet_water_level_dict = new Dictionary<int, double>();
 
            foreach (var mapping in FlagInletWaterLevelMappingDict1)
            {
                var flag = mapping.Key;
                var code = mapping.Value;
                var water_level = 0d;
 
                var water_level_zy_scada = zy_scada_list?.Find(x => x.Code == code);
                if (water_level_zy_scada != null)
                {
                    water_level = water_level_zy_scada.Value ?? 0;
                }
 
                station1_flag_inlet_water_level_dict.Add(flag, water_level);
            }
 
            foreach (var mapping in FlagInletWaterLevelMappingDict2)
            {
                var flag = mapping.Key;
                var code = mapping.Value;
                var water_level = 0d;
 
                var water_level_zy_scada = zy_scada_list?.Find(x => x.Code == code);
                if (water_level_zy_scada != null)
                {
                    water_level = water_level_zy_scada.Value ?? 0;
                }
 
                station2_flag_inlet_water_level_dict.Add(flag, water_level);
            }
        }
 
        #endregion
 
    }
 
 
}