Shuxia Ning
2024-08-06 1d5b344c8be498c9989f3fe2e9846b1dcc919cb8
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
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Columns;
using IStation.Epanet;
using IStation.Epanet.Enums;
using IStation.Test.Init;
using System.Data;
using System.IO;
using System.Text;
using Yw.Untity;
 
namespace IStation.Win
{
    public partial class ModelValidView : XtraUserControl
    {
        public ModelValidView()
        {
            InitializeComponent();
 
            this.advBandedGridView1.SetNormalView();
            this.advBandedGridView1.OptionsView.ColumnAutoWidth = false;
            this.advBandedGridView1.OptionsBehavior.Editable = true;
            this.advBandedGridView1.OptionsBehavior.ReadOnly = true;
            this.gridSplitContainer1.ShowSplitView();
            foreach (GridColumn col in advBandedGridView1.Columns)
            {
                col.MinWidth = 60;
            }
 
            this.gridView1.SetNormalView();
 
            var year = 2024;
            var month = 1;
            this.dateEditStart.DateTime = new DateTime(year, month, 6);
        }
 
 
 
        private DayValue _day_value = null;
        private List<Model.HydraulicModelValidation> _hydraulic_model_validation_list = null;
        private List<Model.HydraulicModelScada> _hydraulic_model_scada_list = null;
        private List<Model.HydraulicModelRecord> _hydraulic_model_record_list = null;
 
        private List<ModelScadaValidViewModel> _model_scada_valid_vm_list = null;
        private List<ModelScheduleViewModel> _model_schedule_vm_list = null;
 
        private readonly string _hydraulic_model_file = Path.Combine(
            Settings.ParasHelper.LocalFile.DataFolderDirectory,
            Settings.ParasHelper.LocalFile.HydraulicModelFile);
 
        //加载
        private void barBtnLoad_Click(object sender, EventArgs e)
        {
            this.modelScadaValidViewModelBindingSource.DataSource = new List<ModelScadaValidViewModel>();
 
            WaitHelper.ShowWaitForm();
            var start_time = this.dateEditStart.DateTime;
            var end_time = start_time.AddDays(1).AddSeconds(-1);
 
            _day_value = DayValueHelper.GetDayValue(start_time);
            _hydraulic_model_validation_list = new IStation.Service.HydraulicModelValidation().GetByDate(start_time, end_time);
            if (_hydraulic_model_validation_list == null || !_hydraulic_model_validation_list.Any())
            {
                WaitHelper.HideWaitForm();
                XtraMessageBox.Show("_hydraulic_model_validation_list is null");
                return;
            }
 
            _hydraulic_model_scada_list = new IStation.Service.HydraulicModelScada().GetByDate(start_time, end_time);
            if (_hydraulic_model_scada_list == null || !_hydraulic_model_scada_list.Any())
            {
                WaitHelper.HideWaitForm();
                XtraMessageBox.Show("_hydraulic_model_scada_list is null");
                return;
            }
 
            _hydraulic_model_record_list = new IStation.Service.HydraulicModelRecord().GetByDate(start_time, end_time);
            if (_hydraulic_model_record_list == null || !_hydraulic_model_record_list.Any())
            {
                WaitHelper.HideWaitForm();
                XtraMessageBox.Show("_hydraulic_model_record_list is null");
                return;
            }
 
            SetRecord(_hydraulic_model_validation_list, _hydraulic_model_scada_list, _hydraulic_model_record_list);
            WaitHelper.HideWaitForm();
 
        }
 
 
        private void SetRecord(List<Model.HydraulicModelValidation> hydraulic_model_validation_list,
                                List<Model.HydraulicModelScada> hydraulic_model_scada_list,
                                  List<Model.HydraulicModelRecord> hydraulic_model_record_list)
        {
 
            var hydraulic_model_scada_group = hydraulic_model_scada_list.GroupBy(x => x.Time);
            var hydraulic_model_record_group = hydraulic_model_record_list.GroupBy(x => x.Time);
            _model_scada_valid_vm_list = new List<ModelScadaValidViewModel>();
 
            var time_list = hydraulic_model_validation_list.Select(x => x.Time).OrderBy(x => x).ToList();
            foreach (var time in time_list)
            {
                var hydraulic_model_scadas = hydraulic_model_scada_group.Where(x => x.Key == time).SelectMany(x => x).ToList();
                if (hydraulic_model_scadas == null || !hydraulic_model_scadas.Any())
                    continue;
 
                var scada_dict = hydraulic_model_scadas.ToDictionary(x => x.Tag, x => x.Value);
 
                var hydraulic_model_records = hydraulic_model_record_group.Where(x => x.Key == time).SelectMany(x => x).ToList();
                if (hydraulic_model_records == null || !hydraulic_model_records.Any())
                    continue;
                var model_record_dict = hydraulic_model_records.ToDictionary(x => x.ModelId, x => x.ModelValue);
 
                var vm = new ModelScadaValidViewModel();
                vm.Time = time;
                vm.R1s = scada_dict["R1"].Value;
                vm.R2s = scada_dict["R2"].Value;
                vm.R3s = scada_dict["R3"].Value;
                vm.RPump21s = scada_dict["RPump21"].Value;
                vm.RPump22s = scada_dict["RPump22"].Value;
                vm.RPump23s = scada_dict["RPump23"].Value;
                vm.RPump24s = scada_dict["RPump24"].Value;
                vm.RPump25s = scada_dict["RPump25"].Value;
                vm.RPump26s = scada_dict["RPump26"].Value;
                vm.RPump27s = scada_dict["RPump27"].Value;
 
                vm.DN2700P = model_record_dict["Jdn2700"].Value;
                vm.DN2400P = model_record_dict["Jdn2400"].Value;
                vm.JD1P = model_record_dict["Jjd1"].Value;
                vm.JD2P = model_record_dict["Jjd2"].Value;
                vm.JD3P = model_record_dict["Jjd3"].Value;
                vm.Pump11P = model_record_dict["Jpump11"].Value;
                vm.Pump12P = model_record_dict["Jpump12"].Value;
                vm.Pump13P = model_record_dict["Jpump13"].Value;
                vm.Pump14P = model_record_dict["Jpump14"].Value;
                vm.Pump15P = model_record_dict["Jpump15"].Value;
                vm.Pump16P = model_record_dict["Jpump16"].Value;
                vm.Pump17P = model_record_dict["Jpump17"].Value;
                vm.Pump18P = model_record_dict["Jpump18"].Value;
                vm.Pump21P = model_record_dict["Jpump21"].Value;
                vm.Pump22P = model_record_dict["Jpump22"].Value;
                vm.Pump23P = model_record_dict["Jpump23"].Value;
                vm.Pump24P = model_record_dict["Jpump24"].Value;
                vm.Pump25P = model_record_dict["Jpump25"].Value;
                vm.Pump26P = model_record_dict["Jpump26"].Value;
                vm.Pump27P = model_record_dict["Jpump27"].Value;
 
                vm.DN2700Ps = scada_dict["SPDN2700"].Value;
                vm.DN2400Ps = scada_dict["SPDN2400"].Value;
                vm.JD1Ps = scada_dict["SPJD1"].Value;
                vm.JD2Ps = scada_dict["SPJD2"].Value;
                vm.JD3Ps = scada_dict["SPJD3"].Value;
                vm.Pump11Ps = scada_dict["SPPump11"].Value;
                vm.Pump12Ps = scada_dict["SPPump12"].Value;
                vm.Pump13Ps = scada_dict["SPPump13"].Value;
                vm.Pump14Ps = scada_dict["SPPump14"].Value;
                vm.Pump15Ps = scada_dict["SPPump15"].Value;
                vm.Pump16Ps = scada_dict["SPPump16"].Value;
                vm.Pump17Ps = scada_dict["SPPump17"].Value;
                vm.Pump18Ps = scada_dict["SPPump18"].Value;
                vm.Pump21Ps = scada_dict["SPPump21"].Value;
                vm.Pump22Ps = scada_dict["SPPump22"].Value;
                vm.Pump23Ps = scada_dict["SPPump23"].Value;
                vm.Pump24Ps = scada_dict["SPPump24"].Value;
                vm.Pump25Ps = scada_dict["SPPump25"].Value;
                vm.Pump26Ps = scada_dict["SPPump26"].Value;
                vm.Pump27Ps = scada_dict["SPPump27"].Value;
 
                vm.DN2700F = model_record_dict["Pdn2700"].Value;
                vm.DN2400F = model_record_dict["Pdn2400"].Value;
                vm.JD1F = model_record_dict["Pjd1"].Value;
                vm.JD2F = model_record_dict["Pjd2"].Value;
                vm.JD3F = model_record_dict["Pjd3"].Value;
                vm.Pump21F = model_record_dict["Ppump21"].Value;
                vm.Pump22F = model_record_dict["Ppump22"].Value;
                vm.Pump23F = model_record_dict["Ppump23"].Value;
                vm.Pump24F = model_record_dict["Ppump24"].Value;
                vm.Pump25F = model_record_dict["Ppump25"].Value;
                vm.Pump26F = model_record_dict["Ppump26"].Value;
                vm.Pump27F = model_record_dict["Ppump27"].Value;
 
                vm.DN2700Fs = scada_dict["SFDN2700"].Value;
                vm.DN2400Fs = scada_dict["SFDN2400"].Value;
                vm.JD1Fs = scada_dict["SFJD1"].Value;
                vm.JD2Fs = scada_dict["SFJD2"].Value;
                vm.JD3Fs = scada_dict["SFJD3"].Value;
                vm.Pump21Fs = scada_dict["SFPump21"].Value;
                vm.Pump22Fs = scada_dict["SFPump22"].Value;
                vm.Pump23Fs = scada_dict["SFPump23"].Value;
                vm.Pump24Fs = scada_dict["SFPump24"].Value;
                vm.Pump25Fs = scada_dict["SFPump25"].Value;
                vm.Pump26Fs = scada_dict["SFPump26"].Value;
                vm.Pump27Fs = scada_dict["SFPump27"].Value;
 
                vm.Pump11s = scada_dict["Pump11"].Value * 50;
                vm.Pump12s = scada_dict["Pump12"].Value * 50;
                vm.Pump13s = scada_dict["Pump13"].Value * 50;
                vm.Pump14s = scada_dict["Pump14"].Value * 50;
                vm.Pump15s = scada_dict["Pump15"].Value * 50;
                vm.Pump16s = scada_dict["Pump16"].Value * 50;
                vm.Pump17s = scada_dict["Pump17"].Value * 50;
                vm.Pump18s = scada_dict["Pump18"].Value * 50;
                vm.Pump21s = scada_dict["Pump21"].Value * 50;
                vm.Pump22s = scada_dict["Pump22"].Value * 50;
                vm.Pump23s = scada_dict["Pump23"].Value * 50;
                vm.Pump24s = scada_dict["Pump24"].Value * 50;
                vm.Pump25s = scada_dict["Pump25"].Value * 50;
                vm.Pump26s = scada_dict["Pump26"].Value * 50;
                vm.Pump27s = scada_dict["Pump27"].Value * 50;
 
                vm.Diff();
                vm.Round();
                _model_scada_valid_vm_list.Add(vm);
            }
 
            this.modelScadaValidViewModelBindingSource.DataSource = _model_scada_valid_vm_list;
            this.modelScadaValidViewModelBindingSource.ResetBindings(false);
            this.advBandedGridView1.BestFitColumns();
        }
 
        #region event
        private void dateEditStart_EditValueChanged(object sender, EventArgs e)
        {
            this.dateEditEnd.EditValue = this.dateEditStart.DateTime.AddDays(1);
        }
 
        private void cekWaterLevel_CheckedChanged(object sender, EventArgs e)
        {
            var cek = this.cekWaterLevel.Checked;
            this.gbWL1.Visible = cek;
            this.gbWL2.Visible = cek;
 
        }
 
        private void cekFlow_CheckedChanged(object sender, EventArgs e)
        {
            var cek = this.cekFlow.Checked;
            this.gbFs1.Visible = cek;
            this.gbFs2.Visible = cek;
            this.gbF1.Visible = cek;
            this.gbF2.Visible = cek;
            this.gbFd1.Visible = cek;
            this.gbFd2.Visible = cek;
        }
 
        private void cekFrequency_CheckedChanged(object sender, EventArgs e)
        {
            var cek = this.cekFrequency.Checked;
            this.gbPump1.Visible = cek;
            this.gbPump2.Visible = cek;
        }
 
        private void cekPressure_CheckedChanged(object sender, EventArgs e)
        {
            var cek = this.cekPressure.Checked;
            this.gbOP1.Visible = cek;
            this.gbOP2.Visible = cek;
            this.gbOPs1.Visible = cek;
            this.gbOPs2.Visible = cek;
 
            this.gbOPd1.Visible = cek;
            this.gbOPd2.Visible = cek;
        }
 
        private void btnExport_Click(object sender, EventArgs e)
        {
            var vm = this.advBandedGridView1.GetFocusedRow() as ModelScadaValidViewModel;
            if (vm == null)
            {
                XtraMessageBox.Show(" advBandedGridView1 无数据!");
                return;
            }
 
            var hydraulicModelValidation = _hydraulic_model_validation_list.Find(x => vm.Time == x.Time);
            if (hydraulicModelValidation == null)
            {
                XtraMessageBox.Show("hydraulicModelValidation is null");
                return;
            }
 
            var hydraulic_model_scada_list = _hydraulic_model_scada_list.Where(x => x.VerificationID == hydraulicModelValidation.ID).ToList();
            if (hydraulic_model_scada_list == null || !hydraulic_model_scada_list.Any())
            {
                XtraMessageBox.Show("hydraulic_model_scada_list is null");
                return;
            }
 
            var zy_scada_list = hydraulic_model_scada_list.Select(x => new Model.ZyScada()
            {
                Code = x.Code,
                Tag = x.Tag,
                Time = x.Time,
                Value = x.Value,
            }).ToList();
 
            var bol = GlobalHelper.ExportTempZyScadaDebugTxt(zy_scada_list);
            XtraMessageBox.Show(bol.ToString());
        }
 
        private void advBandedGridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
 
        }
 
        #endregion
 
        private readonly Service.Station _service_station = new();
        private readonly Service.ScheduleConfig _service_schedule_config = new();
 
        private void btnSchedule_Click(object sender, EventArgs e)
        {
            _model_schedule_vm_list = new List<ModelScheduleViewModel>();
            if (_day_value == null)
            {
                XtraMessageBox.Show(" _day_value 无数据!");
                return;
            }
            var model_scada_valid_vm_list = _model_scada_valid_vm_list?.Where(x => x.Time.Minute == 00).ToList();//.Take(2);//.Where(x => x.Time.Minute == 00 || x.Time.Minute == 30).ToList();
            if (model_scada_valid_vm_list == null || !model_scada_valid_vm_list.Any())
            {
                XtraMessageBox.Show(" _model_scada_valid_vm_list 无数据!");
                return;
            }
 
            #region dict
 
            var pressure_id_mapping_dict = new Dictionary<string, string>()
            {
                {"Jjd1","SPJD1"},
                {"Jjd2","SPJD2"},
                {"Jjd3","SPJD3"},
                {"Jpump11","SPPump11" },
                {"Jpump12","SPPump12" },
                {"Jpump13","SPPump13" },
                {"Jpump14","SPPump14" },
                {"Jpump15","SPPump15" },
                {"Jpump16","SPPump16" },
                {"Jpump17","SPPump17" },
                {"Jpump18","SPPump18" },
                {"Jdn2400","SPDN2400"},
                {"Jdn2700","SPDN2700"},
                {"Jpump21","SPPump21"},
                {"Jpump22","SPPump22"},
                {"Jpump23","SPPump23"},
                {"Jpump24","SPPump24"},
                {"Jpump25","SPPump25"},
                {"Jpump26","SPPump26"},
                {"Jpump27","SPPump27"}
            };
            var flow_id_mapping_dict = new Dictionary<string, string>()
            {
                {"Pjd1","SFJD1"},
                {"Pjd2","SFJD2"},
                {"Pjd3","SFJD3"},
                {"Pdn2400","SFDN2400"},
                {"Pdn2700","SFDN2700"},
                {"Ppump21","SFPump21"},
                {"Ppump22","SFPump22"},
                {"Ppump23","SFPump23"},
                {"Ppump24","SFPump24"},
                {"Ppump25","SFPump25"},
                {"Ppump26","SFPump26"},
                {"Ppump27","SFPump27"}
            };
            var pattern_id_mapping_dict = new Dictionary<string, string>()
            {
                {"R3", "R3"},
                {"R2", "R2"},
                {"R1", "R1"},
                {"SFJD1", "SFJD1"},
                {"SFJD2", "SFJD2"},
                {"SFJD3", "SFJD3"},
                {"RPump21", "RPump21"},
                {"RPump22", "RPump22"},
                {"RPump23", "RPump23"},
                {"RPump24", "RPump24"},
                {"RPump25", "RPump25"},
                {"RPump26", "RPump26"},
                {"RPump27", "RPump27"},
                {"SFPump21", "SFPump21"},
                {"SFPump22", "SFPump22"},
                {"SFPump23", "SFPump23"},
                {"SFPump24", "SFPump24"},
                {"SFPump25", "SFPump25"},
                {"SFPump26", "SFPump26"},
                {"SFPump27", "SFPump27"},
                {"SFDN2400", "SFDN2400"},
                {"SFDN2700", "SFDN2700"},
            };
            var pump_id_mapping_dict_int = new Dictionary<string, int>(){
                { "Pump11",GlobalHelper.Flag11},
                { "Pump12",GlobalHelper.Flag12},
                { "Pump13",GlobalHelper.Flag13},
                { "Pump14",GlobalHelper.Flag14},
                { "Pump15",GlobalHelper.Flag15},
                { "Pump16",GlobalHelper.Flag16},
                { "Pump17",GlobalHelper.Flag17},
                { "Pump18",GlobalHelper.Flag18},
                { "Pump21",GlobalHelper.Flag21},
                { "Pump22",GlobalHelper.Flag22},
                { "Pump23",GlobalHelper.Flag23},
                { "Pump24",GlobalHelper.Flag24},
                { "Pump25",GlobalHelper.Flag25},
                { "Pump26",GlobalHelper.Flag26},
                { "Pump27",GlobalHelper.Flag27}
            };
 
            var pump_pressure_mapping_dict_int = new Dictionary<string, string>(){
                { "Pump11","Jpump11"},
                { "Pump12","Jpump12"},
                { "Pump13","Jpump13"},
                { "Pump14","Jpump14"},
                { "Pump15","Jpump15"},
                { "Pump16","Jpump16"},
                { "Pump17","Jpump17"},
                { "Pump18","Jpump18" },
                { "Pump21","Jpump21"},
                { "Pump22","Jpump22"},
                { "Pump23","Jpump23"},
                { "Pump24","Jpump24"},
                { "Pump25","Jpump25"},
                { "Pump26","Jpump26"},
                { "Pump27","Jpump27"}
            };
 
            #endregion
 
            #region init
 
            var station_info = _service_station.Get();
            var station1 = station_info.Station1;
            var station2 = station_info.Station2;
            var station1_same_type_flag_group_first = GlobalHelper.Station1SameTypeFlagGroupFirst;
            var station2_same_type_flag_group_first = GlobalHelper.Station2SameTypeFlagGroupFirst;
            var station1_schedule_config = _service_schedule_config.GetStation1();
            var station2_schedule_config = _service_schedule_config.GetStation2();
            var station1_flag_list = GlobalHelper.Station1FlagList;
            var station2_flag_list = GlobalHelper.Station2FlagList;
 
            var pump_id_mapping_dict = GlobalHelper.ModelPumpIdMappingDict;
            var flag_nr_mapping_dict = GlobalHelper.GetFlagNrMappingDict();
 
            var avg1_json = File.ReadAllText("D:\\AvgStatisticsS1ViewModelList.json");
            var debug_avg1_list = Yw.JsonHelper.Json2Object<List<AvgStatisticsS1>>(avg1_json);
            if (debug_avg1_list != null)
                debug_avg1_list.ForEach(x => x.Round());
 
            var avg2_json = File.ReadAllText("D:\\AvgStatisticsS2ViewModelList.json");
            var debug_avg2_list = Yw.JsonHelper.Json2Object<List<AvgStatisticsS2>>(avg2_json);
            if (debug_avg2_list != null)
                debug_avg2_list.ForEach(x => x.Round());
 
            var pump_pattern_custom_dict = new Dictionary<string, double>();
            var pattern_dict = new Dictionary<string, float[]>();
            var scada_dict = new Dictionary<string, double>();
            var pattern_dict_temp = new Dictionary<string, float[]>();
 
            var correction_factor_dict_diff1 = new Dictionary<int, double>();
            foreach (var item in IStation.GlobalHelper.Station1FlagList)
            {
                correction_factor_dict_diff1.Add(item, 0);
            }
            var correction_factor_dict_diff2 = new Dictionary<int, double>();
            foreach (var item in IStation.GlobalHelper.Station2FlagList)
            {
                correction_factor_dict_diff2.Add(item, 0);
            }
 
            #endregion 
 
            WaitHelper.ShowWaitForm();
            var helper = new IStation.Algorithm.ScheduleHelper();
            //helper.InitCombineCorrectionFactor(debug_avg1_list, debug_avg2_list);
            foreach (var vm in model_scada_valid_vm_list)
            {
                var current_time = vm.Time;
                var timeVlaue = _day_value.TimeValueList.Find(x => x.Time == current_time);
                pump_pattern_custom_dict.Clear();
                pattern_dict.Clear();
                scada_dict.Clear();
                foreach (var zy_scada in timeVlaue.Value)
                {
                    var tag = zy_scada.Key;
                    var value = zy_scada.Value;
                    foreach (var item in pattern_id_mapping_dict)
                    {
                        if (item.Key == tag)
                        {
                            var pattern_id = item.Key;
                            var factor = value;
                            pattern_dict.Add(pattern_id, new float[] { (float)factor });
                            break;
                        }
                    }
 
                    foreach (var item in flow_id_mapping_dict)
                    {
                        if (item.Value != tag)
                            continue;
                        scada_dict.Add(tag, value);
                    }
 
                    foreach (var item in pressure_id_mapping_dict)
                    {
                        if (item.Value != tag)
                            continue;
                        var pressure_value = value;
                        scada_dict.Add(tag, pressure_value);
                    }
                }
 
                var pump_model_scada_diff_dict = new Dictionary<string, double?>(){
                { "Pump11",vm.Pump11Pd},
                { "Pump12",vm.Pump12Pd},
                { "Pump13",vm.Pump13Pd},
                { "Pump14",vm.Pump14Pd},
                { "Pump15",vm.Pump15Pd},
                { "Pump16",vm.Pump16Pd},
                { "Pump17",vm.Pump17Pd},
                { "Pump18",vm.Pump18Pd},
                { "Pump21",vm.Pump21Pd},
                { "Pump22",vm.Pump22Pd},
                { "Pump23",vm.Pump23Pd},
                { "Pump24",vm.Pump24Pd},
                { "Pump25",vm.Pump25Pd},
                { "Pump26",vm.Pump26Pd},
                { "Pump27",vm.Pump27Pd}
                };
 
 
                var target_flow1 = vm.TotalFlow1.Value;
                var target_head1 = vm.TotalPressure1.Value;
 
                var target_flow2 = vm.TotalFlow2.Value;
                var target_head2 = vm.TotalPressure2.Value;
 
                GetStationOpenFlagList(vm, out List<int> station1_open_flag_list, out List<int> station2_open_flag_list);
                GetFlagInletWaterLevelDict(vm, out Dictionary<int, double> station1_flag_inlet_water_level_dict, out Dictionary<int, double> station2_flag_inlet_water_level_dict);
 
                var model_schedule_vm = new ModelScheduleViewModel();
                model_schedule_vm.Time = current_time;
                model_schedule_vm.TotalFlow1 = target_flow1;
                model_schedule_vm.TotalFlow2 = target_flow2;
                model_schedule_vm.TotalHead1 = target_head1;
                model_schedule_vm.TotalHead2 = target_head2;
 
                #region 第一次调度
                foreach (var item in IStation.GlobalHelper.Station1FlagList)
                    correction_factor_dict_diff1[item] = 0;// 0.8;
                foreach (var item in IStation.GlobalHelper.Station2FlagList)
                    correction_factor_dict_diff2[item] = 0;// 2;
 
 
 
                //helper.InitCorrectionFactorDict(correction_factor_dict_diff1, correction_factor_dict_diff2);
                //helper.InitStation(1);
                helper.Initial(station1_open_flag_list, station1_schedule_config);
                var optimal_combine1 = helper.GetOptAnaCombine(station1, station1_same_type_flag_group_first, station1_flag_inlet_water_level_dict, null, target_flow1, target_head1);
 
                //helper.InitStation(2);
                helper.Initial(station2_open_flag_list, station2_schedule_config);
                var optimal_combine2 = helper.GetOptAnaCombine(station2, station2_same_type_flag_group_first, station2_flag_inlet_water_level_dict, null, target_flow2, target_head2);
 
                var station1_open_flag_list_bak = station1_open_flag_list.Select(x => x).ToList();
                if (optimal_combine1 != null)
                {
 
                    station1_open_flag_list = new List<int>();
                    foreach (var fre_pump in optimal_combine1.AnaFrePumps)
                    {
                        var flag = fre_pump.Flag;
                        var modelId = pump_id_mapping_dict[flag];
                        pump_pattern_custom_dict.Add(modelId, fre_pump.Frequency / 50);
                        if (fre_pump.Frequency > 0)
                        {
                            station1_open_flag_list.Add(flag);
                        }
                    }
                }
                else
                {
                    model_schedule_vm.Station1F = "异常";
                }
 
                var station2_open_flag_list_bak = station2_open_flag_list.Select(x => x).ToList();
                if (optimal_combine2 != null)
                {
                    station2_open_flag_list = new List<int>();
                    foreach (var fre_pump in optimal_combine2.AnaFrePumps)
                    {
                        var flag = fre_pump.Flag;
                        var modelId = pump_id_mapping_dict[flag];
                        pump_pattern_custom_dict.Add(modelId, fre_pump.Frequency / 50);
                        if (fre_pump.Frequency > 0)
                        {
                            station2_open_flag_list.Add(flag);
                        }
                    }
                }
                else
                {
                    model_schedule_vm.Station2F = "异常";
                }
 
 
 
                pattern_dict_temp.Clear();
                foreach (var item in pattern_dict)
                    pattern_dict_temp.Add(item.Key, item.Value);
                foreach (var item in pump_pattern_custom_dict)
                    pattern_dict_temp.Add(item.Key, new float[] { (float)item.Value });
 
                var record_list = Verify(1, current_time, _hydraulic_model_file, flow_id_mapping_dict, pressure_id_mapping_dict, pattern_dict_temp, scada_dict);
                var model_diff_dict = record_list.ToDictionary(x => x.ModelId, y => y.DifferenceValue);
 
                model_schedule_vm.JD1Pd = model_diff_dict["Jjd1"];
                model_schedule_vm.JD2Pd = model_diff_dict["Jjd2"];
                model_schedule_vm.JD3Pd = model_diff_dict["Jjd3"];
 
                model_schedule_vm.DN2400Pd = model_diff_dict["Jdn2400"];
                model_schedule_vm.DN2700Pd = model_diff_dict["Jdn2700"];
 
                var station1_open_flag_list_remark = IntListHelper.ToString(station1_open_flag_list.OrderBy(x => x));
                if (optimal_combine1?.Remark != station1_open_flag_list_remark)
                {
                    model_schedule_vm.Station1F = "异常";
 
                    pump_model_scada_diff_dict["Pump11"] = 0;
                    pump_model_scada_diff_dict["Pump12"] = 0;
                    pump_model_scada_diff_dict["Pump13"] = 0;
                    pump_model_scada_diff_dict["Pump14"] = 0;
                    pump_model_scada_diff_dict["Pump15"] = 0;
                    pump_model_scada_diff_dict["Pump16"] = 0;
                    pump_model_scada_diff_dict["Pump17"] = 0;
                    pump_model_scada_diff_dict["Pump18"] = 0;
                }
 
 
                var station2_open_flag_list_remark = IntListHelper.ToString(station2_open_flag_list.OrderBy(x => x));
                if (optimal_combine2?.Remark != station2_open_flag_list_remark)
                {
                    model_schedule_vm.Station2F = "异常";
                    pump_model_scada_diff_dict["Pump21"] = 0;
                    pump_model_scada_diff_dict["Pump22"] = 0;
                    pump_model_scada_diff_dict["Pump23"] = 0;
                    pump_model_scada_diff_dict["Pump24"] = 0;
                    pump_model_scada_diff_dict["Pump25"] = 0;
                    pump_model_scada_diff_dict["Pump26"] = 0;
                    pump_model_scada_diff_dict["Pump27"] = 0;
                }
 
                #endregion
 
                #region 调度后再修正
 
                foreach (var item in IStation.GlobalHelper.Station1FlagList)
                    correction_factor_dict_diff1[item] = 0;
                foreach (var item in IStation.GlobalHelper.Station2FlagList)
                    correction_factor_dict_diff2[item] = 0;
 
 
 
 
 
 
                //0605
                correction_factor_dict_diff2[22] = 0.18106132115153997;
                correction_factor_dict_diff2[23] = 2.2042188059947008;
                correction_factor_dict_diff2[25] = 0.6079810880454152;
 
                //correction_factor_dict_diff2[22] = 0.43;
                //correction_factor_dict_diff2[23] = 1.96;
                //correction_factor_dict_diff2[25] = 0.6;
 
 
 
 
 
                //0207
                //correction_factor_dict_diff2[23] = 1.5952199163470961;
                //correction_factor_dict_diff2[24] = 0.4228370174078948;
                //correction_factor_dict_diff2[25] = 0.2595121368951327;
 
                //correction_factor_dict_diff2[23] = 1.62;
                //correction_factor_dict_diff2[24] = 0.38;
                //correction_factor_dict_diff2[25] = 0.21;
 
 
                //foreach (var item in pump_pattern_custom_dict)
                //{
                //    var flag = pump_id_mapping_dict_int[item.Key];
                //    var jdId = pump_pressure_mapping_dict_int[item.Key];
                //    var model_diff = model_diff_dict[jdId] ?? 0;
                //    var pump_model_scada_diff = pump_model_scada_diff_dict[item.Key] ?? 0;
 
                //    var factor = model_diff - pump_model_scada_diff;
                //    double val = 0;
                //    if (factor > 0)
                //    {
                //        val = -factor;
                //    }
                //    else
                //    {
                //        val = Math.Abs(factor);
                //    }
                //    if (correction_factor_dict_diff1.ContainsKey(flag))
                //    {
                //        if (!station1_open_flag_list_bak.Contains(flag))
                //        {
                //            val = 0;
                //        }
                //        //model_schedule_vm.CorrectionFactor1 += $"[{flag}]:{val:N2} ";
                //        model_schedule_vm.CorrectionFactor1 += $"{flag}, ";
                //        correction_factor_dict_diff1[flag] = val;
                //    }
                //    if (correction_factor_dict_diff2.ContainsKey(flag))
                //    {
                //        if (!station2_open_flag_list_bak.Contains(flag))
                //        {
                //            val = 0;
                //        }
                //        model_schedule_vm.CorrectionFactor2 += $"{flag},";
                //        //model_schedule_vm.CorrectionFactor2 += $"[{flag}]:{val:N2} ";
                //        correction_factor_dict_diff2[flag] = val;
                //    }
                //}
 
 
 
                //helper.InitCorrectionFactorDict(correction_factor_dict_diff1, correction_factor_dict_diff2);
                //helper.InitStation(1);
                helper.Initial(station1_open_flag_list, station1_schedule_config);
                var optimal_combine1_correction = helper.GetOptAnaCombine(station1, station1_same_type_flag_group_first, station1_flag_inlet_water_level_dict, null, target_flow1, target_head1);
                //helper.InitStation(2);
                helper.Initial(station2_open_flag_list, station2_schedule_config);
                var optimal_combine2_correction = helper.GetOptAnaCombine(station2, station2_same_type_flag_group_first, station2_flag_inlet_water_level_dict, null, target_flow2, target_head2);
 
                pump_pattern_custom_dict.Clear();
                if (optimal_combine1_correction != null)
                {
                    foreach (var fre_pump in optimal_combine1_correction.AnaFrePumps)
                    {
                        var flag = fre_pump.Flag;
                        var modelId = pump_id_mapping_dict[flag];
                        pump_pattern_custom_dict.Add(modelId, fre_pump.Frequency / 50);
                    }
                }
                else
                {
                    model_schedule_vm.Station1F = "异常";
 
                }
 
                if (optimal_combine2_correction != null)
                {
                    foreach (var fre_pump in optimal_combine2_correction.AnaFrePumps)
                    {
                        var flag = fre_pump.Flag;
                        var modelId = pump_id_mapping_dict[flag];
                        pump_pattern_custom_dict.Add(modelId, fre_pump.Frequency / 50);
                    }
                }
                else
                {
                    model_schedule_vm.Station2F = "异常";
                }
 
                pattern_dict_temp.Clear();
                foreach (var item in pattern_dict)
                    pattern_dict_temp.Add(item.Key, item.Value);
                foreach (var item in pump_pattern_custom_dict)
                    pattern_dict_temp.Add(item.Key, new float[] { (float)item.Value });
 
                var record_list_correction = Verify(1, current_time, _hydraulic_model_file, flow_id_mapping_dict, pressure_id_mapping_dict, pattern_dict_temp, scada_dict);
                var model_diff_correction = record_list_correction.ToDictionary(x => x.ModelId, y => y.DifferenceValue);
                model_schedule_vm.JD1PdC = model_diff_correction["Jjd1"];
                model_schedule_vm.JD2PdC = model_diff_correction["Jjd2"];
                model_schedule_vm.JD3PdC = model_diff_correction["Jjd3"];
 
                model_schedule_vm.DN2400PdC = model_diff_correction["Jdn2400"];
                model_schedule_vm.DN2700PdC = model_diff_correction["Jdn2700"];
                #endregion
 
                model_schedule_vm.Round();
                _model_schedule_vm_list.Add(model_schedule_vm);
            }
 
            this.modelScheduleViewModelBindingSource.DataSource = _model_schedule_vm_list;
            this.modelScheduleViewModelBindingSource.ResetBindings(false);
            this.gridView1.BestFitColumns();
            this.gridView1.RefreshData();
            WaitHelper.HideWaitForm();
        }
 
 
        /// <summary>
        /// 模型验证
        /// </summary>  
        public static List<Model.HydraulicModelRecord> Verify(
            long verify_id,
            DateTime verify_time,
            string verify_file_path,
            Dictionary<string, string> flow_id_mapping_dict,
            Dictionary<string, string> pressure_id_mapping_dict,
            Dictionary<string, float[]> pattern_dict,
            Dictionary<string, double> scada_dict)
        {
            var hydraulic_record_list = new List<Model.HydraulicModelRecord>();
            var err = EpanetMethods.ENopen(verify_file_path, "", "");
            if (err != 0)
            {
                return default;
            }
            err = EpanetMethods.ENopenH();
            if (err != 0)
            {
                return default;
            }
 
            var model_id_build = new StringBuilder(31);
            var pattern_init = true;
            foreach (var pattern in pattern_dict)
            {
                var pattern_id = pattern.Key;
                var pattern_factor_array = pattern.Value;
                var pattern_factor_array_count = pattern_factor_array.Length == 0 ? 1 : pattern_factor_array.Length;
                err = EpanetMethods.ENgetpatternindex(pattern_id, out int pattern_index);
 
                if (err != ErrorCode.Ok)
                {
                    pattern_init = false;
                    continue;
                }
                err = EpanetMethods.ENsetpattern(pattern_index, pattern_factor_array, pattern_factor_array_count);
                if (err != ErrorCode.Ok)
                {
                    pattern_init = false;
                    continue;
                }
            }
 
            if (!pattern_init)
            {
                return default;
            }
 
            EpanetMethods.ENinitH(0);
            EpanetMethods.ENrunH(out _);
            EpanetMethods.ENgetcount(CountType.Link, out int link_count);
            EpanetMethods.ENgetcount(CountType.Node, out int node_count);
 
            for (int link_index = 1; link_index <= link_count; link_index++)
            {
                if (EpanetMethods.ENgetlinkid(link_index, model_id_build) != ErrorCode.Ok)
                    continue;
                var model_id = model_id_build.ToString();
 
                if (flow_id_mapping_dict.ContainsKey(model_id))
                {
                    var scada_id = flow_id_mapping_dict[model_id];
                    var scada_value = scada_dict[scada_id];
                    EpanetMethods.ENgetlinkvalue(link_index, LinkValue.Flow, out float model_value);
                    model_value = Math.Abs(model_value);
 
                    var record = new IStation.Model.HydraulicModelRecord
                    {
                        VerificationID = verify_id,
                        Time = verify_time,
                        ModelId = model_id,
                        ScadaId = scada_id,
                        ValueType = IStation.eValueType.Flow,
                        ModelValue = (double)model_value,
                        ScadaValue = scada_value
                    };
                    record.DifferenceValue = record.ModelValue - record.ScadaValue;
                    hydraulic_record_list.Add(record);
                }
 
                EpanetMethods.ENgetlinktype(link_index, out LinkType linkType);
                if (linkType == LinkType.Pump)
                {
                    EpanetMethods.ENgetlinkvalue(link_index, LinkValue.HeadLoss, out float val);
                    //var record = new IStation.Model.HydraulicModelRecord
                    //{
                    //    VerificationID = verify_id,
                    //    Time = verify_time,
                    //    ModelId = model_id, 
                    //    ValueType = IStation.eValueType.Flow,
                    //    ModelValue = (double)vals, 
                    //};
                    //record.DifferenceValue = record.ScadaValue - record.ModelValue;
                    //hydraulic_record_list.Add(record);
                }
            }
 
            for (int node_index = 1; node_index <= node_count; node_index++)
            {
                if (EpanetMethods.ENgetnodeid(node_index, model_id_build) != ErrorCode.Ok)
                    continue;
                var model_id = model_id_build.ToString();
 
                if (pressure_id_mapping_dict.ContainsKey(model_id))
                {
                    var scada_id = pressure_id_mapping_dict[model_id];
                    var scada_value = scada_dict[scada_id];
 
                    EpanetMethods.ENgetnodevalue(node_index, NodeValue.Head, out float model_value);
 
                    var record = new IStation.Model.HydraulicModelRecord
                    {
                        VerificationID = verify_id,
                        Time = verify_time,
                        ModelId = model_id,
                        ScadaId = scada_id,
                        ValueType = IStation.eValueType.Head,
                        ModelValue = (double)model_value,
                        ScadaValue = scada_value
                    };
                    record.DifferenceValue = record.ModelValue - record.ScadaValue;
                    hydraulic_record_list.Add(record);
                }
            }
 
            EpanetMethods.ENcloseH();
            EpanetMethods.ENclose();
            return hydraulic_record_list;
        }
 
 
        /// <summary>
        /// 获取泵站运行标志列表
        /// </summary> 
        public void GetStationOpenFlagList(ModelScadaValidViewModel vm, 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 (vm == null)
                return;
 
            if (vm.Pump11s > 0)
                station1_open_flag_list.Add(11);
            if (vm.Pump12s > 0)
                station1_open_flag_list.Add(12);
            if (vm.Pump13s > 0)
                station1_open_flag_list.Add(13);
            if (vm.Pump14s > 0)
                station1_open_flag_list.Add(14);
            if (vm.Pump15s > 0)
                station1_open_flag_list.Add(15);
            if (vm.Pump16s > 0)
                station1_open_flag_list.Add(16);
            if (vm.Pump17s > 0)
                station1_open_flag_list.Add(17);
            if (vm.Pump18s > 0)
                station1_open_flag_list.Add(18);
 
 
            if (vm.Pump21s > 0)
                station2_open_flag_list.Add(21);
            if (vm.Pump22s > 0)
                station2_open_flag_list.Add(22);
            if (vm.Pump23s > 0)
                station2_open_flag_list.Add(23);
            if (vm.Pump24s > 0)
                station2_open_flag_list.Add(24);
            if (vm.Pump25s > 0)
                station2_open_flag_list.Add(25);
            if (vm.Pump26s > 0)
                station2_open_flag_list.Add(26);
            if (vm.Pump27s > 0)
                station2_open_flag_list.Add(27);
 
        }
 
        /// <summary>
        /// 获取泵进口水位字典
        /// </summary>  
        public void GetFlagInletWaterLevelDict(ModelScadaValidViewModel vm, 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>();
            if (vm == null)
                return;
 
            station1_flag_inlet_water_level_dict.Add(GlobalHelper.Flag11, vm.R3s.Value);
            station1_flag_inlet_water_level_dict.Add(GlobalHelper.Flag12, vm.R3s.Value);
            station1_flag_inlet_water_level_dict.Add(GlobalHelper.Flag13, vm.R3s.Value);
            station1_flag_inlet_water_level_dict.Add(GlobalHelper.Flag14, vm.R2s.Value);
            station1_flag_inlet_water_level_dict.Add(GlobalHelper.Flag15, vm.R2s.Value);
            station1_flag_inlet_water_level_dict.Add(GlobalHelper.Flag16, vm.R1s.Value);
            station1_flag_inlet_water_level_dict.Add(GlobalHelper.Flag17, vm.R1s.Value);
            station1_flag_inlet_water_level_dict.Add(GlobalHelper.Flag18, vm.R1s.Value);
 
 
            station2_flag_inlet_water_level_dict.Add(GlobalHelper.Flag21, vm.RPump21s.Value);
            station2_flag_inlet_water_level_dict.Add(GlobalHelper.Flag22, vm.RPump22s.Value);
            station2_flag_inlet_water_level_dict.Add(GlobalHelper.Flag23, vm.RPump23s.Value);
            station2_flag_inlet_water_level_dict.Add(GlobalHelper.Flag24, vm.RPump24s.Value);
            station2_flag_inlet_water_level_dict.Add(GlobalHelper.Flag25, vm.RPump25s.Value);
            station2_flag_inlet_water_level_dict.Add(GlobalHelper.Flag26, vm.RPump26s.Value);
            station2_flag_inlet_water_level_dict.Add(GlobalHelper.Flag27, vm.RPump27s.Value);
 
        }
 
        private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            if (e.Column == this.colDN2400PdC || e.Column == this.colDN2700PdC || e.Column == this.colJD1PdC || e.Column == this.colJD2PdC || e.Column == this.colJD3PdC)
            {
                var cell_value = e.CellValue.ToString() ?? string.Empty;
                if (double.TryParse(cell_value, out double value))
                {
                    if (Math.Abs(value) > 0.5)
                    {
                        e.Appearance.ForeColor = Color.Red;
                    }
                }
            }
        }
 
        private void labExport_Click(object sender, EventArgs e)
        {
            var dlg = new SaveFileDialog();
            dlg.Filter = "Excel|*.xls";
            dlg.AutoUpgradeEnabled = true;
            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            this.gridView1.ExportToXlsx(dlg.FileName);
            //this.gridView1.OptionsPrint.PrintDetails = true;//导出明细
            //this.gridView1.OptionsPrint.ExpandAllDetails = true;//导出所有明细,false的话,只会导出展开的明细
            //this.gridView1.ExportToXlsx(dlg.FileName, new DevExpress.XtraPrinting.XlsxExportOptionsEx() { ExportType = DevExpress.Export.ExportType.WYSIWYG, TextExportMode = DevExpress.XtraPrinting.TextExportMode.Text });
            ////DialogResult dr = XtraMessageBox.Show("导出成功!是否打开刚刚保存的Excel文件?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            //if (dr != DialogResult.OK)
            //    return;
            //System.Diagnostics.Process.Start(dlg.FileName); 
        }
 
        private void btnChart_Click(object sender, EventArgs e)
        {
 
        }
 
 
 
    }
}