namespace Yw.WinFrmUI
{
///
/// 阀门匹配ViewModel
///
public class HydroValveMatchingViewModel
{
///
///
///
public HydroValveMatchingViewModel() { }
///
///
///
public HydroValveMatchingViewModel(Yw.Model.HydroValveInfo rhs, Yw.Model.HydroModelInfo hydroInfo)
{
this.Name = rhs.Name;
this.Code = rhs.Code;
this.ModelType = rhs.ModelType;
this.DbLocked = rhs.DbLocked;
this.DbId = rhs.DbId;
this.CurveDbId = hydroInfo.Curves?.Find(x => x.Code == rhs.ValveSetting)?.DbId;
this.Material = rhs.Material;
this.Diameter = rhs.Diameter;
this.MinorLoss = rhs.MinorLoss;
var valveType = HydroValveTypeEnumHelper.GetValveType(rhs.ValveType);
if (!valveType.HasValue)
{
valveType = eValveType.GPV;
}
this.ValveType = valveType.Value;
this.ValveSetting = rhs.ValveSetting;
}
///
///
///
public HydroValveMatchingViewModel(HydroValveViewModel rhs) : this(rhs.Vmo, rhs.HydroInfo)
{
}
///
/// 编码
///
public string Code { get; set; }
///
/// 名称
///
public string Name { get; set; }
///
/// Db锁定
///
public bool DbLocked { get; set; }
///
/// 型号
///
public string ModelType { get; set; }
///
/// DbId
///
public string DbId { get; set; }
///
/// CurveDbId
///
public string CurveDbId { get; set; }
///
/// 材质
///
public string Material { get; set; }
///
/// 直径
///
public double Diameter { get; set; }
///
/// 损失系数
///
public double MinorLoss { get; set; }
///
/// 阀门类型
///
public eValveType ValveType { get; set; }
///
/// 阀门设置
///
public string ValveSetting { get; set; }
///
/// 匹配型号
///
public string MatchingModelType { get; set; }
///
/// 匹配Dbid
///
public string MatchingDbId { get; set; }
///
/// 匹配曲线id
///
public string MatchingCurveDbId { get; set; }
///
/// 匹配材质
///
public string MatchingMaterial { get; set; }
///
/// 匹配直径
///
public double? MatchingDiameter { get; set; }
///
/// 匹配损失系数
///
public double? MatchingMinorLoss { get; set; }
///
/// 匹配阀门类型
///
public eValveType? MatchingValveType { get; set; }
///
/// 匹配阀门设置
///
public string MatchingValveSetting { get; set; }
///
/// 匹配水头损失曲线
///
public List MatchingCurveQL { get; set; }
///
/// 匹配开度损失曲线
///
public List MatchingCurveOL { get; set; }
}
}