lixiaojun
2024-10-23 549b9ad0a143b6fbd86ce02ddfa470b5556126e7
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
85
86
87
88
89
90
91
92
93
namespace Yw.WinFrmUI
{
    public partial class SetHydroCalcuPrefixCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public SetHydroCalcuPrefixCtrl()
        {
            InitializeComponent();
        }
 
        /// <summary>
        /// 水力查看事件
        /// </summary>
        public event Action<Yw.Model.HydroParterInfo> HydroViewEvent;
        /// <summary>
        /// 水力计算事件
        /// </summary>
        public event Action HydroCalcuEvent;
 
        //水力信息
        private Yw.Model.HydroModelInfo _hydroInfo = null;
 
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo)
        {
            _hydroInfo = hydroInfo;
            if (_hydroInfo == null)
            {
                return;
            }
            //水箱
            if (_hydroInfo.Waterboxs != null && _hydroInfo.Waterboxs.Count > 0)
            {
                this.groupForWaterBox.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                this.setHydroWaterboxCalcuPrefixListCtrl1.SetBindingData(_hydroInfo);
            }
            else
            {
                this.groupForWaterBox.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            }
 
            //水泵
            if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0)
            {
                this.groupForPump.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                this.setHydroPumpCalcuPrefixListCtrl1.SetBindingData(_hydroInfo);
            }
            else
            {
                this.groupForPump.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            }
 
            //喷嘴
            if (_hydroInfo.Nozzles != null && _hydroInfo.Nozzles.Count > 0)
            {
                this.groupForNozzle.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                this.setHydroNozzleCalcuPrefixListCtrl1.SetBindingData(_hydroInfo);
            }
            else
            {
                this.groupForNozzle.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            }
 
        }
 
        /// <summary>
        /// 更新绑定数据
        /// </summary>
        public void UpdateBindingData()
        {
            if (_hydroInfo == null)
            {
                return;
            }
            if (_hydroInfo.Waterboxs != null && _hydroInfo.Waterboxs.Count > 0)
            {
                this.setHydroWaterboxCalcuPrefixListCtrl1.UpdateBindingData();
            }
            if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0)
            {
                this.setHydroPumpCalcuPrefixListCtrl1.UpdateBindingData();
            }
            if (_hydroInfo.Nozzles != null && _hydroInfo.Nozzles.Count > 0)
            {
                this.setHydroNozzleCalcuPrefixListCtrl1.UpdateBindingData();
            }
        }
 
 
    }
}