duheng
2024-12-24 f47abf649b85ce5fd21725fedaebba359a6dfd1d
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
79
80
81
82
83
84
namespace Yw.WinFrmUI
{
    public partial class HydroCurveEditDlg : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public HydroCurveEditDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
            this.layoutControl1.SetupLayoutControl();
            this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
        }
 
        /// <summary>
        /// 
        /// </summary>
        public event Action<Yw.Model.HydroCurveInfo> ReloadDataEvent;
 
        private Yw.Model.HydroCurveInfo _curve = null;//曲线
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(Yw.Model.HydroCurveInfo curve)
        {
            if (curve == null)
            {
                return;
            }
            _curve = curve;
            this.hydroCurveEditCtrl1.SetBindingData(curve);
            switch (curve.CurveType)
            {
                case Yw.WinFrmUI.HydroCurveType.CurveQH:
                    {
                        this.Text = "流量扬程曲线";
                    }
                    break;
                case HydroCurveType.CurveQP:
                    {
                        this.Text = "流量功率曲线";
                    }
                    break;
                case HydroCurveType.CurveQE:
                    {
                        this.Text = "流量效率曲线";
                    }
                    break;
                case HydroCurveType.CurveQL:
                    {
                        this.Text = "水头损失曲线";
                    }
                    break;
                case HydroCurveType.CurveOL:
                    {
                        this.Text = "开度损失曲线";
                    }
                    break;
                case HydroCurveType.CurveVol:
                    {
                        this.Text = "容积曲线";
                    }
                    break;
                default: break;
            }
        }
 
        //确定
        private void GeneralOkAndCancelCtrl1_OkEvent()
        {
            var curve = this.hydroCurveEditCtrl1.GetCurveInfo();
            if (curve == null)
            {
                TipFormHelper.ShowWarn("更新失败!");
                return;
            }
            this.ReloadDataEvent?.Invoke(curve);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
 
 
 
    }
}