namespace HStation.WinFrmUI.Xhs
{
public class SinglePumpCalcViewModel
{
public SinglePumpCalcViewModel() { }
public SinglePumpCalcViewModel(SinglePumpCalcViewModel rhs)
{
this.Id = rhs.Id;
this.Name = rhs.Name;
this.IsBp = rhs.IsBp;
this.RatedSpeed = rhs.RatedSpeed;
this.CurrentSpeed = rhs.CurrentSpeed;
this.CurrentHz = rhs.CurrentHz;
this.IsDefault = rhs.IsDefault;
this.Color = rhs.Color;
this.ExtendRatio = rhs.ExtendRatio;
this.Qh = new Yw.Geometry.CubicSpline2d(rhs.Qh);
this.Qe = new Yw.Geometry.CubicSpline2d(rhs.Qe);
this.Qp = new Yw.Geometry.CubicSpline2d(rhs.Qp);
this.QhCalc = new Yw.Geometry.CubicSpline2d(rhs.QhCalc);
this.QeCalc = new Yw.Geometry.CubicSpline2d(rhs.QeCalc);
this.QpCalc = new Yw.Geometry.CubicSpline2d(rhs.QpCalc);
this.SectQ = rhs.QueryQ;
this.SectH = rhs.QueryH;
this.SectE = rhs.QueryE;
this.SectP = rhs.QueryP;
this.QueryQ = rhs.QueryQ;
this.QueryH = rhs.QueryH;
this.QueryE = rhs.QueryE;
this.QueryP = rhs.QueryP;
}
public SinglePumpCalcViewModel(Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel rhs, Yw.WinFrmUI.Phart.PumpSectPointViewModel sect)
{
this.Id = rhs.Id;
this.Name = rhs.Name;
this.IsBp = rhs.IsBp;
this.RatedSpeed = rhs.RatedSpeed;
this.CurrentSpeed = rhs.CurrentSpeed;
this.CurrentHz = rhs.CurrentHz;
this.IsDefault = rhs.IsDefault;
this.Color = rhs.Color;
this.ExtendRatio = rhs.ExtendRatio;
this.Qh = new Yw.Geometry.CubicSpline2d(rhs.Qh);
this.Qe = new Yw.Geometry.CubicSpline2d(rhs.Qe);
this.Qp = new Yw.Geometry.CubicSpline2d(rhs.Qp);
this.QhCalc = new Yw.Geometry.CubicSpline2d(rhs.QhCalc);
this.QeCalc = new Yw.Geometry.CubicSpline2d(rhs.QeCalc);
this.QpCalc = new Yw.Geometry.CubicSpline2d(rhs.QpCalc);
this.SectQ = sect.QueryQ;
this.SectH = sect.QueryH;
this.SectE = sect.QueryE;
this.SectP = sect.QueryP;
this.QueryQ = rhs.QueryQ;
this.QueryH = rhs.QueryH;
this.QueryE = rhs.QueryE;
this.QueryP = rhs.QueryP;
}
public Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel ToInfo()
{
var info = new Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel();
info.Id = this.Id;
info.Name = this.Name;
info.IsBp = this.IsBp;
info.RatedSpeed = this.RatedSpeed;
info.CurrentSpeed = this.CurrentSpeed;
info.CurrentHz = this.CurrentHz;
info.IsDefault = this.IsDefault;
info.Color = this.Color;
info.ExtendRatio = this.ExtendRatio;
info.Qh = new Yw.Geometry.CubicSpline2d(this.Qh);
info.Qe = new Yw.Geometry.CubicSpline2d(this.Qe);
info.Qp = new Yw.Geometry.CubicSpline2d(this.Qp);
info.QhCalc = new Yw.Geometry.CubicSpline2d(this.QhCalc);
info.QeCalc = new Yw.Geometry.CubicSpline2d(this.QeCalc);
info.QpCalc = new Yw.Geometry.CubicSpline2d(this.QpCalc);
info.QueryQ = this.QueryQ;
info.QueryH = this.QueryH;
info.QueryE = this.QueryE;
info.QueryP = this.QueryP;
return info;
}
///
/// 标识
///
[Display(Name = "标识")]
public string Id { get; set; }
///
/// 名称
///
[Display(Name = "名称")]
public string Name { get; set; }
///
/// 是否变频
///
[Display(Name = "是否变频")]
public bool IsBp { get; set; }
///
/// 额定转速
///
[Display(Name = "额定转速")]
public double RatedSpeed { get; set; }
///
/// 当前转速
///
[Display(Name = "转速")]
public double CurrentSpeed { get; set; }
///
/// 当前频率
///
[Display(Name = "频率")]
public double CurrentHz { get; set; }
///
/// 是否默认
///
[Display(Name = "是否默认")]
public bool IsDefault { get; set; }
///
/// 颜色
///
[Display(Name = "颜色")]
public Color Color { get; set; }
///
/// 延长(%)
///
[Display(Name = "延长(%)")]
public double ExtendRatio { get; set; } = 100;
///
/// 流量扬程线
///
[Display(Name = "")]
public Yw.Geometry.CubicSpline2d Qh { get; set; }
///
/// 流量效率线
///
[Display(Name = "")]
public Yw.Geometry.CubicSpline2d Qe { get; set; }
///
/// 流量功率线
///
[Display(Name = "")]
public Yw.Geometry.CubicSpline2d Qp { get; set; }
///
/// 流量扬程线
///
[Display(Name = "")]
public Yw.Geometry.CubicSpline2d QhCalc { get; set; }
///
/// 流量效率线
///
[Display(Name = "")]
public Yw.Geometry.CubicSpline2d QeCalc { get; set; }
///
/// 流量功率线
///
[Display(Name = "")]
public Yw.Geometry.CubicSpline2d QpCalc { get; set; }
///
/// 流量(m³/h)
///
[Display(Name = "流量(m³/h)")]
public string SectQ { get; set; }
///
/// 扬程(m)
///
[Display(Name = "扬程(m)")]
public string SectH { get; set; }
///
/// 效率(%)
///
[Display(Name = "效率(%)")]
public string SectE { get; set; }
///
/// 功率(kW)
///
[Display(Name = "功率(kW)")]
public string SectP { get; set; }
///
/// 流量(m³/h)
///
[Display(Name = "流量(m³/h)")]
public string QueryQ { get; set; }
///
/// 扬程(m)
///
[Display(Name = "扬程(m)")]
public string QueryH { get; set; }
///
/// 效率(%)
///
[Display(Name = "效率(%)")]
public string QueryE { get; set; }
///
/// 功率(kW)
///
[Display(Name = "功率(kW)")]
public string QueryP { get; set; }
///
/// 计算
///
public void Calc()
{
this.CurrentSpeed = Math.Round(this.CurrentHz / 50 * this.RatedSpeed);
this.QhCalc = Yw.WinFrmUI.Phart.PumpCalcHelper.CalculateSimilarQH(this.Qh, this.RatedSpeed, this.CurrentSpeed);
this.QeCalc = Yw.WinFrmUI.Phart.PumpCalcHelper.CalculateSimilarQE(this.Qe, this.RatedSpeed, this.CurrentSpeed);
this.QpCalc = Yw.WinFrmUI.Phart.PumpCalcHelper.CalculateSimilarQP(this.Qp, this.RatedSpeed, this.CurrentSpeed);
if (this.QhCalc != null)
this.QhCalc.MaxX = this.QhCalc.MaxX * this.ExtendRatio / 100;
if (this.QeCalc != null)
this.QeCalc.MaxX = this.QeCalc.MaxX * this.ExtendRatio / 100;
if (this.QpCalc != null)
this.QpCalc.MaxX = this.QpCalc.MaxX * this.ExtendRatio / 100;
}
}
}