duheng
2024-12-10 ff457d72c09f3f0d49e6b79d9461bf596e8945bf
Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0
已修改9个文件
已添加1个文件
193 ■■■■ 文件已修改
Service/HStation.Service.Xhs.Core/00-core/Flags.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyDlg.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/10-analy/SimulationSingleWorkingAnalyCtrl.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationPumpSingleWorkingChartCtrl.cs 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Hydro.Core/00-core/03-helper/HydroFlagsHelper.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Hydro.Core/12-monitor/01-set/SetHydroMonitorListCtrl.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Service/HStation.Service.Xhs.Core/00-core/Flags.cs
@@ -11,6 +11,11 @@
        public const string é»˜è®¤ = "默认";
        /// <summary>
        /// æ€»ç®¡
        /// </summary>
        public const string æ€»ç®¡ = "总管";
        /// <summary>
        /// è¿›å£
        /// </summary>
        public const string è¿›å£ = "进口";
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();
@@ -2263,7 +2270,7 @@
                return;
            }
            SimulationWordReport word = new SimulationWordReport();
            word.Create(fileName);
            //word.Create(fileName);
        }
        #endregion
@@ -2458,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)
@@ -2471,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();
            }
        }
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs
@@ -1663,7 +1663,7 @@
                return;
            }
            var dlg = new SimulationSingleWorkingEnergyDlg();
            dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult);
            //dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult);
            dlg.ShowDialog();
        }
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.cs
@@ -19,11 +19,12 @@
        private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息
        private List<HydroMonitorVmo> _allMonitorList = null;
        /// <summary>
        /// ç»‘定数据
        /// </summary>
        public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, List<HydroWorkingVmo> allWorkingList)
        public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, List<HydroMonitorVmo> allMonitorList, List<HydroWorkingVmo> allWorkingList)
        {
            if (hydroInfo == null)
            {
@@ -34,6 +35,7 @@
                return;
            }
            _hydroInfo = hydroInfo;
            _allMonitorList = allMonitorList;
            this.hydroWorkingListViewCtrl1.SetBindingData(allWorkingList);
            if (allWorkingList.Count < 2)
            {
@@ -66,7 +68,7 @@
            var hydroInfo = _hydroInfo.Adapt<Yw.Model.HydroModelInfo>();
            hydroInfo.UpdateWorkingInfo(working.WorkingInfo);
            var calcuResult = hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss);
            this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, calcuResult);
            this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, _allMonitorList, calcuResult);
        }
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs
@@ -27,21 +27,34 @@
        private HydroWorkingVmo _working = null;//工况
        private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息
        private List<HydroMonitorVmo> _allMonitorList = null;//监测列表
        private Dictionary<string, HydroCalcuVisualResult> _allCalcuResultVisualDict = null;//所有计算结果可见字典
        /// <summary>
        /// ç»‘定数据
        /// </summary>
        public void SetBindingData(HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult)
        public void SetBindingData
            (
                HydroWorkingVmo working,
                Yw.Model.HydroModelInfo hydroInfo,
                 List<HydroMonitorVmo> allMonitorList,
                HydroCalcuResult calcuResult
            )
        {
            var allCalcuResultVisualDict = calcuResult?.GetVisualDict();
            SetBindingData(working, hydroInfo, allCalcuResultVisualDict);
            SetBindingData(working, hydroInfo, allMonitorList, allCalcuResultVisualDict);
        }
        /// <summary>
        /// ç»‘定数据
        /// </summary>
        public void SetBindingData(HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict)
        public void SetBindingData
            (
                HydroWorkingVmo working,
                Yw.Model.HydroModelInfo hydroInfo,
                List<HydroMonitorVmo> allMonitorList,
                Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict
            )
        {
            if (working == null)
            {
@@ -57,9 +70,10 @@
            }
            _working = working;
            _hydroInfo = hydroInfo;
            _allMonitorList = allMonitorList;
            _allCalcuResultVisualDict = allCalcuResultVisualDict;
            this.hydroEnergyTotalHorizViewCtrl1.SetBindingData(_hydroInfo, _allCalcuResultVisualDict);
            this.simulationSingleWorkingPumpCtrl1.SetBindingData(_working, _hydroInfo, null, _allCalcuResultVisualDict);
            this.simulationSingleWorkingPumpCtrl1.SetBindingData(_working, _hydroInfo, _allMonitorList, _allCalcuResultVisualDict);
        }
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyDlg.cs
@@ -13,9 +13,15 @@
        /// <summary>
        /// ç»‘定数据
        /// </summary>
        public void SetBindingData(HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult)
        public void SetBindingData
            (
                HydroWorkingVmo working,
                Yw.Model.HydroModelInfo hydroInfo,
                List<HydroMonitorVmo> allMonitorList,
                HydroCalcuResult calcuResult
            )
        {
            this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, calcuResult);
            this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, allMonitorList, calcuResult);
        }
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/10-analy/SimulationSingleWorkingAnalyCtrl.cs
@@ -32,7 +32,7 @@
            )
        {
            this.hydroSingleWorkingEvaluationCtrl1.SetBindingData(hydroInfo, allMonitorList, working, calcuResult);
            this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, calcuResult);
            this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, allMonitorList, calcuResult);
            this.hydroSingleWorkingLossCurveCtrl1.SetBindingData(hydroInfo, calcuResult, visual);
            this.hydroSingleWorkingLossStatisticsCtrl1.SetBindingData(hydroInfo, calcuResult);
        }
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationPumpSingleWorkingChartCtrl.cs
@@ -100,12 +100,86 @@
            var startSourceMonitor = _allMonitorList?
                .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>()
                { HStation.Xhs.Flags.水源,HStation.Xhs.Flags.始端,HStation.Xhs.Flags.默认});
            if (startSourceMonitor == null)
            {
                startSourceMonitor = _allMonitorList?
                .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>()
                { HStation.Xhs.Flags.水源,HStation.Xhs.Flags.始端});
            }
            if (startSourceMonitor != null)
            {
                var startSourceCalcuResult = _allCalcuResultVisualDict?.GetValue(startSourceMonitor.Relation);
                if (startSourceCalcuResult != null)
                {
                    var startHead = startSourceCalcuResult.GetCalcuValue(startSourceMonitor.PropName);
                    if (startHead.HasValue)
                    {
                        var endSourceMonitor = _allMonitorList?
                                    .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>()
                                    { HStation.Xhs.Flags.水源,HStation.Xhs.Flags.末端,HStation.Xhs.Flags.默认});
                        if (endSourceMonitor == null)
                        {
                            endSourceMonitor = _allMonitorList?
                                        .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>()
                                        { HStation.Xhs.Flags.水源,HStation.Xhs.Flags.末端});
                        }
                        if (endSourceMonitor != null)
                        {
                            var endSouceCalcuResult = _allCalcuResultVisualDict?.GetValue(endSourceMonitor.Relation);
                            if (endSouceCalcuResult != null)
                            {
                                var endHead = endSouceCalcuResult.GetCalcuValue(endSourceMonitor.PropName);
                                if (endHead.HasValue)
                                {
                                    vm.StartH = Math.Round(endHead.Value - startHead.Value, 2);
                                }
                            }
                        }
                    }
                }
            }
            var outPipeFlowMonitor = _allMonitorList?.Matching(HydroVisualCalcuProp.CalcuFlow, new List<string>()
                            { HStation.Xhs.Flags.总管,HStation.Xhs.Flags.出口,HStation.Xhs.Flags.默认});
            if (outPipeFlowMonitor == null)
            {
                outPipeFlowMonitor = _allMonitorList?.Matching(HydroVisualCalcuProp.CalcuFlow, new List<string>()
                        { HStation.Xhs.Flags.总管,HStation.Xhs.Flags.出口});
            }
            if (outPipeFlowMonitor != null)
            {
                var outPipeFlowCalcuResult = _allCalcuResultVisualDict?.GetValue(outPipeFlowMonitor.Relation);
                if (outPipeFlowCalcuResult != null)
                {
                    var outPipeFlow = outPipeFlowCalcuResult.GetCalcuValue(outPipeFlowMonitor.PropName);
                    if (outPipeFlow.HasValue)
                    {
                        vm.PipeQ = Math.Round(outPipeFlow.Value, 1);
                    }
                }
            }
            var outPipeHeadMonitor = _allMonitorList?.Matching(HydroVisualCalcuProp.CalcuHead, new List<string>()
                            { HStation.Xhs.Flags.总管,HStation.Xhs.Flags.出口,HStation.Xhs.Flags.默认});
            if (outPipeHeadMonitor == null)
            {
                outPipeHeadMonitor = _allMonitorList?.Matching(HydroVisualCalcuProp.CalcuHead, new List<string>()
                            { HStation.Xhs.Flags.总管,HStation.Xhs.Flags.出口});
            }
            vm.StartH = 2;
            if (outPipeHeadMonitor != null)
            {
                var outPipeHeadCalcuResult = _allCalcuResultVisualDict?.GetValue(outPipeHeadMonitor.Relation);
                if (outPipeHeadCalcuResult != null)
                {
                    var outPipeHead = outPipeHeadCalcuResult.GetCalcuValue(outPipeHeadMonitor.PropName);
                    if (outPipeHead.HasValue)
                    {
                        vm.PipeH = Math.Round(outPipeHead.Value, 2);
                    }
                }
            }
            if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0)
            {
@@ -167,9 +241,6 @@
                        }
                    }
                    vm.PipeQ = vm.Items.Sum(t => t.Q);
                    vm.PipeH = vm.Items.Max(t => t.H);
                }
            }
WinFrmUI/Yw.WinFrmUI.Hydro.Core/00-core/03-helper/HydroFlagsHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yw.WinFrmUI
{
    /// <summary>
    ///
    /// </summary>
    public class HydroFlagsHelper
    {
        //
        // æ‘˜è¦:
        //     åˆ†éš”符
        public const string Separator = ",";
        //
        // æ‘˜è¦:
        //     è½¬åŒ–为字符串
        public static string ToString(List<string> list)
        {
            if (list == null || !list.Any())
            {
                return string.Empty;
            }
            list = list.Select(x => x.Trim()).ToList();
            return string.Join(",", list);
        }
        //
        // æ‘˜è¦:
        //     è½¬åŒ–为列表
        public static List<string> ToList(string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                return new List<string>();
            }
            var list = str.Split(new string[1] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
            return list?.Select(x => x.Trim()).ToList();
        }
    }
}
WinFrmUI/Yw.WinFrmUI.Hydro.Core/12-monitor/01-set/SetHydroMonitorListCtrl.cs
@@ -85,7 +85,7 @@
            var list = _allBindingList?.Where(x => x.Checked).ToList();
            list?.ForEach(x =>
            {
                x.Vmo.Flags = Yw.Untity.FlagsHelper.ToList(x.Flags);
                x.Vmo.Flags = HydroFlagsHelper.ToList(x.Flags);
                x.Vmo.Description = x.Description;
            });
            return list?.Select(x => x.Vmo).ToList();