namespace Yw.WinFrmUI
|
{
|
/// <summary>
|
/// 计算结果
|
/// </summary>
|
public class HydroCalcuResult
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public HydroCalcuResult()
|
{
|
this.Succeed = true;
|
this.FailedList = new List<HydroCalcuFailed>();
|
this.WainingList = new List<HydroCalcuWarning>();
|
this.VisualList = new List<HydroCalcuVisualResult>();
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public HydroCalcuResult(Yw.Epanet.CalcuResult calcuResult)
|
{
|
this.Succeed = calcuResult.Succeed;
|
this.FailedList = calcuResult.FailedList?.Select(x => new HydroCalcuFailed(x)).ToList();
|
this.WainingList = calcuResult.WarningList?.Select(x => new HydroCalcuWarning(x)).ToList();
|
this.VisualList = calcuResult.VisualList?.Select(x => HydroCalcuVisualResultHelper.Create(x)).Where(x => x != null).ToList();
|
this.EpanetCalcuResult = calcuResult;
|
}
|
|
/// <summary>
|
/// 是否成功
|
/// </summary>
|
public bool Succeed { get; set; }
|
|
/// <summary>
|
/// 失败列表
|
/// </summary>
|
public List<HydroCalcuFailed> FailedList { get; set; }
|
|
/// <summary>
|
/// 警告列表
|
/// </summary>
|
public List<HydroCalcuWarning> WainingList { get; set; }
|
|
/// <summary>
|
/// 构件列表
|
/// </summary>
|
public List<HydroCalcuVisualResult> VisualList { get; set; }
|
|
/// <summary>
|
/// Epanet 计算结果
|
/// </summary>
|
public Yw.Epanet.CalcuResult EpanetCalcuResult { get; set; }
|
|
/// <summary>
|
/// 获取可见字典
|
/// </summary>
|
public Dictionary<string, HydroCalcuVisualResult> GetVisualDict()
|
{
|
return this.VisualList?.ToDictionary(x => x.Code);
|
}
|
|
/// <summary>
|
/// 获取节点列表
|
/// </summary>
|
public List<HydroCalcuNodeResult> GetNodeList()
|
{
|
var allNodeList = this.VisualList?.Where(x => x is HydroCalcuNodeResult).Select(x => x as HydroCalcuNodeResult).ToList();
|
return allNodeList;
|
}
|
|
/// <summary>
|
/// 获取节点字典
|
/// </summary>
|
public Dictionary<string, HydroCalcuNodeResult> GetNodeDict()
|
{
|
var allNodeList = GetNodeList();
|
return allNodeList?.ToDictionary(x => x.Code);
|
}
|
|
/// <summary>
|
/// 获取管段列表
|
/// </summary>
|
public List<HydroCalcuLinkResult> GetLinkList()
|
{
|
var allLinkList = this.VisualList?.Where(x => x is HydroCalcuLinkResult).Select(x => x as HydroCalcuLinkResult).ToList();
|
return allLinkList;
|
}
|
|
/// <summary>
|
/// 获取管段字典
|
/// </summary>
|
public Dictionary<string, HydroCalcuLinkResult> GetLinkDict()
|
{
|
var allLinkList = GetLinkList();
|
return allLinkList?.ToDictionary(x => x.Code);
|
}
|
|
|
|
|
|
|
|
|
|
|
}
|
}
|