lixiaojun
2024-12-05 f1efcbcf48fa6fc7dede2c5c7e91cc953b367fe0
WinFrmUI/Yw.WinFrmUI.Hydro.Core/14-matching/00-core/HydroMatchingHelper.cs
@@ -2,6 +2,7 @@
using System.Windows.Media.Imaging;
using Yw.DAL.Basic;
using Yw.EPAnet;
using Yw.Hydro;
using Yw.Model;
namespace Yw.WinFrmUI
@@ -953,6 +954,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroTankViewModel visualViewModel, HydroTankMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroTankInfo visual, HydroTankMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -1058,6 +1069,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroBluntheadViewModel visualViewModel, HydroBluntheadMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroBluntheadInfo visual, HydroBluntheadMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -1115,6 +1136,16 @@
        #endregion
        #region 弯头
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroElbowViewModel visualViewModel, HydroElbowMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -1195,6 +1226,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroThreelinkViewModel visualViewModel, HydroThreelinkMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroThreelinkInfo visual, HydroThreelinkMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -1268,6 +1309,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroFourlinkViewModel visualViewModel, HydroFourlinkMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroFourlinkInfo visual, HydroFourlinkMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -1325,6 +1376,16 @@
        #endregion
        #region 喷头
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroNozzleViewModel visualViewModel, HydroNozzleMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -1396,6 +1457,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroHydrantViewModel visualViewModel, HydroHydrantMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroHydrantInfo visual, HydroHydrantMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -1463,6 +1534,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroMeterViewModel visualViewModel, HydroMeterMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroMeterInfo visual, HydroMeterMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -1508,6 +1589,16 @@
        #endregion
        #region 流量计
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroFlowmeterViewModel visualViewModel, HydroFlowmeterMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -1561,6 +1652,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroPressmeterViewModel visualViewModel, HydroPressmeterMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPressmeterInfo visual, HydroPressmeterMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -1606,6 +1707,16 @@
        #endregion
        #region 管道
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroPipeViewModel visualViewModel, HydroPipeMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -1675,6 +1786,16 @@
        #endregion
        #region 过渡件
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroTranslationViewModel visualViewModel, HydroTranslationMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -1756,6 +1877,16 @@
        #endregion
        #region 水泵
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroPumpViewModel visualViewModel, HydroPumpMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -1933,6 +2064,16 @@
        #endregion
        #region 阀门
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroValveViewModel visualViewModel, HydroValveMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -2125,6 +2266,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroExchangerViewModel visualViewModel, HydroExchangerMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroExchangerInfo visual, HydroExchangerMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -2219,6 +2370,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroCompressorViewModel visualViewModel, HydroCompressorMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroCompressorInfo visual, HydroCompressorMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -2247,26 +2408,31 @@
                if (!string.IsNullOrEmpty(matching.MatchingModelType))
                {
                    visual.ModelType = matching.MatchingModelType;
                    visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Normal, "匹配修复");
                    result = true;
                }
                if (!string.IsNullOrEmpty(matching.MatchingDbId))
                {
                    visual.DbId = matching.MatchingDbId;
                    visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Normal, "匹配修复");
                    result = true;
                }
                if (!string.IsNullOrEmpty(matching.MatchingMaterial))
                {
                    visual.Material = matching.MatchingMaterial;
                    visual.UpdatePropStatus(nameof(visual.Material), ePropStatus.Normal, "匹配修复");
                    result = true;
                }
                if (matching.MatchingDiameter.HasValue)
                {
                    visual.Diameter = matching.MatchingDiameter.Value;
                    visual.UpdatePropStatus(nameof(visual.Diameter), ePropStatus.Normal, "匹配修复");
                    result = true;
                }
                if (matching.MatchingMinorLoss.HasValue)
                {
                    visual.MinorLoss = matching.MatchingMinorLoss.Value;
                    visual.UpdatePropStatus(nameof(visual.MinorLoss), ePropStatus.Normal, "匹配修复");
                    result = true;
                }