using HStation.WinFrmUI.PhartRelation;
|
|
namespace HStation.WinFrmUI.Xhs
|
{
|
public partial class TankChartShowDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public TankChartShowDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
}
|
|
public async void SetBingingData(long MainID)
|
{
|
var curveList = await new BLL.AssetsTankCoefficient().GetByMainID(MainID);
|
if (curveList != null && curveList.Count > 0)
|
{
|
InitChart(curveList.First().VolCurve);
|
}
|
}
|
|
/* //初始化图表数据
|
public void InitChart(Vmo.XhsTankMainPhartMappingExtensions dto)
|
{
|
if (dto == null)
|
{
|
return;
|
}
|
var diagram = dto.Diagram;
|
if (diagram == null)
|
{
|
return;
|
}
|
var graph_list = diagram.GraphList;
|
if (graph_list == null || !graph_list.Any())
|
{
|
return;
|
}
|
|
var graph_ql = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.TankQL);
|
var graph_ol = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.TankOL);
|
if (graph_ql == null && graph_ol == null)
|
{
|
return;
|
}
|
|
List<Yw.Geometry.Point2d> points_ql = null;
|
if (graph_ql != null)
|
points_ql = PhartPerformCurveHelper.GetFeatPointList(graph_ql.GraphType, graph_ql.GeometryInfo, 12, null);
|
|
List<Yw.Geometry.Point2d> points_ol = null;
|
if (graph_ol != null)
|
points_ol = PhartPerformCurveHelper.GetFeatPointList(graph_ol.GraphType, graph_ol.GeometryInfo, 12, null);
|
Yw.Geometry.CubicSpline2d cubic_spline = null;
|
if (points_ql != null)
|
{
|
cubic_spline = new Yw.Geometry.CubicSpline2d(points_ql);
|
}
|
if (points_ol != null)
|
{
|
cubic_spline = new Yw.Geometry.CubicSpline2d(points_ol);
|
}
|
var disp_paras = diagram.DispParas;
|
var is_calc_disp_paras = string.IsNullOrWhiteSpace(disp_paras);
|
this.xtrPerform2dchart1.SetBindingData(cubic_spline.ToDbString(), disp_paras, is_calc_disp_paras);
|
if (graph_ol != null)
|
{
|
this.xtrPerform2dchart1.SetAxisTitle("阀门开度", "损失系数");
|
}
|
else
|
{
|
this.xtrPerform2dchart1.SetAxisTitle("流量(m³/h)", "水损/m");
|
}
|
}*/
|
|
//初始化图表数据
|
public void InitChart(string curveStr)
|
{
|
this.xtrPerform2dchart1.SetBindingData(curveStr, null);
|
|
this.xtrPerform2dchart1.SetAxisTitle("流量m³/h", "容积m³");
|
}
|
}
|
}
|