Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0
| | |
| | | public const string é»è®¤ = "é»è®¤"; |
| | | |
| | | /// <summary> |
| | | /// æ»ç®¡ |
| | | /// </summary> |
| | | public const string æ»ç®¡ = "æ»ç®¡"; |
| | | |
| | | /// <summary> |
| | | /// è¿å£ |
| | | /// </summary> |
| | | public const string è¿å£ = "è¿å£"; |
| | |
| | | return _monitorHelper; |
| | | } |
| | | |
| | | //è·åçæµç¹å表 |
| | | private async Task<List<HydroMonitorVmo>> GetMonitorList() |
| | | { |
| | | var helper = GetMonitorHelper(); |
| | | return await helper.Get(); |
| | | } |
| | | |
| | | //è®¾ç½®çæµç¹å表 |
| | | private async void SetMonitorList(HydroVisualInfo visual) |
| | | { |
| | |
| | | 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(); |
| | |
| | | return; |
| | | } |
| | | SimulationWordReport word = new SimulationWordReport(); |
| | | word.Create(fileName); |
| | | //word.Create(fileName); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | } |
| | | |
| | | //è½æåæ |
| | | 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) |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | var dlg = new SimulationSingleWorkingEnergyDlg(); |
| | | dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult); |
| | | //dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | 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) |
| | | { |
| | |
| | | return; |
| | | } |
| | | _hydroInfo = hydroInfo; |
| | | _allMonitorList = allMonitorList; |
| | | this.hydroWorkingListViewCtrl1.SetBindingData(allWorkingList); |
| | | if (allWorkingList.Count < 2) |
| | | { |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | 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) |
| | | { |
| | |
| | | } |
| | | _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); |
| | | } |
| | | |
| | | |
| | |
| | | /// <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); |
| | | } |
| | | |
| | | |
| | |
| | | ) |
| | | { |
| | | 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); |
| | | } |
| | |
| | | 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) |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | vm.PipeQ = vm.Items.Sum(t => t.Q); |
| | | vm.PipeH = vm.Items.Max(t => t.H); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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(); |