Shuxia Ning
2024-11-25 d4898c5d7e1bbbbba384a0e29f29c066d6f502a7
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/01-viewmodel/ValveMatchingViewModel.cs
@@ -1,5 +1,4 @@
using HStation.Assets;
using HStation.Revit;
namespace HStation.WinFrmUI
{
@@ -8,6 +7,41 @@
    /// </summary>
    public class ValveMatchingViewModel
    {
        /// <summary>
        ///
        /// </summary>
        public ValveMatchingViewModel()
        { }
        /// <summary>
        ///
        /// </summary>
        public ValveMatchingViewModel(Yw.Model.HydroValveInfo rhs, Yw.Model.HydroModelInfo hydroInfo, List<HydroCalcuVisualResult> 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>
@@ -53,7 +87,7 @@
        /// <summary>
        /// CurveDbId
        /// </summary>
        [DisplayName("ChartDbId")]
        [DisplayName("CurveDbId")]
        [Browsable(false)]
        public string CurveDbId { get; set; }
@@ -83,7 +117,7 @@
        /// </summary>
        [DisplayName("阀门类型")]
        [Browsable(true)]
        public eValveType ValveType { get; set; }
        public HStation.Assets.eValveType ValveType { get; set; }
        /// <summary>
        /// 阀门设置
@@ -139,7 +173,7 @@
        /// </summary>
        [DisplayName("匹配阀门类型")]
        [Browsable(true)]
        public eValveType MatchingValveType { get; set; }
        public HStation.Assets.eValveType? MatchingValveType { get; set; }
        /// <summary>
        /// 匹配阀门设置