lixiaojun
2025-01-22 46f64905a3c309a50c0f245b3350cdeb8dd699c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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);
        }
 
 
 
    }
}