using Yw.EPAnet;
|
using Yw.Hydro;
|
namespace Yw.WinFrmUI
|
{
|
public partial class HydroSingleWorkingLossStatisticsCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public HydroSingleWorkingLossStatisticsCtrl()
|
{
|
InitializeComponent();
|
this.layoutControl1.SetupLayoutControl();
|
}
|
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult)
|
{
|
if (hydroInfo == null)
|
{
|
return;
|
}
|
List<Yw.EPAnet.EnergyPoint> allEnergyList = null;
|
var network = hydroInfo.ToNetwork();
|
if (network != null)
|
{
|
if (calcuResult != null)
|
{
|
if (calcuResult.EPAnetCalcuResult != null)
|
{
|
allEnergyList = network.AnalyzeEnergy(calcuResult.EPAnetCalcuResult);
|
}
|
}
|
}
|
SetBindingData(hydroInfo, calcuResult, allEnergyList);
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult, List<Yw.EPAnet.EnergyPoint> allEnergyList)
|
{
|
if (hydroInfo == null)
|
{
|
return;
|
}
|
this.hydroInputEnergyScaleChartCtrl1.SetBindingData(hydroInfo, calcuResult, allEnergyList);
|
this.hydroCatalogLossScaleChartCtrl1.SetBindingData(hydroInfo, calcuResult, allEnergyList);
|
this.hydroEnergyStatisticsBarCtrl1.SetBindingData(hydroInfo, calcuResult, allEnergyList);
|
}
|
|
/// <summary>
|
/// 导出能量输入图片
|
/// </summary>
|
public void ExportInputToImage(string filePath)
|
{
|
this.hydroInputEnergyScaleChartCtrl1.ExportToImage(filePath);
|
}
|
|
/// <summary>
|
/// 导出损失图片
|
/// </summary>
|
public void ExportLossToImage(string filePath)
|
{
|
this.hydroCatalogLossScaleChartCtrl1.ExportToImage(filePath);
|
}
|
|
/// <summary>
|
/// 导出统计图片
|
/// </summary>
|
public void ExportStatisticsToImage(string filePath)
|
{
|
this.hydroEnergyStatisticsBarCtrl1.ExportToImage(filePath);
|
}
|
|
}
|
}
|