duheng
2024-09-27 24c2e282bac49627cc1cbac2d4b8df73c1d066b7
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
67
68
69
70
71
72
73
74
75
76
77
78
namespace HStation.WinFrmUI.PhartRelation
{
    public partial class XtrPerform2dMultiViewDlg : XtraForm
    {
        public XtrPerform2dMultiViewDlg()
        {
            InitializeComponent();
        }
 
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="list">id,名称,转速比,颜色,...</param>
        /// <param name="only_line"></param>
        /// <param name="is_parallel"></param>
        public void SetBindingData(List<Tuple<long, string, double, Color, Yw.Pump.CurveQH, Yw.Pump.CurveQE, Yw.Pump.CurveQP>> list,bool only_line, bool is_parallel = true)
        {
            if (list == null || !list.Any())
            {
                return;
            }
            var helper = new Yw.WinFrmUI.Phart.ParallelConnectionHelper();
            foreach (var item in list)
            {
                var id = item.Item1;
                var name = item.Item2;
                var hz = item.Item3 * 50;
                var color = item.Item4;
                var qh = item.Item5;
                var qe = item.Item6;
                var qp = item.Item7;
 
                Yw.Geometry.CubicSpline2d cubic_spline_qh = null, cubic_spline_qe = null, cubic_spline_qp = null;
                cubic_spline_qh = new Yw.Geometry.CubicSpline2d(qh.FeatCurve.GetPointList());
                if (qe != null)
                    cubic_spline_qe = new Yw.Geometry.CubicSpline2d(qe.FeatCurve.GetPointList());
                if (qp != null)
                    cubic_spline_qp = new Yw.Geometry.CubicSpline2d(qp.FeatCurve.GetPointList());
 
                cubic_spline_qh = Yw.WinFrmUI.Phart.Perform2dCalcHelper.CalculateSimilarQH(cubic_spline_qh, 50, hz);
                cubic_spline_qe = Yw.WinFrmUI.Phart.Perform2dCalcHelper.CalculateSimilarQE(cubic_spline_qe, 50, hz);
                cubic_spline_qp = Yw.WinFrmUI.Phart.Perform2dCalcHelper.CalculateSimilarQP(cubic_spline_qp, 50, hz);
 
                if (!only_line)
                {
                    this.xtrPerform2dMultiChart1.Add(id, name, color, cubic_spline_qh, cubic_spline_qe, cubic_spline_qp);
                } 
 
                helper.Add(cubic_spline_qh, cubic_spline_qp);
            }
 
            var calc_bol = false;
            var line_name = "";
            List<Yw.Geometry.Point2d> pt_qh_list;
            List<Yw.Geometry.Point2d> pt_qe_list;
            List<Yw.Geometry.Point2d> pt_qp_list;
            if (is_parallel)
            {
                line_name = "并联曲线";
                calc_bol = helper.CalculateParallel(out pt_qh_list, out pt_qe_list, out pt_qp_list);
            }
            else
            {
                line_name = "串联曲线";
                calc_bol = helper.CalculateSeries(out pt_qh_list, out pt_qe_list, out pt_qp_list);
            }
 
            if (!calc_bol)
                return;
 
            this.xtrPerform2dMultiChart1.Add(-1, line_name, System.Drawing.Color.Black, pt_qh_list, pt_qe_list, pt_qp_list);
        }
         
 
 
    }
}