lixiaojun
2024-08-13 0e0709e63ed50093d09fb88ac1ea4eb9b5a37afc
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
namespace Yw.EPAnet
{
    /// <summary>
    /// 水力管网(方法)
    /// </summary>
    public partial class Network
    {
        /// <summary>
        /// 获取所有组件
        /// </summary>
        public List<IParter> GetAllParters()
        {
            var list = new List<IParter>();
            if (this.Reservoirs != null && this.Reservoirs.Count > 0)
            {
                list.AddRange(this.Reservoirs);
            }
            if (this.Tanks != null && this.Tanks.Count > 0)
            {
                list.AddRange(this.Tanks);
            }
            if (this.Junctions != null && this.Junctions.Count > 0)
            {
                list.AddRange(this.Junctions);
            }
            if (this.Nozzles != null && this.Nozzles.Count > 0)
            {
                list.AddRange(this.Nozzles);
            }
            if (this.Hydrants != null && this.Hydrants.Count > 0)
            {
                list.AddRange(this.Hydrants);
            }
            if (this.Meters != null && this.Meters.Count > 0)
            {
                list.AddRange(this.Meters);
            }
 
            if (this.Pipes != null && this.Pipes.Count > 0)
            {
                list.AddRange(this.Pipes);
            }
            if (this.Pumps != null && this.Pumps.Count > 0)
            {
                list.AddRange(this.Pumps);
            }
            if (this.Valves != null && this.Valves.Count > 0)
            {
                list.AddRange(this.Valves);
            }
 
            if (this.Curves != null && this.Curves.Count > 0)
            {
                list.AddRange(this.Curves);
            }
            if (this.Patterns != null && this.Patterns.Count > 0)
            {
                list.AddRange(this.Patterns);
            }
            if (this.Rules != null && this.Rules.Count > 0)
            {
                list.AddRange(this.Rules);
            }
 
            return list;
        }
 
        /// <summary>
        /// 获取所有节点
        /// </summary>
        public List<INode> GetAllNodes()
        {
            var list = new List<INode>();
            if (this.Reservoirs != null && this.Reservoirs.Count > 0)
            {
                list.AddRange(this.Reservoirs);
            }
            if (this.Tanks != null && this.Tanks.Count > 0)
            {
                list.AddRange(this.Tanks);
            }
            if (this.Junctions != null && this.Junctions.Count > 0)
            {
                list.AddRange(this.Junctions);
            }
            if (this.Nozzles != null && this.Nozzles.Count > 0)
            {
                list.AddRange(this.Nozzles);
            }
            if (this.Hydrants != null && this.Hydrants.Count > 0)
            {
                list.AddRange(this.Hydrants);
            }
            if (this.Meters != null && this.Meters.Count > 0)
            {
                list.AddRange(this.Meters);
            }
 
 
            return list;
        }
 
        /// <summary>
        /// 获取所有管段
        /// </summary>
        public List<ILink> GetAllLinks()
        {
            var list = new List<ILink>();
 
 
            if (this.Pipes != null && this.Pipes.Count > 0)
            {
                list.AddRange(this.Pipes);
            }
            if (this.Pumps != null && this.Pumps.Count > 0)
            {
                list.AddRange(this.Pumps);
            }
            if (this.Valves != null && this.Valves.Count > 0)
            {
                list.AddRange(this.Valves);
            }
 
 
            return list;
        }
 
        /// <summary>
        /// 获取所有操作
        /// </summary>
        public List<IOperation> GetAllOperations()
        {
            var list = new List<IOperation>();
 
            if (this.Curves != null && this.Curves.Count > 0)
            {
                list.AddRange(this.Curves);
            }
            if (this.Patterns != null && this.Patterns.Count > 0)
            {
                list.AddRange(this.Patterns);
            }
            if (this.Rules != null && this.Rules.Count > 0)
            {
                list.AddRange(this.Rules);
            }
 
            return list;
        }
 
        /// <summary>
        /// 获取所有水源
        /// </summary>
        public List<INode> GetAllSources()
        {
            var list = new List<INode>();
            if (this.Reservoirs != null && this.Reservoirs.Count > 0)
            {
                list.AddRange(this.Reservoirs);
            }
            if (this.Tanks != null && this.Tanks.Count > 0)
            {
                list.AddRange(this.Tanks);
            }
            return list;
        }
 
        /// <summary>
        /// 获取所有扩散器
        /// </summary>
        public List<IEmitter> GetAllEmitters()
        {
            var list = new List<IEmitter>();
            if (this.Nozzles != null && this.Nozzles.Count > 0)
            {
                list.AddRange(this.Nozzles);
            }
            if (this.Hydrants != null && this.Hydrants.Count > 0)
            {
                list.AddRange(this.Hydrants);
            }
            return list;
        }
 
        /// <summary>
        /// 获取所有连接节点
        /// </summary>
        public List<IJunction> GetAllJunctions()
        {
            var list = new List<IJunction>();
            if (this.Junctions != null && this.Junctions.Count > 0)
            {
                list.AddRange(this.Junctions);
            }
            if (this.Nozzles != null && this.Nozzles.Count > 0)
            {
                list.AddRange(this.Nozzles);
            }
            if (this.Hydrants != null && this.Hydrants.Count > 0)
            {
                list.AddRange(this.Hydrants);
            }
            if (this.Meters != null && this.Meters.Count > 0)
            {
                list.AddRange(this.Meters);
            }
 
            return list;
        }
 
 
 
    }
}