using Yw.Vmo; namespace HStation.WinFrmUI { public partial class SimulationPumpAnalyWorkingChartCtrl : DevExpress.XtraEditors.XtraUserControl { public SimulationPumpAnalyWorkingChartCtrl() { InitializeComponent(); this.layoutControl1.SetupLayoutControl(); this.hydroWorkingCheckedListHorizCtrl1.CheckedChangedEvent += HydroWorkingCheckedListHorizCtrl1_CheckedChangedEvent; } 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, Yw.Model.HydroPumpInfo pumpInfo, List allWorkingList, Dictionary allCalcuResultDict ) { if (hydroInfo == null) { return; } if (pumpInfo == null) { return; } if (allWorkingList == null || allWorkingList.Count < 1) { return; } if (allCalcuResultDict == null || allCalcuResultDict.Count < 1) { return; } _hydroInfo = hydroInfo; _pumpInfo = pumpInfo; _allWorkingList = allWorkingList; _allCalcuResultDict = allCalcuResultDict; this.hydroWorkingCheckedListHorizCtrl1.SetBindingData(allWorkingList); this.simulationPumpAnalyChartCtrl1.SetBindingData(hydroInfo, pumpInfo, allCalcuResultDict); } //工况选择改变事件 private void HydroWorkingCheckedListHorizCtrl1_CheckedChangedEvent(List allWorkingList) { if (_hydroInfo == null) { return; } if (_pumpInfo == null) { return; } if (_allCalcuResultDict == null || _allCalcuResultDict.Count < 1) { return; } var dict = new Dictionary(); foreach (var working in allWorkingList) { if (_allCalcuResultDict.ContainsKey(working)) { dict.Add(working, _allCalcuResultDict[working]); } } this.simulationPumpAnalyChartCtrl1.SetBindingData(_hydroInfo, _pumpInfo, dict); } } }