using Mapster; using Yw.Vmo; namespace HStation.WinFrmUI { public partial class SimulationPumpAnalyWorkingCtrl : DevExpress.XtraEditors.XtraUserControl { public SimulationPumpAnalyWorkingCtrl() { InitializeComponent(); this.layoutControl1.SetupLayoutControl(); this.hydroPumpAnalyWorkingPumpListCtrl1.SelectedChangedEvent += HydroPumpListViewCtrl1_SelectedChangedEvent; } private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息 private Yw.Model.HydroPumpInfo _pumpInfo = null;//水泵信息 private List _allWorkingList = null;//所有工况列表 private Dictionary _allCalcuResultDict = null;//计算结果字典 /// /// 绑定数据 /// public void SetBindingData ( Yw.Model.HydroModelInfo hydroInfo, List allWorkingList, bool isHead = false, List allEvaluationList = null ) { if (hydroInfo == null) { return; } if (allWorkingList == null || allWorkingList.Count < 1) { return; } _hydroInfo = hydroInfo.Adapt(); _allWorkingList = allWorkingList; _allCalcuResultDict = new Dictionary(); foreach (var working in allWorkingList) { _hydroInfo.UpdateWorkingInfo(working.WorkingInfo); var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, isHead, allEvaluationList); if (calcuResult.Succeed) { var vm = HydroPumpAnalyHelper.Create(_hydroInfo, working, calcuResult, isHead, allEvaluationList); _allCalcuResultDict.Add(working, vm); } } this.hydroPumpAnalyWorkingPumpListCtrl1.SetBindingData(_hydroInfo, _allCalcuResultDict); } //水泵选择改变 private void HydroPumpListViewCtrl1_SelectedChangedEvent(Yw.Model.HydroPumpInfo pumpInfo) { if (_hydroInfo == null) { return; } if (pumpInfo == null) { return; } _pumpInfo = pumpInfo; this.simulationPumpAnalyWorkingChartCtrl1.SetBindingData(_hydroInfo, pumpInfo, _allWorkingList, _allCalcuResultDict); } } }