using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using static Hydro.Core.ObjectEnum;
namespace Hydro.Core.Model
{
[Serializable]
public class PumpModel : LinkCalcModel
{
///
/// 泵类型
///
public PumpType Type { get; set; }
///
/// 额定转速
///
public double RatedSpeed { get; set; } = 1500;
///
/// 额定流量
///
public double RatedFlow { get; set; } = 0;
///
/// 额定扬程
///
public double RatedHead { get; set; } = 0;
///
/// 额定功率
///
public double RatedPower { get; set; } = 75;
///
/// 扬程曲线
///
public string FlowCurveID { get; set; } = "PumpDefault";
///
/// 参数
///
public List Parameters { get; set; }
///
/// 流量曲线
///
public FlowCurve FlowCurve { get; set; }
public override string ToString()
{
string para = Parameters == null ? null : string.Join("\t", Parameters);
return $"{ID}\t{Node1}\t{Node2}\tHead\t{FlowCurveID}\t{para}\t;\t";
}
///
/// 生成流量曲线
///
///
public string CreateFlowCurve()
{
StringBuilder txt = new StringBuilder();
if (FlowCurve != null)
{
foreach (PointF point in FlowCurve.Data)
{
txt.AppendLine($"{Name}\t{point.X}\t{point.Y}");
}
}
return txt.ToString();
}
}
}