| | |
| | | using DevExpress.Utils.Extensions; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraGrid.Columns; |
| | | using System.Data; |
| | | |
| | |
| | | InitializeComponent(); |
| | | |
| | | this.gridView1.SetNormalView(); |
| | | this.gridView2.SetNormalView(); |
| | | this.gridView2.OptionsView.ColumnAutoWidth = false; |
| | | foreach (GridColumn col in gridView2.Columns) |
| | | this.advBandedGridView1.SetNormalView(); |
| | | this.advBandedGridView1.OptionsView.ColumnAutoWidth = false; |
| | | foreach (GridColumn col in advBandedGridView1.Columns) |
| | | { |
| | | col.MinWidth = 60; |
| | | } |
| | | |
| | | var year = 2024; |
| | | var month = 1; |
| | | this.dateEditStart.DateTime = new DateTime(year, month, 1); |
| | | this.dateEditEnd.DateTime = new DateTime(year, month, DateTime.DaysInMonth(year, month)); |
| | | this.dateEditStart.DateTime = new DateTime(year, month, 2); |
| | | |
| | | ShowWaterLevel(false); |
| | | //this.dateEditStart.DateTime = new DateTime(year, month, 1); |
| | | // this.dateEditEnd.DateTime = new DateTime(year, month, DateTime.DaysInMonth(year, month)); |
| | | |
| | | } |
| | | |
| | |
| | | //private List<Model.SchedulePump> _schedule_pump_list = null; |
| | | //private List<Model.ScheduleConclusion> _schedule_conclusion_list = null; |
| | | |
| | | private List<Model.HydraulicModelValidation> _hydraulic_model_validation_list = 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 void barBtnLoad_Click(object sender, EventArgs e) |
| | | { |
| | | this.modelValidViewModelBindingSource.DataSource = null; |
| | | this.modelScadaValidViewModelBindingSource.DataSource = null; |
| | | this.modelValidViewModelBindingSource.DataSource = new List<ModelValidViewModel>(); |
| | | this.modelScadaValidViewModelBindingSource.DataSource = new List<ModelScadaValidViewModel>(); |
| | | |
| | | WaitHelper.ShowWaitForm(); |
| | | var start_time = this.dateEditStart.DateTime; |
| | |
| | | return; |
| | | } |
| | | |
| | | SetGridView1(_hydraulic_model_record_list); |
| | | //SetGridView1(_hydraulic_model_record_list); |
| | | SetGridView2(_hydraulic_model_validation_list, _hydraulic_model_scada_list, _hydraulic_model_record_list); |
| | | WaitHelper.HideWaitForm(); |
| | | } |
| | |
| | | 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); |
| | | var model_scada_valid_vm_list = new List<ModelScadaValidViewModel>(); |
| | | |
| | | var time_list= hydraulic_model_validation_list.Select(x=>x.Time).OrderBy(x=>x).ToList(); |
| | | 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); |
| | | var 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 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()) |
| | |
| | | |
| | | 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.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.Pump26Fs = scada_dict["SFPump26"].Value; |
| | | vm.Pump27Fs = scada_dict["SFPump27"].Value; |
| | | |
| | | vm.Pump11s = scada_dict["Pump11"].Value; |
| | | vm.Pump11s = scada_dict["Pump11"].Value; |
| | | vm.Pump12s = scada_dict["Pump12"].Value; |
| | | vm.Pump13s = scada_dict["Pump13"].Value; |
| | | vm.Pump14s = scada_dict["Pump14"].Value; |
| | | vm.Pump15s = scada_dict["Pump15"].Value; |
| | | vm.Pump16s = scada_dict["Pump16"].Value; |
| | | vm.Pump17s = scada_dict["Pump17"].Value; |
| | | vm.Pump18s = scada_dict["Pump18"].Value; |
| | | vm.Pump21s = scada_dict["Pump21"].Value; |
| | | vm.Pump22s = scada_dict["Pump22"].Value; |
| | | vm.Pump23s = scada_dict["Pump23"].Value; |
| | | vm.Pump24s = scada_dict["Pump24"].Value; |
| | | vm.Pump25s = scada_dict["Pump25"].Value; |
| | | vm.Pump26s = scada_dict["Pump26"].Value; |
| | | vm.Pump27s = scada_dict["Pump27"].Value; |
| | | vm.Pump11s = scada_dict["Pump11"].Value * 50; |
| | | 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.modelValidViewModelBindingSource.ResetBindings(false); |
| | | this.gridView2.BestFitColumns(); |
| | | this.advBandedGridView1.BestFitColumns(); |
| | | } |
| | | |
| | | private void dateEditStart_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | | this.dateEditEnd.EditValue = this.dateEditStart.DateTime.AddDays(1); |
| | | } |
| | | |
| | | |
| | | private void cekShowWaterLevel_CheckedChanged(object sender, EventArgs e) |
| | | { |
| | | var is_show=this.cekShowWaterLevel.Checked; |
| | | ShowWaterLevel(is_show); |
| | | } |
| | | |
| | | private void ShowWaterLevel(bool is_show) |
| | | { |
| | | this.gbWL1.Visible=is_show; |
| | | this.gbWL2.Visible=is_show; |
| | | //this.colR1s.Visible = is_show; |
| | | //this.colR2s.Visible = is_show; |
| | | //this.colR3s.Visible = is_show; |
| | | //this.colRPump21s.Visible = is_show; |
| | | //this.colRPump22s.Visible = is_show; |
| | | //this.colRPump23s.Visible = is_show; |
| | | //this.colRPump24s.Visible = is_show; |
| | | //this.colRPump25s.Visible = is_show; |
| | | //this.colRPump26s.Visible = is_show; |
| | | //this.colRPump27s.Visible = is_show; |
| | | } |
| | | } |
| | | } |