ningshuxia
2025-03-12 2596928b751bb5edc6ff0537c3950d0cabaf2018
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
namespace HStation.WinFrmUI
{
    public partial class SimulationPumpCurveEditDlg : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public SimulationPumpCurveEditDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
            this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
        }
 
        /// <summary>
        /// 重载数据
        /// 第一个QH
        /// 第二个QP
        /// 第三个QE
        /// </summary>
        public event Action<List<Yw.Geometry.Point2d>, List<Yw.Geometry.Point2d>, List<Yw.Geometry.Point2d>> ReloadDataEvent;
 
        /// <summary>
        /// 绑定数据
        /// </summary> 
        public void SetBindingData
            (
                List<Yw.Geometry.Point2d> curveqh,
                List<Yw.Geometry.Point2d> curveqp,
                List<Yw.Geometry.Point2d> curveqe
            )
        {
            if (curveqh == null)
            {
                return;
            }
            if (curveqp == null)
            {
                return;
            }
            if (curveqe == null)
            {
                return;
            }
            var curveqh_rhs = curveqh.Select(x => new Yw.Geometry.Point2d(Math.Round(x.X, 1), Math.Round(x.Y, 2))).ToList();
            var curveqp_rhs = curveqp.Select(x => new Yw.Geometry.Point2d(Math.Round(x.X, 1), Math.Round(x.Y, 1))).ToList();
            var curveqe_rhs = curveqe.Select(x => new Yw.Geometry.Point2d(Math.Round(x.X, 1), Math.Round(x.Y, 1))).ToList();
            this.pumpChartExcelEditCtrl1.SetBindingData(curveqh_rhs, curveqe_rhs, curveqp_rhs);
        }
 
        //确定
        private void GeneralOkAndCancelCtrl1_OkEvent()
        {
            var bol = this.pumpChartExcelEditCtrl1.Get
                (
                    out var curveqh,
                    out var curveqe,
                    out var curveqp,
                    out var featqh,
                    out var featqe,
                    out var featqp
                );
            if (!bol)
            {
                TipFormHelper.ShowError("更新失败!");
                return;
            }
            this.ReloadDataEvent?.Invoke(curveqh, curveqp, curveqe);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
 
 
    }
}