ningshuxia
2025-03-31 d321346f204a69b1929cc39098a5d88f44509e7b
02-desktop/WinFrmUI/IStation.WinFrmUI.Monitor/03-WorkingConditionAnalysis/01-DataIntegration/DataIntegrationPage.cs
@@ -14,10 +14,10 @@
        public DataIntegrationPage()
        {
            InitializeComponent();
            this.PageTitle.Caption = "数据整合";
            this.stationListCtrl1.FocusedChangedEvent += StationListCtrl1_FocusedChangedEvent;
            this.monitorDataSourcesTreeList1.FocusedChangedEvent += MonitorDataSourcesListCtrl1_FocusedChangedEvent;
            this.timeValueSwiftPlotChartView1.SetTimeAxisX( DevExpress.XtraCharts.DateTimeMeasureUnit.Minute);
            PageTitle.Caption = "数据整合";
            stationListCtrl1.FocusedChangedEvent += StationListCtrl1_FocusedChangedEvent;
            monitorDataSourcesTreeList1.FocusedChangedEvent += MonitorDataSourcesListCtrl1_FocusedChangedEvent;
            timeValueSwiftPlotChartView1.SetTimeAxisX(DevExpress.XtraCharts.DateTimeMeasureUnit.Minute);
        }
        public class CurrentViewModel
@@ -46,13 +46,13 @@
        private BLL.StationSignalRecordPacket _bll = new BLL.StationSignalRecordPacket();
        private Model.Station _station = null;
        private Model.MonitorDataSources _monitorDataSources = null;
        private Model.MonitorDataSources _monitorDataSources = null;
        /// <summary>
        /// 清空数据
        /// </summary>
        public void Clear()
        {
        {
        }
        /// <summary>
@@ -60,8 +60,8 @@
        /// </summary>
        public override void InitialDataSource()
        {
            this.stationListCtrl1.SetBindingData();
            this.monitorDataSourcesTreeList1.SetBindingData();
            stationListCtrl1.SetBindingData();
            monitorDataSourcesTreeList1.SetBindingData();
        }
        //泵站变换
@@ -82,12 +82,12 @@
        /// 绑定数据
        /// </summary>
        public void SetBindingData(Model.MonitorDataSources monitorDataSources, Model.Station station)
        {
        {
            if (monitorDataSources == null || station == null)
            {
                return;
            }
            if (this.barCekLoad.Checked)
            if (barCekLoad.Checked)
            {
                return;
            }
@@ -100,8 +100,8 @@
        /// </summary>
        public void SetBindingData(List<Model.StationSignalRecordPacket> packets)
        {
            WaitFrmHelper.ShowWaitForm();
            this.timeValueSwiftPlotChartView1.ClearSeries();
            WaitFrmHelper.ShowWaitForm();
            timeValueSwiftPlotChartView1.ClearSeries();
            if (packets != null && packets.Any())
            {
                var total_flow_list = new List<TimeValue>();
@@ -114,7 +114,7 @@
                    if (station_signal_records == null || !station_signal_records.Any())
                        continue;
                    foreach (var station in station_signal_records)
                    {
                    {
                        var time = station.Time;
                        var total_flow = station.TotalFlow;
                        var total_pressure = station.TotalPressure;
@@ -124,10 +124,10 @@
                        {
                            continue;
                        }
                        if (total_flow<=0&& pump_total_flow<=0)
                        if (total_flow <= 0 && pump_total_flow <= 0)
                        {
                            continue;
                        }
                        }
                        if (pump_total_flow > 0 && Math.Abs(diff_flow) > 2000)
                        {
                            continue;
@@ -135,14 +135,14 @@
                        total_flow = Math.Round(total_flow, 1);
                        pump_total_flow = Math.Round(pump_total_flow, 1);
                        diff_flow = Math.Round(diff_flow, 1);
                        total_pressure = Math.Round(total_pressure,2);
                        total_pressure = Math.Round(total_pressure, 2);
                        if (station.PumpSignalRecords.Exists(x=>x.Rpm<0))
                        if (station.PumpSignalRecords.Exists(x => x.Rpm < 0))
                        {
                            continue;
                            continue;
                        }
                        total_flow_list.Add(new TimeValue(time, total_flow));
                        pump_total_flow_list.Add(new TimeValue(time, pump_total_flow));
@@ -189,15 +189,15 @@
                    //} 
                    #endregion
                }
                this.timeValueSwiftPlotChartView1.SetAxisYTitle("流量");
                this.timeValueSwiftPlotChartView1.AddSwiftPlotSeries("总压力", Color.DarkGray, "总压力", "压力", total_pressure_list);
                this.timeValueSwiftPlotChartView1.AddSwiftPlotSeries("总管流量", Color.Red, "总管流量", "流量", total_flow_list);
                this.timeValueSwiftPlotChartView1.AddSwiftPlotSeries("泵总流量", Color.Blue, "泵总流量", "流量", pump_total_flow_list);
                this.timeValueSwiftPlotChartView1.AddSwiftPlotSeries("偏差流量", Color.Black, "偏差流量", "流量", diff_flow_list);
                timeValueSwiftPlotChartView1.SetAxisYTitle("流量");
                timeValueSwiftPlotChartView1.AddSwiftPlotSeries("总压力", Color.DarkGray, "总压力", "压力", total_pressure_list);
                timeValueSwiftPlotChartView1.AddSwiftPlotSeries("总管流量", Color.Red, "总管流量", "流量", total_flow_list);
                timeValueSwiftPlotChartView1.AddSwiftPlotSeries("泵总流量", Color.Blue, "泵总流量", "流量", pump_total_flow_list);
                timeValueSwiftPlotChartView1.AddSwiftPlotSeries("偏差流量", Color.Black, "偏差流量", "流量", diff_flow_list);
            }
            WaitFrmHelper.HideWaitForm();
        }
@@ -211,12 +211,12 @@
            {
                Task.Run(() =>
                {
                    this.Invoke(new Action(() =>
                    Invoke(new Action(() =>
                    {
                        AlertTool.ShowInfo(Application.OpenForms[0], "提示", "开始整合!");
                    }));
                    var packets = _bll.AnalysisAndSave(_monitorDataSources.ID, _station.ID, timeStep);
                    this.Invoke(new Action(() =>
                    Invoke(new Action(() =>
                    {
                        SetBindingData(packets);
                        AlertTool.ShowInfo(Application.OpenForms[0], "提示", "整合完成!");
@@ -233,7 +233,7 @@
        {
            SetBindingData(_monitorDataSources, _station);
        }
        #region 菜单  
@@ -241,7 +241,7 @@
        private void barBtnRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            InitialDataSource();
        }
        }
        #endregion