lixiaojun
2024-12-10 a5872f7ed264a634c809b026d4d181f99a78db1d
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -1540,6 +1540,13 @@
            return _monitorHelper;
        }
        //获取监测点列表
        private async Task<List<HydroMonitorVmo>> GetMonitorList()
        {
            var helper = GetMonitorHelper();
            return await helper.Get();
        }
        //设置监测点列表
        private async void SetMonitorList(HydroVisualInfo visual)
        {
@@ -1599,7 +1606,7 @@
        private void ResetMonitorValue()
        {
            var allWorkingList = GetWorkingList();
            var working = allWorkingList?.Last(x => !string.IsNullOrEmpty(x.MonitorInfo));
            var working = allWorkingList?.LastOrDefault(x => !string.IsNullOrEmpty(x.MonitorInfo));
            if (working != null)
            {
                var helper = GetMonitorValueHelper();
@@ -2197,6 +2204,7 @@
                        ShowCalcuWarningCtrl(calcuResult);
                    }
                    this.barBtnAddWorking.Enabled = true;
                    this.barBtnExportWord.Enabled = true;
                    TipFormHelper.ShowSucceed("计算成功!");
                }
                else
@@ -2248,6 +2256,21 @@
        private void barBtnCalcu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Calcu();
        }
        #endregion
        #region 导出报告
        private void barBtnExportWord_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var fileName = FileDialogHelper.SaveWordDoc("导出Word报告");
            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }
            SimulationWordReport word = new SimulationWordReport();
            //word.Create(fileName);
        }
        #endregion
@@ -2367,6 +2390,27 @@
        #region 工况分析
        //选择进口水源
        private void SelectInputSource()
        {
            var sources = GetSourceList();
            if (sources != null)
            {
                if (sources.Count == 1)
                {
                    SelectVisual(sources[0], eVisualSource.None);
                }
                else
                {
                    var source = sources.FirstOrDefault(x => x.Flags.Contains(HStation.Xhs.Flags.进口));
                    if (source != null)
                    {
                        SelectVisual(source, eVisualSource.None);
                    }
                }
            }
        }
        //精度评估
        private async void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
@@ -2421,8 +2465,9 @@
        }
        //能效分析
        private void barBtnWorkingPower_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        private async void barBtnWorkingPower_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var allMonitorList = await GetMonitorList();
            var workingCheckedListHelper = GetWorkingCheckedListHelper();
            var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList();
            if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1)
@@ -2434,14 +2479,14 @@
                    return;
                }
                var dlg = new SimulationSingleWorkingEnergyDlg();
                dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult);
                dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, allMonitorList, workingHelper.CalcuResult);
                dlg.ShowDialog();
            }
            else
            {
                var dlg = new SimulationMultiWorkingEnergyDlg();
                dlg.SetBindingData(_hydroInfo, allCheckedWorkingList);
                dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList);
                dlg.ShowDialog();
            }
        }
@@ -2451,22 +2496,7 @@
        {
            if (_visual == null)
            {
                var sources = GetSourceList();
                if (sources != null)
                {
                    if (sources.Count == 1)
                    {
                        SelectVisual(sources[0], eVisualSource.None);
                    }
                    else
                    {
                        var source = sources.FirstOrDefault(x => x.Flags.Contains(HStation.Xhs.Flags.进口));
                        if (source != null)
                        {
                            SelectVisual(source, eVisualSource.None);
                        }
                    }
                }
                SelectInputSource();
                if (_visual == null)
                {
                    TipFormHelper.ShowWarn("请选择构件后重试!");
@@ -2540,26 +2570,14 @@
        {
            if (_visual == null)
            {
                var sources = GetSourceList();
                if (sources != null)
                {
                    if (sources.Count == 1)
                    {
                        SelectVisual(sources[0], eVisualSource.None);
                    }
                    else
                    {
                        var source = sources.FirstOrDefault(x => x.Flags.Contains(HStation.Xhs.Flags.进口));
                        if (source != null)
                        {
                            SelectVisual(source, eVisualSource.None);
                        }
                    }
                }
                if (_visual == null)
                {
                    TipFormHelper.ShowWarn("请选择构件后重试!");
                    return;
                    SelectInputSource();
                    if (_visual == null)
                    {
                        TipFormHelper.ShowWarn("请选择构件后重试!");
                        return;
                    }
                }
            }
            HydroVisualInfo visual = _visual;
@@ -2602,5 +2620,6 @@
    }
}