using DevExpress.XtraEditors;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
using Yw.WinFrmUI.Phart;
|
|
namespace Yw.WinFrmUI
|
{
|
public partial class HydroValveCurveViewCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public HydroValveCurveViewCtrl()
|
{
|
InitializeComponent();
|
}
|
|
private Yw.Model.HydroCurveInfo _curveol = null;//阀门开度曲线
|
private List<Yw.Model.HydroCurveInfo> _curvesql = null;//水头损失曲线列表
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData(Yw.Model.HydroCurveInfo curveOL, List<Yw.Model.HydroCurveInfo> curvesQL)
|
{
|
_curveol = curveOL;
|
_curvesql = curvesQL;
|
var allVmList = new List<ValveViewChartViewModel>();
|
if (curveOL != null)
|
{
|
var vmol = new ValveViewChartViewModel();
|
vmol.Id = curveOL.Code;
|
vmol.Name = curveOL.Name;
|
vmol.Color = Color.Blue;
|
vmol.CurveType = Ahart.eCurveType.OL;
|
vmol.FeatType = Ahart.eFeatType.Quadratic;
|
vmol.DefPointList = curveOL.CurveData?.Select(x => new Geometry.Point2d(x.X, x.Y)).ToList();
|
vmol.IsSelect = false;
|
allVmList.Add(vmol);
|
}
|
if (curvesQL != null && curvesQL.Count > 0)
|
{
|
foreach (var curveql in curvesQL)
|
{
|
var vmql = new ValveViewChartViewModel();
|
vmql.Id = curveql.Code;
|
vmql.Name = curveql.Name;
|
vmql.Color = Color.Green;
|
vmql.CurveType = Ahart.eCurveType.QL;
|
vmql.FeatType = Ahart.eFeatType.Quadratic;
|
vmql.DefPointList = curveql.CurveData?.Select(x => new Geometry.Point2d(x.X, x.Y)).ToList();
|
vmql.IsSelect = false;
|
allVmList.Add(vmql);
|
}
|
}
|
this.valveViewChart1.SetBindingData(allVmList);
|
}
|
|
|
|
}
|
}
|