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;
|
}
|
|
|
|
}
|
}
|