namespace HStation.WinFrmUI
{
///
/// 水泵匹配ViewModel
///
public class PumpMatchingViewModel
{
///
///
///
public PumpMatchingViewModel() { }
///
///
///
public PumpMatchingViewModel(Yw.Model.HydroPumpInfo rhs, Yw.Model.HydroModelInfo hydroInfo, List allCalcuResult)
{
this.Name = rhs.Name;
this.Code = rhs.Code;
this.ModelType = rhs.ModelType;
this.DbId = rhs.DbId;
this.DbLocked = rhs.DbLocked;
this.CurveDbId = hydroInfo.Curves?.Find(x => x.Code == rhs.CurveQH)?.DbId;
this.RatedP = rhs.RatedP;
this.RatedQ = rhs.RatedQ;
this.RatedH = rhs.RatedH;
this.RatedN = rhs.RatedN;
this.RatedHz = rhs.RatedHz;
this.CurrentHz = Math.Round(rhs.RatedHz * rhs.SpeedRatio, 1);
if (allCalcuResult != null && allCalcuResult.Count > 0)
{
var calcuResult = allCalcuResult.Find(x => x.Code == rhs.Code) as HydroCalcuLinkResult;
if (calcuResult != null)
{
if (calcuResult.CalcuFlow.HasValue)
{
this.CalcuQ = Math.Abs(calcuResult.CalcuFlow.Value);
}
var calcuResultStart = allCalcuResult.Find(x => x.Code == rhs.StartCode) as HydroCalcuNodeResult;
var calcuResultEnd = allCalcuResult.Find(x => x.Code == rhs.EndCode) as HydroCalcuNodeResult;
if (calcuResultStart != null && calcuResultEnd != null)
{
if (calcuResultStart.CalcuHead.HasValue && calcuResultEnd.CalcuHead.HasValue)
{
this.CalcuH = Math.Round(Math.Abs(calcuResultStart.CalcuHead.Value - calcuResultEnd.CalcuHead.Value), 4);
}
}
}
}
}
///
/// ID
///
[DisplayName("ID")]
[Browsable(false)]
public long ID { get; set; }
///
/// 名称
///
[DisplayName("名称")]
[Browsable(true)]
public string Name { get; set; }
///
/// 编码
///
[DisplayName("编码")]
[Browsable(true)]
public string Code { get; set; }
///
/// 型号
///
[DisplayName("型号")]
[Browsable(true)]
public string ModelType { get; set; }
///
/// DbId
///
[DisplayName("DbId")]
[Browsable(false)]
public string DbId { get; set; }
///
/// Db锁定
///
[DisplayName("锁定")]
[Browsable(true)]
public bool DbLocked { get; set; }
///
/// CurveDbId
///
[DisplayName("CurveDbId")]
[Browsable(false)]
public string CurveDbId { get; set; }
///
/// 额定功率
///
[DisplayName("额定功率")]
[Browsable(true)]
public double RatedP { get; set; }
///
/// 额定流量
///
[DisplayName("额定流量")]
[Browsable(true)]
public double? RatedQ { get; set; }
///
/// 额定扬程
///
[DisplayName("额定扬程")]
[Browsable(true)]
public double? RatedH { get; set; }
///
/// 额定转速
///
[DisplayName("额定转速")]
[Browsable(true)]
public double? RatedN { get; set; }
///
/// 额定频率
///
[DisplayName("额定频率")]
[Browsable(true)]
public double RatedHz { get; set; }
///
/// 设定频率
///
[DisplayName("设定频率")]
[Browsable(true)]
public double CurrentHz { get; set; }
///
/// 计算流量
///
[DisplayName("计算流量")]
[Browsable(true)]
public double? CalcuQ { get; set; }
///
/// 计算扬程
///
[DisplayName("计算扬程")]
[Browsable(true)]
public double? CalcuH { get; set; }
///
/// 匹配型号
///
[DisplayName("匹配型号")]
[Browsable(true)]
public string MatchingModelType { get; set; }
///
/// 匹配DbId
///
[DisplayName("匹配DbId")]
[Browsable(false)]
public string MatchingDbId { get; set; }
///
/// 匹配CurveDbId
///
[DisplayName("匹配CurveDbId")]
[Browsable(false)]
public string MatchingCurveDbId { get; set; }
///
/// 匹配额定功率
///
[DisplayName("匹配额定功率")]
[Browsable(true)]
public double? MatchingRatedP { get; set; }
///
/// 匹配额定流量
///
[DisplayName("匹配额定流量")]
[Browsable(true)]
public double? MatchingRatedQ { get; set; }
///
/// 匹配额定扬程
///
[DisplayName("匹配额定扬程")]
[Browsable(true)]
public double? MatchingRatedH { get; set; }
///
/// 匹配额定转速
///
[DisplayName("匹配额定转速")]
[Browsable(true)]
public double? MatchingRatedN { get; set; }
///
/// 匹配额定频率
///
[DisplayName("匹配额定频率")]
[Browsable(true)]
public double? MatchingRatedHz { get; set; }
///
/// 匹配设定频率
///
[DisplayName("匹配设定频率")]
[Browsable(true)]
public double? MatchingCurrentHz { get; set; }
///
/// 匹配流量扬程曲线
///
[DisplayName("匹配流量扬程曲线")]
[Browsable(false)]
public List MatchingCurveQH { get; set; }
///
/// 匹配流量功率曲线
///
[DisplayName("匹配流量功率曲线")]
[Browsable(false)]
public List MatchingCurveQP { get; set; }
///
/// 匹配流量效率曲线
///
[DisplayName("匹配流量效率曲线")]
[Browsable(false)]
public List MatchingCurveQE { get; set; }
}
}