From 4bb44a9c6b32cf299f3103f66d720992ec4a89a2 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期一, 17 二月 2025 21:07:49 +0800 Subject: [PATCH] 增加精度分析 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs | 101 ++++++++++++++++---------------------------------- 1 files changed, 33 insertions(+), 68 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs index c724738..42f5bf3 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs @@ -1,15 +1,4 @@ -锘縰sing DevExpress.XtraEditors; -using NPOI.OpenXmlFormats.Dml; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using Yw.EPAnet; +锘縰sing Yw.Vmo; namespace HStation.WinFrmUI { @@ -19,38 +8,43 @@ { InitializeComponent(); this.layoutControl1.SetupLayoutControl(); - this.hydroPumpListStateViewCtrl1.SelectedChangedEvent += HydroPumpRunStatusListCtrl1_SelectedChangedEvent; } + 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(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) + public void SetBindingData + ( + HydroWorkingVmo working, + Yw.Model.HydroModelInfo hydroInfo, + List<HydroMonitorVmo> allMonitorList, + HydroCalcuResult calcuResult + ) { - if (hydroInfo == null) - { - return; - } - if (calcuResult == null) - { - return; - } - if (!calcuResult.Succeed) - { - return; - } - var allCalcuResultVisualDict = calcuResult.GetVisualDict(); - SetBindingData(hydroInfo, allCalcuResultVisualDict); + var allCalcuResultVisualDict = calcuResult?.GetVisualDict(); + SetBindingData(working, hydroInfo, allMonitorList, allCalcuResultVisualDict); } /// <summary> /// 缁戝畾鏁版嵁 /// </summary> - public void SetBindingData(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) + { + return; + } if (hydroInfo == null) { return; @@ -59,51 +53,22 @@ { return; } + _working = working; _hydroInfo = hydroInfo; + _allMonitorList = allMonitorList; _allCalcuResultVisualDict = allCalcuResultVisualDict; - this.hydroEnergyTotalViewCtrl1.SetBindingData(hydroInfo, allCalcuResultVisualDict); - this.hydroPumpListStateViewCtrl1.SetBindingData(hydroInfo); + this.hydroEnergyTotalHorizViewCtrl1.SetBindingData(_hydroInfo, _allCalcuResultVisualDict); + this.simulationSingleWorkingPumpCtrl1.SetBindingData(_working, _hydroInfo, _allMonitorList, _allCalcuResultVisualDict); } - //娉甸�夋嫨鏀瑰彉 - private void HydroPumpRunStatusListCtrl1_SelectedChangedEvent(Yw.Model.HydroPumpInfo pump) + //鏄庣粏鍒楄〃 + private void btnEnergyList_Click(object sender, EventArgs e) { - if (_hydroInfo == null) - { - return; - } - if (_allCalcuResultVisualDict == null || _allCalcuResultVisualDict.Count < 1) - { - return; - } - if (pump == null) - { - return; - } - this.groupForSinglePumpInfo.Text = pump.Name; - this.txtQ.EditValue = null; - this.txtH.EditValue = null; - this.txtP.EditValue = null; - this.txtE.EditValue = null; - if (_allCalcuResultVisualDict.ContainsKey(pump.Code)) - { - var calcuResult = _allCalcuResultVisualDict[pump.Code] as HydroCalcuPumpResult; - if (calcuResult != null) - { - if (pump.LinkStatus == Yw.Hydro.PumpStatus.Open) - { - this.txtQ.EditValue = calcuResult.CalcuQ.HasValue ? $"{Math.Round(calcuResult.CalcuQ.Value, 1)}m鲁/h" : null; - this.txtH.EditValue = calcuResult.CalcuH.HasValue ? $"{Math.Round(calcuResult.CalcuH.Value, 2)}m" : null; - this.txtP.EditValue = calcuResult.CalcuP.HasValue ? $"{Math.Round(calcuResult.CalcuP.Value, 1)}kW" : null; - this.txtE.EditValue = calcuResult.CalcuE.HasValue ? $"{Math.Round(calcuResult.CalcuE.Value, 1)}%" : null; - } - var matching = AssetsMatchingParasHelper.Create(_hydroInfo, pump, _allCalcuResultVisualDict.Values.ToList()); - //this.singlePumpCalcCtrl1.SetBindindData(matching); - } - } - - + var dlg = new HydroPumpGroupEnergyListDlg(); + dlg.SetBindingData(_hydroInfo, _allCalcuResultVisualDict); + dlg.ShowDialog(); } + } } -- Gitblit v1.9.3