lixiaojun
2024-11-06 a5f3c47ee959183e3059fc6672b4b07f99eb9c1a
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/01-viewmodel/ValveMatchingViewModel.cs
@@ -1,4 +1,5 @@
using HStation.Assets;
using HStation.Revit;
namespace HStation.WinFrmUI
{
@@ -7,6 +8,41 @@
    /// </summary>
    public class ValveMatchingViewModel
    {
        /// <summary>
        ///
        /// </summary>
        public ValveMatchingViewModel() { }
        /// <summary>
        ///
        /// </summary>
        public ValveMatchingViewModel(Yw.Model.HydroValveInfo rhs, Yw.Model.HydroModelInfo hydroInfo, List<HydroCalcuResult> allCalcuResult)
        {
            this.ID = rhs.ID;
            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;
            switch (rhs.ValveType)
            {
                case Yw.Hydro.ValveType.PRV: this.ValveType = HStation.Assets.eValveType.PRV; break;
                case Yw.Hydro.ValveType.PSV: this.ValveType = HStation.Assets.eValveType.PSV; break;
                case Yw.Hydro.ValveType.PBV: this.ValveType = HStation.Assets.eValveType.PBV; break;
                case Yw.Hydro.ValveType.TCV: this.ValveType = HStation.Assets.eValveType.TCV; break;
                case Yw.Hydro.ValveType.FCV: this.ValveType = HStation.Assets.eValveType.FCV; break;
                case Yw.Hydro.ValveType.GPV: this.ValveType = HStation.Assets.eValveType.GPV; break;
                case Yw.Hydro.ValveType.CV: this.ValveType = HStation.Assets.eValveType.CV; break;
                default: break;
            }
            this.ValveSetting = rhs.ValveSetting;
        }
        /// <summaryd>
        /// ID
        /// </summary>
@@ -50,11 +86,11 @@
        public string DbId { get; set; }
        /// <summary>
        /// ChartDbId
        /// CurveDbId
        /// </summary>
        [DisplayName("ChartDbId")]
        [DisplayName("CurveDbId")]
        [Browsable(false)]
        public string ChartDbId { get; set; }
        public string CurveDbId { get; set; }
        /// <summary>
        /// 直径
@@ -82,7 +118,7 @@
        /// </summary>
        [DisplayName("阀门类型")]
        [Browsable(true)]
        public string ValveType { get; set; }
        public eValveType ValveType { get; set; }
        /// <summary>
        /// 阀门设置
@@ -90,13 +126,6 @@
        [DisplayName("阀门设置")]
        [Browsable(true)]
        public string ValveSetting { get; set; }
        /// <summary>
        /// 阀门开度
        /// </summary>
        [DisplayName("阀门开度")]
        [Browsable(true)]
        public int ValveLift { get; set; }
        /// <summary>
        /// 匹配型号
@@ -120,11 +149,11 @@
        public double? MatchingDiameter { get; set; }
        /// <summary>
        /// MatchingChartDbId
        /// MatchingCurveDbId
        /// </summary>
        [DisplayName("MatchingChartDbId")]
        [DisplayName("MatchingCurveDbId")]
        [Browsable(false)]
        public string MatchingChartDbId { get; set; }
        public string MatchingCurveDbId { get; set; }
        /// <summary>
        /// 匹配材质
@@ -145,7 +174,7 @@
        /// </summary>
        [DisplayName("匹配阀门类型")]
        [Browsable(true)]
        public string MatchingValveType { get; set; }
        public eValveType MatchingValveType { get; set; }
        /// <summary>
        /// 匹配阀门设置
@@ -162,10 +191,10 @@
        public List<CurvePointMatchingViewModel> MatchingCurveQL { get; set; }
        /// <summary>
        /// 匹配阀门开度
        /// 匹配开度损失曲线
        /// </summary>
        [DisplayName("匹配阀门开度")]
        [Browsable(true)]
        public int? MatchingValveLift { get; set; }
        [DisplayName("匹配开度损失曲线")]
        [Browsable(false)]
        public List<CurvePointMatchingViewModel> MatchingCurveOL { get; set; }
    }
}