ÎļþÃû´Ó WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/13-print/monitor/helper/SimulationPrintMonitorAnalyHelper.cs ÐÞ¸Ä |
| | |
| | | using Mapster; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | namespace Yw.WinFrmUI |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class SimulationPrintMonitorAnalyHelper |
| | | public class HydroMonitorAnalyHelper |
| | | { |
| | | /// <summary> |
| | | /// å建 |
| | | /// </summary> |
| | | public static SimulationPrintMonitorAnalyViewModel Create |
| | | public static HydroMonitorAnalyViewModel Create |
| | | ( |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | List<Yw.Vmo.HydroMonitorVmo> allMonitorList, |
| | |
| | | List<Yw.Vmo.HydroEvaluationVmo> allEvaluationList = null |
| | | ) |
| | | { |
| | | var vm = new SimulationPrintMonitorAnalyViewModel(); |
| | | |
| | | //éªè¯ |
| | | if (hydroInfo == null) |
| | | { |
| | | return vm; |
| | | return default; |
| | | } |
| | | if (allMonitorList == null || allMonitorList.Count < 1) |
| | | { |
| | | return vm; |
| | | return default; |
| | | } |
| | | if (working == null) |
| | | { |
| | | return vm; |
| | | return default; |
| | | } |
| | | |
| | | var vm = new HydroMonitorAnalyViewModel(); |
| | | |
| | | |
| | | //è¿æ»¤æµç¹ï¼ä»
éè¦åææµç¹ |
| | | var monitorList = allMonitorList?.Where(x => x.SourceType == Yw.Hydro.eSourceType.Analyse).ToList(); |
| | | var monitorList = allMonitorList.Where(x => x.SourceType == Yw.Hydro.eSourceType.Analyse).ToList(); |
| | | if (monitorList == null || monitorList.Count < 1) |
| | | { |
| | | return vm; |
| | | } |
| | | |
| | | //èµå¼æ¨¡åä¿¡æ¯ï¼é¿å
å¹²æ° |
| | | //var newHydroInfo = hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); |
| | | //æä»¶å表 |
| | | var allVisualDict = hydroInfo.GetVisualDict(); |
| | | if (allVisualDict == null || allVisualDict.Count < 1) |
| | | { |
| | |
| | | //计ç®ç»æ |
| | | if (calcuResult == null) |
| | | { |
| | | hydroInfo.UpdateWorkingInfo(working.WorkingInfo); |
| | | calcuResult = hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, isHead, allEvaluationList); |
| | | if (!calcuResult.Succeed) |
| | | { |
| | |
| | | var allCalcuVisualDict = calcuResult.GetVisualDict(); |
| | | |
| | | //éåæµç¹ |
| | | vm.Items = new List<SimulationPrintMonitorAnalyItemViewModel>(); |
| | | vm.Items = new List<HydroMonitorAnalyItemViewModel>(); |
| | | foreach (var monitor in monitorList) |
| | | { |
| | | var item = new SimulationPrintMonitorAnalyItemViewModel(monitor, allVisualDict, allCalcuVisualDict); |
| | | var item = new HydroMonitorAnalyItemViewModel(monitor, allVisualDict, allCalcuVisualDict); |
| | | vm.Items.Add(item); |
| | | } |
| | | |