namespace Yw.Epanet
|
{
|
/// <summary>
|
/// 水力管网(方法)
|
/// </summary>
|
public partial class Network
|
{
|
|
/// <summary>
|
/// 获取所有组件
|
/// </summary>
|
public List<Parter> GetAllParters()
|
{
|
var list = new List<Parter>();
|
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.Emitters != null && this.Emitters.Count > 0)
|
{
|
list.AddRange(this.Emitters);
|
}
|
|
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<Visual> GetAllVisuals()
|
{
|
var list = new List<Visual>();
|
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.Emitters != null && this.Emitters.Count > 0)
|
{
|
list.AddRange(this.Emitters);
|
}
|
|
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<Node> GetAllNodes()
|
{
|
var list = new List<Node>();
|
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.Emitters != null && this.Emitters.Count > 0)
|
{
|
list.AddRange(this.Emitters);
|
}
|
|
return list;
|
}
|
|
/// <summary>
|
/// 获取所有水源
|
/// </summary>
|
public List<Source> GetAllSources()
|
{
|
var list = new List<Source>();
|
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<Junction> GetAllJunctions()
|
{
|
var list = new List<Junction>();
|
if (this.Junctions != null && this.Junctions.Count > 0)
|
{
|
list.AddRange(this.Junctions);
|
}
|
if (this.Emitters != null && this.Emitters.Count > 0)
|
{
|
list.AddRange(this.Emitters);
|
}
|
|
return list;
|
}
|
|
/// <summary>
|
/// 获取所有管段
|
/// </summary>
|
public List<Link> GetAllLinks()
|
{
|
var list = new List<Link>();
|
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<Operation> GetAllOperations()
|
{
|
var list = new List<Operation>();
|
|
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 Dictionary<string, Visual> GetVisualDict()
|
{
|
var allVisualList = GetAllVisuals();
|
return allVisualList?.ToDictionary(x => x.Id);
|
}
|
|
/// <summary>
|
/// 获取节点字典
|
/// </summary>
|
public Dictionary<string, Node> GetNodeDict()
|
{
|
var allNodeList = GetAllNodes();
|
return allNodeList?.ToDictionary(x => x.Id);
|
}
|
|
/// <summary>
|
/// 获取管段字典
|
/// </summary>
|
public Dictionary<string, Link> GetLinkDict()
|
{
|
var allLinkList = GetAllLinks();
|
return allLinkList?.ToDictionary(x => x.Id);
|
}
|
|
public double GetMinElev()
|
{
|
return default;
|
}
|
|
}
|
}
|