using Yw.Vmo;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class SimulationPumpAnalyWorkingChartCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public SimulationPumpAnalyWorkingChartCtrl()
|
{
|
InitializeComponent();
|
this.layoutControl1.SetupLayoutControl();
|
this.hydroPumpAnalyWorkingCheckedListCtrl1.CheckedChangedEvent += HydroWorkingCheckedListHorizCtrl1_CheckedChangedEvent;
|
}
|
|
private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息
|
private Yw.Model.HydroPumpInfo _pumpInfo = null;//水泵信息
|
private List<HydroWorkingVmo> _allWorkingList = null;//所有工况列表
|
private Dictionary<HydroWorkingVmo, HydroPumpAnalyViewModel> _allCalcuResultDict = null;//计算结果字典
|
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData
|
(
|
Yw.Model.HydroModelInfo hydroInfo,
|
Yw.Model.HydroPumpInfo pumpInfo,
|
List<HydroWorkingVmo> allWorkingList,
|
Dictionary<HydroWorkingVmo, HydroPumpAnalyViewModel> 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.hydroPumpAnalyWorkingCheckedListCtrl1.SetBindingData(_pumpInfo, _allCalcuResultDict);
|
this.simulationPumpAnalyChartCtrl1.SetBindingData(hydroInfo, pumpInfo, allCalcuResultDict);
|
}
|
|
//工况选择改变事件
|
private void HydroWorkingCheckedListHorizCtrl1_CheckedChangedEvent(List<HydroWorkingVmo> allWorkingList)
|
{
|
if (_hydroInfo == null)
|
{
|
return;
|
}
|
if (_pumpInfo == null)
|
{
|
return;
|
}
|
if (_allCalcuResultDict == null || _allCalcuResultDict.Count < 1)
|
{
|
return;
|
}
|
var dict = new Dictionary<HydroWorkingVmo, HydroPumpAnalyViewModel>();
|
foreach (var working in allWorkingList)
|
{
|
if (_allCalcuResultDict.ContainsKey(working))
|
{
|
dict.Add(working, _allCalcuResultDict[working]);
|
}
|
}
|
this.simulationPumpAnalyChartCtrl1.SetBindingData(_hydroInfo, _pumpInfo, dict);
|
}
|
|
|
}
|
}
|