| | |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using Yw.EPAnet; |
| | | using Yw.Geometry; |
| | | using Yw.Pump; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI.Phart; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | |
| | | { |
| | | 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; |
| | |
| | | { |
| | | 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) |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |