| | |
| | | public DataCorrectionPage() |
| | | { |
| | | InitializeComponent(); |
| | | this.PageTitle.Caption = "数据修正"; |
| | | PageTitle.Caption = "数据修正"; |
| | | |
| | | this.gridView1.SetNormalView(); |
| | | this.gridView2.SetNormalView(); |
| | | gridView1.SetNormalView(); |
| | | gridView2.SetNormalView(); |
| | | |
| | | this.colYear.Visible = false; |
| | | this.colMonth.Visible = false; |
| | | this.colHzRound.Visible = false; |
| | | this.colPower.Visible = false; |
| | | this.colWaterLevel.Visible = false; |
| | | this.colInletPressure.Visible = false; |
| | | colYear.Visible = false; |
| | | colMonth.Visible = false; |
| | | colHzRound.Visible = false; |
| | | colPower.Visible = false; |
| | | colWaterLevel.Visible = false; |
| | | colInletPressure.Visible = false; |
| | | |
| | | this.colTime.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; |
| | | this.colTime.DisplayFormat.FormatString = "G"; |
| | | colTime.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; |
| | | colTime.DisplayFormat.FormatString = "G"; |
| | | |
| | | |
| | | this.repositoryItemDateEdit1.SetOnlyShowYearMonth(); |
| | | this.repositoryItemDateEdit2.SetOnlyShowYearMonth(); |
| | | this.barEditDateStart.EditValue = new DateTime(2024, 1, 1); |
| | | this.barEditDateEnd.EditValue = new DateTime(2024, 9, 1); |
| | | repositoryItemDateEdit1.SetOnlyShowYearMonth(); |
| | | repositoryItemDateEdit2.SetOnlyShowYearMonth(); |
| | | barEditDateStart.EditValue = new DateTime(2024, 1, 1); |
| | | barEditDateEnd.EditValue = new DateTime(2024, 9, 1); |
| | | |
| | | this.cmbFlag.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; |
| | | cmbFlag.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; |
| | | |
| | | this.stationListCtrl1.FocusedChangedEvent += StationListCtrl1_FocusedChangedEvent; |
| | | this.monitorDataSourcesTreeList1.FocusedChangedEvent += MonitorDataSourcesListCtrl1_FocusedChangedEvent; |
| | | stationListCtrl1.FocusedChangedEvent += StationListCtrl1_FocusedChangedEvent; |
| | | monitorDataSourcesTreeList1.FocusedChangedEvent += MonitorDataSourcesListCtrl1_FocusedChangedEvent; |
| | | |
| | | InitialDiagarm(); |
| | | } |
| | |
| | | |
| | | private void InitialDiagarm() |
| | | { |
| | | this.chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;//是否在图表上显示图例 |
| | | this.chartControl1.CrosshairOptions.ShowOnlyInFocusedPane = false; |
| | | chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;//是否在图表上显示图例 |
| | | chartControl1.CrosshairOptions.ShowOnlyInFocusedPane = false; |
| | | // Access the diagram's properties.把 Diagram 对象转换为所需的图象类型 |
| | | _diagram = (SwiftPlotDiagram)this.chartControl1.Diagram; |
| | | _diagram = (SwiftPlotDiagram)chartControl1.Diagram; |
| | | _diagram.EnableAxisXScrolling = true;//X轴是否允许滚动 |
| | | _diagram.EnableAxisXZooming = true;//X轴是否允许缩放 |
| | | _diagram.PaneLayout.Direction = PaneLayoutDirection.Vertical;//窗格的对齐方式 |
| | |
| | | |
| | | public void Round() |
| | | { |
| | | if (this.STDP.HasValue) |
| | | if (STDP.HasValue) |
| | | { |
| | | this.STDP = Math.Round(this.STDP.Value, 5); |
| | | STDP = Math.Round(STDP.Value, 5); |
| | | } |
| | | if (this.STDPHead.HasValue) |
| | | if (STDPHead.HasValue) |
| | | { |
| | | this.STDPHead = Math.Round(this.STDPHead.Value, 5); |
| | | STDPHead = Math.Round(STDPHead.Value, 5); |
| | | } |
| | | |
| | | } |
| | |
| | | public void Clear() |
| | | { |
| | | _pump_vm_list = new List<PumpViewModel>(); |
| | | this.cmbFlag.SelectedItem = null; |
| | | this.cmbFlag.Properties.Items.Clear(); |
| | | this.pumpViewModelBindingSource.DataSource = new List<PumpViewModel>(); |
| | | this.pumpFactorViewModelBindingSource.DataSource = new List<PumpFactorViewModel>(); |
| | | cmbFlag.SelectedItem = null; |
| | | cmbFlag.Properties.Items.Clear(); |
| | | pumpViewModelBindingSource.DataSource = new List<PumpViewModel>(); |
| | | pumpFactorViewModelBindingSource.DataSource = new List<PumpFactorViewModel>(); |
| | | |
| | | ClearChart(); |
| | | } |
| | |
| | | private void ClearChart() |
| | | { |
| | | |
| | | this.chartControl1.BeginInit(); |
| | | chartControl1.BeginInit(); |
| | | _series_default_head.Points.Clear(); |
| | | _series_curve_head.Points.Clear(); |
| | | _series_correct_curve_head.Points.Clear(); |
| | | |
| | | _series_head_diff.Points.Clear(); |
| | | _series_hz.Points.Clear(); |
| | | this.chartControl1.EndInit(); |
| | | chartControl1.EndInit(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public override void InitialDataSource() |
| | | { |
| | | this.stationListCtrl1.SetBindingData(); |
| | | this.monitorDataSourcesTreeList1.SetBindingData(); |
| | | stationListCtrl1.SetBindingData(); |
| | | monitorDataSourcesTreeList1.SetBindingData(); |
| | | } |
| | | |
| | | //泵站变换 |
| | |
| | | { |
| | | return; |
| | | } |
| | | if (this.barCekLoad.Checked) |
| | | if (barCekLoad.Checked) |
| | | { |
| | | return; |
| | | } |
| | |
| | | } |
| | | flag_qh_curve_dict.Add(pump.SortCode, qh); |
| | | } |
| | | this.cmbFlag.Properties.Items.AddRange(flag_list); |
| | | cmbFlag.Properties.Items.AddRange(flag_list); |
| | | |
| | | var pipe_flow_id_list = GlobalHelper.GetPipeFlowIdList(station.SortCode); |
| | | var pipe_pressure_id_list = GlobalHelper.GetPipePressureIdList(station.SortCode); |
| | | var pipe_flow_id_list = GlobalHelperW.GetPipeFlowIdList(station.SortCode); |
| | | var pipe_pressure_id_list = GlobalHelperW.GetPipePressureIdList(station.SortCode); |
| | | SetBindingData(packets, pipe_flow_id_list, pipe_pressure_id_list, flag_pump_dict, flag_qh_curve_dict); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData(List<Model.StationSignalRecordPacket> packet_list,List<string> pipe_flow_id_list, List<string> pipe_pressure_id_list, Dictionary<int, Model.Pump> flag_pump_dict, Dictionary<int, Model.CurveExpress> flag_qh_curve_dict) |
| | | public void SetBindingData(List<Model.StationSignalRecordPacket> packet_list, List<string> pipe_flow_id_list, List<string> pipe_pressure_id_list, Dictionary<int, Model.Pump> flag_pump_dict, Dictionary<int, Model.CurveExpress> flag_qh_curve_dict) |
| | | { |
| | | if (packet_list == null || !packet_list.Any()) |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | var dt_start = Convert.ToDateTime(this.barEditDateStart.EditValue); |
| | | var dt_end = Convert.ToDateTime(this.barEditDateEnd.EditValue); |
| | | var dt_start = Convert.ToDateTime(barEditDateStart.EditValue); |
| | | var dt_end = Convert.ToDateTime(barEditDateEnd.EditValue); |
| | | packet_list = packet_list.Where(x => (x.Year >= dt_start.Year && x.Year <= dt_end.Year) && (x.Month >= dt_start.Month && x.Month <= dt_end.Month)).ToList(); |
| | | if (packet_list == null || !packet_list.Any()) |
| | | { |
| | |
| | | var pump_signal_records = station_record.PumpSignalRecords; |
| | | if (pump_signal_records == null || !pump_signal_records.Any()) |
| | | continue; |
| | | pump_signal_records = pump_signal_records.OrderBy(x => x.Flag).ToList(); |
| | | pump_signal_records = pump_signal_records.OrderBy(x => x.Flag).ToList(); |
| | | foreach (var pump_record in pump_signal_records) |
| | | { |
| | | if (pump_record.Rpm == IStation.Error.Default || pump_record.Head == IStation.Error.Default) |
| | |
| | | vm_pump.Head = pump_record.Head; |
| | | vm_pump.Power = pump_record.InstantaneousPower; |
| | | |
| | | var curve_head = GetCurveHead(curve_qh, pump.Nr, pump_record.Rpm, pump_record.FlowRate); |
| | | curve_head = Math.Round(curve_head, 2); |
| | | var curve_head = GetCurveHead(curve_qh, pump.Nr, pump_record.Rpm, pump_record.FlowRate); |
| | | curve_head = Math.Round(curve_head, 2); |
| | | var pump_head50hz = Model.CurveCalcuHelper.Calculate50HByHz(vm_pump.Head, hz); |
| | | var curve_head50hz = Model.CurveCalcuHelper.Calculate50HByHz(curve_head, hz); |
| | | |
| | |
| | | |
| | | |
| | | _pump_vm_list = vm_list; |
| | | this.pumpViewModelBindingSource.DataSource = vm_list; |
| | | this.pumpViewModelBindingSource.ResetBindings(false); |
| | | this.gridView1.BestFitColumns(); |
| | | pumpViewModelBindingSource.DataSource = vm_list; |
| | | pumpViewModelBindingSource.ResetBindings(false); |
| | | gridView1.BestFitColumns(); |
| | | |
| | | this.pumpFactorViewModelBindingSource.DataSource = vm_pump_facotr_list; |
| | | this.pumpFactorViewModelBindingSource.ResetBindings(false); |
| | | this.gridView2.BestFitColumns(); |
| | | pumpFactorViewModelBindingSource.DataSource = vm_pump_facotr_list; |
| | | pumpFactorViewModelBindingSource.ResetBindings(false); |
| | | gridView2.BestFitColumns(); |
| | | |
| | | WaitFrmHelper.HideWaitForm(); |
| | | } |
| | |
| | | ClearChart(); |
| | | if (_pump_vm_list == null || !_pump_vm_list.Any()) |
| | | return; |
| | | if (!int.TryParse(this.cmbFlag.Text, out int flag)) |
| | | if (!int.TryParse(cmbFlag.Text, out int flag)) |
| | | return; |
| | | var vm_list = _pump_vm_list.Where(x => x.Flag == flag).ToList(); |
| | | if (vm_list == null || !vm_list.Any()) |
| | | return; |
| | | this.chartControl1.BeginInit(); |
| | | chartControl1.BeginInit(); |
| | | foreach (var vm in vm_list) |
| | | { |
| | | //if (Math.Abs(vm.HeadDiff) > 2) |
| | |
| | | _series_hz.Points.Add(new SeriesPoint(time, vm.Hz)); |
| | | } |
| | | |
| | | this.chartControl1.EndInit(); |
| | | chartControl1.EndInit(); |
| | | } |
| | | |
| | | //加载 |
| | |
| | | //全部展开 |
| | | private void barBtnExpandAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | this.gridView1.ExpandAllGroups(); |
| | | gridView1.ExpandAllGroups(); |
| | | } |
| | | |
| | | //全部折叠 |
| | | private void barBtnCollapseAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | this.gridView1.CollapseAllGroups(); |
| | | gridView1.CollapseAllGroups(); |
| | | } |
| | | |
| | | //检索 |
| | | private void barCekSearch_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (this.barCekSearch.Checked) |
| | | this.gridView1.ShowFindPanel(); |
| | | if (barCekSearch.Checked) |
| | | gridView1.ShowFindPanel(); |
| | | else |
| | | this.gridView1.HideFindPanel(); |
| | | gridView1.HideFindPanel(); |
| | | } |
| | | |
| | | // 刷新数据 |
| | |
| | | } |
| | | |
| | | var pump_record_list = packets.SelectMany(x => x.StationSignalRecords.SelectMany(s => s.PumpSignalRecords)).ToList(); |
| | | var flag_pump_record_list = pump_record_list.OrderBy(x=>x.Flag).GroupBy(x => x.Flag); |
| | | |
| | | |
| | | var flag_pump_record_list = pump_record_list.OrderBy(x => x.Flag).GroupBy(x => x.Flag); |
| | | |
| | | var str_build = new StringBuilder(); |
| | | var min_sum_flow = 0d; |
| | |
| | | var pump = flag_pump_dict[flag]; |
| | | if (item.Count() < 100) |
| | | continue; |
| | | |
| | | |
| | | if (pump.IsBp) |
| | | { |
| | | var record_list = item.Where(x => x.Rpm >= 100).OrderBy(x => x.Rpm).ToList(); |
| | |
| | | var low_qh = Model.CurveCalcuHelper.CalculateSimilarQH(flag_qh_curve_dict[flag], pump.Nr, low_rpm); |
| | | var high_qh = Model.CurveCalcuHelper.CalculateSimilarQH(flag_qh_curve_dict[flag], pump.Nr, high_rpm); |
| | | |
| | | |
| | | var low_flow = Model.FitCurveHelper.GetInterPointExX(low_qh.GetFitPoints(), low_avg_head).First().X; |
| | | var high_flow = Model.FitCurveHelper.GetInterPointX(high_qh.GetFitPoints(), high_avg_head).First().X; |
| | | |
| | |
| | | //record_list = record_list.OrderByDescending(x => x.Head).ToList(); |
| | | //var high_record_list = record_list.Take(500).ToList(); |
| | | //var high_avg_head = high_record_list.Average(x => x.Head); |
| | | |
| | | |
| | | //var low_flow = Model.FitCurveHelper.GetInterPointExX(flag_qh_curve_dict[flag].GetFitPoints(), low_avg_head).First().X; |
| | | //var high_flow = Model.FitCurveHelper.GetInterPointX(flag_qh_curve_dict[flag].GetFitPoints(), high_avg_head).First().X; |
| | | |
| | |
| | | //str_build.AppendLine($"最小转速:{pump.Nr}(时间点数量:{500}) 平均扬程={low_avg_head:N2} 曲线流量:{low_flow:N0}"); |
| | | //str_build.AppendLine($"最大转速:{pump.Nr}(时间点数量:{500}) 平均扬程={high_avg_head:N2} 曲线流量={high_flow:N0}"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | str_build.AppendLine($"最小流量:{min_sum_flow:N0} 最大流量:{max_sum_flow:N0}"); |
| | | var msg = str_build.ToString(); |
| | | |
| | | |
| | | } |
| | | |
| | | private Tuple<double,double> GetNum(List<double> list) |
| | | private Tuple<double, double> GetNum(List<double> list) |
| | | { |
| | | var groups = list.GroupBy(x => x); |
| | | var max_count_item = groups.OrderBy(x => x.Count()).Last(); |
| | | return new Tuple<double, double>(max_count_item.Key,max_count_item.Count()); |
| | | return new Tuple<double, double>(max_count_item.Key, max_count_item.Count()); |
| | | } |
| | | } |
| | | } |