Shuxia Ning
2024-12-11 f2cc8078a00824a319dab44841f7cb64fdee76b0
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
@@ -15,22 +16,9 @@
        #region 创建
        /// <summary>
        /// 创建自动匹配ViewModel
        /// </summary>
        public static HydroMatchingViewModel Create(Yw.Model.HydroModelInfo hydroInfo, List<HydroCalcuVisualResult> allCalcuResultVisualList = null)
        {
            if (hydroInfo == null)
            {
                return default;
            }
            var allCalcuResultVisualDict = allCalcuResultVisualList?.ToDictionary(x => x.Code);
            return Create(hydroInfo, allCalcuResultVisualDict);
        }
        /// <summary>
        /// 创建
        /// </summary>
        public static HydroMatchingViewModel Create(Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict = null)
        public static HydroMatchingViewModel Create(Yw.Model.HydroModelInfo hydroInfo)
        {
            if (hydroInfo == null)
            {
@@ -42,97 +30,97 @@
            #region 水池
            var tanks = hydroInfo.GetAllTanks();
            vm.Tanks = tanks?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuNodeResult)).ToList();
            vm.Tanks = tanks?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 闷头
            vm.Bluntheads = hydroInfo.Bluntheads?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuNodeResult)).ToList();
            vm.Bluntheads = hydroInfo.Bluntheads?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 弯头
            vm.Elbows = hydroInfo.Elbows?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuNodeResult)).ToList();
            vm.Elbows = hydroInfo.Elbows?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 三通
            vm.Threelinks = hydroInfo.Threelinks?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuNodeResult)).ToList();
            vm.Threelinks = hydroInfo.Threelinks?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 四通
            vm.Fourlinks = hydroInfo.Fourlinks?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuNodeResult)).ToList();
            vm.Fourlinks = hydroInfo.Fourlinks?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 喷嘴
            vm.Nozzles = hydroInfo.Nozzles?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuNodeResult)).ToList();
            vm.Nozzles = hydroInfo.Nozzles?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 消火栓
            vm.Hydrants = hydroInfo.Hydrants?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuNodeResult)).ToList();
            vm.Hydrants = hydroInfo.Hydrants?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 水表
            vm.Meters = hydroInfo.Meters?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuNodeResult)).ToList();
            vm.Meters = hydroInfo.Meters?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 流量计
            vm.Flowmeters = hydroInfo.Flowmeters?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuFlowmeterResult)).ToList();
            vm.Flowmeters = hydroInfo.Flowmeters?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 压力表
            vm.Pressmeters = hydroInfo.Pressmeters?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuPressmeterResult)).ToList();
            vm.Pressmeters = hydroInfo.Pressmeters?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 管道
            vm.Pipes = hydroInfo.Pipes?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuLinkResult)).ToList();
            vm.Pipes = hydroInfo.Pipes?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 过渡件
            vm.Translations = hydroInfo.Translations?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuLinkResult)).ToList();
            vm.Translations = hydroInfo.Translations?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 水泵
            vm.Pumps = hydroInfo.Pumps?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuPumpResult)).ToList();
            vm.Pumps = hydroInfo.Pumps?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 阀门
            vm.Valves = hydroInfo.Valves?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuLinkResult)).ToList();
            vm.Valves = hydroInfo.Valves?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 换热器
            vm.Exchangers = hydroInfo.Exchangers?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuLinkResult)).ToList();
            vm.Exchangers = hydroInfo.Exchangers?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
            #region 压缩机
            vm.Compressors = hydroInfo.Compressors?.Select(x => Create(x, hydroInfo, allCalcuResultVisualDict?.GetValue(x.Code) as HydroCalcuLinkResult)).ToList();
            vm.Compressors = hydroInfo.Compressors?.Select(x => Create(x, hydroInfo)).ToList();
            #endregion
@@ -144,9 +132,9 @@
        /// <summary>
        /// 创建水池自动匹配ViewModel
        /// </summary>
        public static HydroTankMatchingViewModel Create(HydroTankInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuNodeResult calcuResult = null)
        public static HydroTankMatchingViewModel Create(HydroTankInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -154,19 +142,19 @@
            {
                return default;
            }
            return new HydroTankMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroTankMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建水池自动匹配ViewModel
        /// </summary>
        public static HydroTankMatchingViewModel Create(HydroTankViewModel parterViewModel)
        public static HydroTankMatchingViewModel Create(HydroTankViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroTankMatchingViewModel(parterViewModel);
            return new HydroTankMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -176,9 +164,9 @@
        /// <summary>
        /// 创建闷头自动匹配ViewModel
        /// </summary>
        public static HydroBluntheadMatchingViewModel Create(HydroBluntheadInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuNodeResult calcuResult = null)
        public static HydroBluntheadMatchingViewModel Create(HydroBluntheadInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -186,19 +174,19 @@
            {
                return default;
            }
            return new HydroBluntheadMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroBluntheadMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建闷头自动匹配ViewModel
        /// </summary>
        public static HydroBluntheadMatchingViewModel Create(HydroBluntheadViewModel parterViewModel)
        public static HydroBluntheadMatchingViewModel Create(HydroBluntheadViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroBluntheadMatchingViewModel(parterViewModel);
            return new HydroBluntheadMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -208,9 +196,9 @@
        /// <summary>
        /// 创建弯头自动匹配ViewModel
        /// </summary>
        public static HydroElbowMatchingViewModel Create(HydroElbowInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuNodeResult calcuResult = null)
        public static HydroElbowMatchingViewModel Create(HydroElbowInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -218,19 +206,19 @@
            {
                return default;
            }
            return new HydroElbowMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroElbowMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建弯头自动匹配ViewModel
        /// </summary>
        public static HydroElbowMatchingViewModel Create(HydroElbowViewModel parterViewModel)
        public static HydroElbowMatchingViewModel Create(HydroElbowViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroElbowMatchingViewModel(parterViewModel);
            return new HydroElbowMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -240,9 +228,9 @@
        /// <summary>
        /// 创建三通自动匹配ViewModel
        /// </summary>
        public static HydroThreelinkMatchingViewModel Create(HydroThreelinkInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuNodeResult calcuResult = null)
        public static HydroThreelinkMatchingViewModel Create(HydroThreelinkInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -250,19 +238,19 @@
            {
                return default;
            }
            return new HydroThreelinkMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroThreelinkMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建三通自动匹配ViewModel
        /// </summary>
        public static HydroThreelinkMatchingViewModel Create(HydroThreelinkViewModel parterViewModel)
        public static HydroThreelinkMatchingViewModel Create(HydroThreelinkViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroThreelinkMatchingViewModel(parterViewModel);
            return new HydroThreelinkMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -272,9 +260,9 @@
        /// <summary>
        /// 创建四通自动匹配ViewModel
        /// </summary>
        public static HydroFourlinkMatchingViewModel Create(HydroFourlinkInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuNodeResult calcuResult = null)
        public static HydroFourlinkMatchingViewModel Create(HydroFourlinkInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -282,19 +270,19 @@
            {
                return default;
            }
            return new HydroFourlinkMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroFourlinkMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建四通自动匹配ViewModel
        /// </summary>
        public static HydroFourlinkMatchingViewModel Create(HydroFourlinkViewModel parterViewModel)
        public static HydroFourlinkMatchingViewModel Create(HydroFourlinkViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroFourlinkMatchingViewModel(parterViewModel);
            return new HydroFourlinkMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -304,9 +292,9 @@
        /// <summary>
        /// 创建喷头自动匹配ViewModel
        /// </summary>
        public static HydroNozzleMatchingViewModel Create(HydroNozzleInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuNodeResult calcuResult = null)
        public static HydroNozzleMatchingViewModel Create(HydroNozzleInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -314,19 +302,19 @@
            {
                return default;
            }
            return new HydroNozzleMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroNozzleMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建喷头自动匹配ViewModel
        /// </summary>
        public static HydroNozzleMatchingViewModel Create(HydroNozzleViewModel parterViewModel)
        public static HydroNozzleMatchingViewModel Create(HydroNozzleViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroNozzleMatchingViewModel(parterViewModel);
            return new HydroNozzleMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -336,9 +324,9 @@
        /// <summary>
        /// 创建消火栓自动匹配ViewModel
        /// </summary>
        public static HydroHydrantMatchingViewModel Create(HydroHydrantInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuNodeResult calcuResult = null)
        public static HydroHydrantMatchingViewModel Create(HydroHydrantInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -346,19 +334,19 @@
            {
                return default;
            }
            return new HydroHydrantMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroHydrantMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建消火栓自动匹配ViewModel
        /// </summary>
        public static HydroHydrantMatchingViewModel Create(HydroHydrantViewModel parterViewModel)
        public static HydroHydrantMatchingViewModel Create(HydroHydrantViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroHydrantMatchingViewModel(parterViewModel);
            return new HydroHydrantMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -368,9 +356,9 @@
        /// <summary>
        /// 创建水表自动匹配ViewModel
        /// </summary>
        public static HydroMeterMatchingViewModel Create(HydroMeterInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuNodeResult calcuResult = null)
        public static HydroMeterMatchingViewModel Create(HydroMeterInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -378,19 +366,19 @@
            {
                return default;
            }
            return new HydroMeterMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroMeterMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建水表自动匹配ViewModel
        /// </summary>
        public static HydroMeterMatchingViewModel Create(HydroMeterViewModel parterViewModel)
        public static HydroMeterMatchingViewModel Create(HydroMeterViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroMeterMatchingViewModel(parterViewModel);
            return new HydroMeterMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -400,9 +388,9 @@
        /// <summary>
        /// 创建流量计自动匹配ViewModel
        /// </summary>
        public static HydroFlowmeterMatchingViewModel Create(HydroFlowmeterInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuFlowmeterResult calcuResult = null)
        public static HydroFlowmeterMatchingViewModel Create(HydroFlowmeterInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -410,19 +398,19 @@
            {
                return default;
            }
            return new HydroFlowmeterMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroFlowmeterMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建流量计自动匹配ViewModel
        /// </summary>
        public static HydroFlowmeterMatchingViewModel Create(HydroFlowmeterViewModel parterViewModel)
        public static HydroFlowmeterMatchingViewModel Create(HydroFlowmeterViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroFlowmeterMatchingViewModel(parterViewModel);
            return new HydroFlowmeterMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -432,9 +420,9 @@
        /// <summary>
        /// 创建压力表自动匹配ViewModel
        /// </summary>
        public static HydroPressmeterMatchingViewModel Create(HydroPressmeterInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuPressmeterResult calcuResult = null)
        public static HydroPressmeterMatchingViewModel Create(HydroPressmeterInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -442,19 +430,19 @@
            {
                return default;
            }
            return new HydroPressmeterMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroPressmeterMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建压力表自动匹配ViewModel
        /// </summary>
        public static HydroPressmeterMatchingViewModel Create(HydroPressmeterViewModel parterViewModel)
        public static HydroPressmeterMatchingViewModel Create(HydroPressmeterViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroPressmeterMatchingViewModel(parterViewModel);
            return new HydroPressmeterMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -464,9 +452,9 @@
        /// <summary>
        /// 创建管道自动匹配ViewModel
        /// </summary>
        public static HydroPipeMatchingViewModel Create(HydroPipeInfo pipeInfo, HydroModelInfo hydroInfo, HydroCalcuLinkResult calcuResult = null)
        public static HydroPipeMatchingViewModel Create(HydroPipeInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (pipeInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -474,19 +462,19 @@
            {
                return default;
            }
            return new HydroPipeMatchingViewModel(pipeInfo, hydroInfo, calcuResult);
            return new HydroPipeMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建管道自动匹配ViewModel
        /// </summary>
        public static HydroPipeMatchingViewModel Create(HydroPipeViewModel pipeViewModel)
        public static HydroPipeMatchingViewModel Create(HydroPipeViewModel visualViewModel)
        {
            if (pipeViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroPipeMatchingViewModel(pipeViewModel);
            return new HydroPipeMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -496,9 +484,9 @@
        /// <summary>
        /// 创建过渡件自动匹配ViewModel
        /// </summary>
        public static HydroTranslationMatchingViewModel Create(HydroTranslationInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuLinkResult calcuResult = null)
        public static HydroTranslationMatchingViewModel Create(HydroTranslationInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -506,19 +494,19 @@
            {
                return default;
            }
            return new HydroTranslationMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroTranslationMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建过渡件自动匹配ViewModel
        /// </summary>
        public static HydroTranslationMatchingViewModel Create(HydroTranslationViewModel parterViewModel)
        public static HydroTranslationMatchingViewModel Create(HydroTranslationViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroTranslationMatchingViewModel(parterViewModel);
            return new HydroTranslationMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -528,9 +516,9 @@
        /// <summary>
        /// 创建水泵自动匹配ViewModel
        /// </summary>
        public static HydroPumpMatchingViewModel Create(HydroPumpInfo pumpInfo, HydroModelInfo hydroInfo, HydroCalcuPumpResult calcuResult = null)
        public static HydroPumpMatchingViewModel Create(HydroPumpInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (pumpInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -538,19 +526,19 @@
            {
                return default;
            }
            return new HydroPumpMatchingViewModel(pumpInfo, hydroInfo, calcuResult);
            return new HydroPumpMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建水泵自动匹配ViewModel
        /// </summary>
        public static HydroPumpMatchingViewModel Create(HydroPumpViewModel pumpViewModel)
        public static HydroPumpMatchingViewModel Create(HydroPumpViewModel visualViewModel)
        {
            if (pumpViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroPumpMatchingViewModel(pumpViewModel);
            return new HydroPumpMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -560,9 +548,9 @@
        /// <summary>
        /// 创建阀门自动匹配ViewModel
        /// </summary>
        public static HydroValveMatchingViewModel Create(HydroValveInfo valveInfo, HydroModelInfo hydroInfo, HydroCalcuLinkResult calcuResult = null)
        public static HydroValveMatchingViewModel Create(HydroValveInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (valveInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -570,19 +558,19 @@
            {
                return default;
            }
            return new HydroValveMatchingViewModel(valveInfo, hydroInfo, calcuResult);
            return new HydroValveMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建阀门自动匹配ViewModel
        /// </summary>
        public static HydroValveMatchingViewModel Create(HydroValveViewModel valveViewModel)
        public static HydroValveMatchingViewModel Create(HydroValveViewModel visualViewModel)
        {
            if (valveViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroValveMatchingViewModel(valveViewModel);
            return new HydroValveMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -592,9 +580,9 @@
        /// <summary>
        /// 创建换热器自动匹配ViewModel
        /// </summary>
        public static HydroExchangerMatchingViewModel Create(HydroExchangerInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuLinkResult calcuResult = null)
        public static HydroExchangerMatchingViewModel Create(HydroExchangerInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -602,19 +590,19 @@
            {
                return default;
            }
            return new HydroExchangerMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroExchangerMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建换热器自动匹配ViewModel
        /// </summary>
        public static HydroExchangerMatchingViewModel Create(HydroExchangerViewModel parterViewModel)
        public static HydroExchangerMatchingViewModel Create(HydroExchangerViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroExchangerMatchingViewModel(parterViewModel);
            return new HydroExchangerMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -624,9 +612,9 @@
        /// <summary>
        /// 创建压缩机自动匹配ViewModel
        /// </summary>
        public static HydroCompressorMatchingViewModel Create(HydroCompressorInfo parterInfo, HydroModelInfo hydroInfo, HydroCalcuLinkResult calcuResult = null)
        public static HydroCompressorMatchingViewModel Create(HydroCompressorInfo visualInfo, HydroModelInfo hydroInfo)
        {
            if (parterInfo == null)
            if (visualInfo == null)
            {
                return default;
            }
@@ -634,19 +622,19 @@
            {
                return default;
            }
            return new HydroCompressorMatchingViewModel(parterInfo, hydroInfo, calcuResult);
            return new HydroCompressorMatchingViewModel(visualInfo, hydroInfo);
        }
        /// <summary>
        /// 创建压缩机自动匹配ViewModel
        /// </summary>
        public static HydroCompressorMatchingViewModel Create(HydroCompressorViewModel parterViewModel)
        public static HydroCompressorMatchingViewModel Create(HydroCompressorViewModel visualViewModel)
        {
            if (parterViewModel == null)
            if (visualViewModel == null)
            {
                return default;
            }
            return new HydroCompressorMatchingViewModel(parterViewModel);
            return new HydroCompressorMatchingViewModel(visualViewModel);
        }
        #endregion
@@ -901,6 +889,25 @@
            #endregion
            #region 水泵
            if (hydroInfo.Pumps != null && hydroInfo.Pumps.Count > 0)
            {
                if (matchingInfo.Pumps != null && matchingInfo.Pumps.Count > 0)
                {
                    hydroInfo.Pumps.ForEach(x =>
                    {
                        var matching = matchingInfo.Pumps.Find(t => t.Code == x.Code);
                        if (Apply(hydroInfo, x, matching))
                        {
                            result = true;
                        }
                    });
                }
            }
            #endregion
            #region 阀门
            if (hydroInfo.Valves != null && hydroInfo.Valves.Count > 0)
@@ -966,6 +973,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)
@@ -995,36 +1012,43 @@
            {
                if (!string.IsNullOrEmpty(matching.MatchingModelType))
                {
                    visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.ModelType = matching.MatchingModelType;
                    result = true;
                }
                if (!string.IsNullOrEmpty(matching.MatchingDbId))
                {
                    visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.DbId = matching.MatchingDbId;
                    result = true;
                }
                if (matching.MatchingMinLevel.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.MinLevel), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.MinLevel = matching.MatchingMinLevel.Value;
                    result = true;
                }
                if (matching.MatchingMaxLevel.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.MaxLevel), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.MaxLevel = matching.MatchingMaxLevel.Value;
                    result = true;
                }
                if (matching.MatchingDN.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.DN), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.DN = matching.MatchingDN.Value;
                    result = true;
                }
                if (matching.MatchingMinVol.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.MinVol), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.MinVol = matching.MatchingMinVol.Value;
                    result = true;
                }
                if (matching.MatchingOverFlow.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.OverFlow), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.OverFlow = matching.MatchingOverFlow.Value;
                    result = true;
                }
@@ -1067,6 +1091,16 @@
        #endregion
        #region 闷头
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroBluntheadViewModel visualViewModel, HydroBluntheadMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -1128,6 +1162,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>
        /// 应用
@@ -1208,6 +1252,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)
@@ -1281,6 +1335,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)
@@ -1338,6 +1402,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>
        /// 应用
@@ -1409,6 +1483,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)
@@ -1476,6 +1560,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)
@@ -1521,6 +1615,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>
        /// 应用
@@ -1574,6 +1678,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)
@@ -1619,6 +1733,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>
        /// 应用
@@ -1688,6 +1812,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>
        /// 应用
@@ -1773,6 +1907,16 @@
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroPumpViewModel visualViewModel, HydroPumpMatchingViewModel 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.HydroPumpInfo visual, HydroPumpMatchingViewModel matching)
        {
            if (hydroInfo == null)
@@ -1804,41 +1948,49 @@
            {
                if (!string.IsNullOrEmpty(matching.MatchingModelType))
                {
                    visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, $"通过基础数据匹配修复,原始数据:{visual.ModelType}");
                    visual.ModelType = matching.MatchingModelType;
                    result = true;
                }
                if (!string.IsNullOrEmpty(matching.MatchingDbId))
                {
                    visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, $"通过基础数据匹配修复,原始数据:{visual.DbId}");
                    visual.DbId = matching.MatchingDbId;
                    result = true;
                }
                if (matching.MatchingRatedQ.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.RatedQ), ePropStatus.Matching, $"通过基础数据匹配修复,原始数据:{visual.RatedQ}");
                    visual.RatedQ = matching.MatchingRatedQ.Value;
                    result = true;
                }
                if (matching.MatchingRatedH.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.RatedH), ePropStatus.Matching, $"通过基础数据匹配修复,原始数据:{visual.RatedH}");
                    visual.RatedH = matching.MatchingRatedH.Value;
                    result = true;
                }
                if (matching.MatchingRatedP.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.RatedP), ePropStatus.Matching, $"通过基础数据匹配修复,原始数据:{visual.RatedP}");
                    visual.RatedP = matching.MatchingRatedP.Value;
                    result = true;
                }
                if (matching.MatchingRatedN.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.RatedN), ePropStatus.Matching, $"通过基础数据匹配修复,原始数据:{visual.RatedN}");
                    visual.RatedN = matching.MatchingRatedN.Value;
                    result = true;
                }
                if (matching.MatchingRatedHz.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.RatedHz), ePropStatus.Matching, $"通过基础数据匹配修复,原始数据:{visual.RatedHz}");
                    visual.RatedHz = matching.MatchingRatedHz.Value;
                    result = true;
                }
                if (matching.MatchingCurrentHz.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.SpeedRatio), ePropStatus.Matching, $"通过基础数据匹配修复,原始数据:{visual.SpeedRatio}");
                    visual.SpeedRatio = matching.MatchingCurrentHz.Value / visual.RatedHz;
                    result = true;
                }
@@ -1863,6 +2015,7 @@
                            hydroInfo.Curves = new List<Yw.Model.HydroCurveInfo>();
                        }
                        hydroInfo.Curves.Add(curveqh);
                        visual.UpdatePropStatus(nameof(visual.CurveQH), ePropStatus.Matching, $"通过基础数据匹配修复");
                        visual.CurveQH = curveqh.Code;
                        result = true;
                    }
@@ -1894,6 +2047,7 @@
                            hydroInfo.Curves = new List<Yw.Model.HydroCurveInfo>();
                        }
                        hydroInfo.Curves.Add(curveqp);
                        visual.UpdatePropStatus(nameof(visual.CurveQP), ePropStatus.Matching, $"通过基础数据匹配修复");
                        visual.CurveQP = curveqp.Code;
                        result = true;
                    }
@@ -1925,6 +2079,7 @@
                            hydroInfo.Curves = new List<Yw.Model.HydroCurveInfo>();
                        }
                        hydroInfo.Curves.Add(curveqe);
                        visual.UpdatePropStatus(nameof(visual.CurveQE), ePropStatus.Matching, $"通过基础数据匹配修复");
                        visual.CurveQE = curveqe.Code;
                        result = true;
                    }
@@ -1946,6 +2101,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>
        /// 应用
@@ -1981,31 +2146,37 @@
            {
                if (!string.IsNullOrEmpty(matching.MatchingModelType))
                {
                    visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.ModelType = matching.MatchingModelType;
                    result = true;
                }
                if (!string.IsNullOrEmpty(matching.MatchingDbId))
                {
                    visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.DbId = matching.MatchingDbId;
                    result = true;
                }
                if (!string.IsNullOrEmpty(matching.MatchingMaterial))
                {
                    visual.UpdatePropStatus(nameof(visual.Material), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.Material = matching.MatchingMaterial;
                    result = true;
                }
                if (matching.MatchingDiameter.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.Diameter), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.Diameter = matching.MatchingDiameter.Value;
                    result = true;
                }
                if (matching.MatchingMinorLoss.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.MinorLoss), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.MinorLoss = matching.MatchingMinorLoss.Value;
                    result = true;
                }
                if (matching.MatchingValveType.HasValue)
                {
                    visual.UpdatePropStatus(nameof(visual.ValveType), ePropStatus.Matching, "通过基础数据匹配修复");
                    visual.ValveType = HydroValveTypeEnumHelper.GetValveTypeCode(matching.MatchingValveType.Value);
                    result = true;
                }
@@ -2015,6 +2186,7 @@
                        {
                            if (!string.IsNullOrEmpty(matching.MatchingValveSetting))
                            {
                                visual.UpdatePropStatus(nameof(visual.ValveSetting), ePropStatus.Matching, "通过基础数据匹配修复");
                                visual.ValveSetting = matching.MatchingValveSetting;
                                result = true;
                            }
@@ -2024,6 +2196,7 @@
                        {
                            if (!string.IsNullOrEmpty(matching.MatchingValveSetting))
                            {
                                visual.UpdatePropStatus(nameof(visual.ValveSetting), ePropStatus.Matching, "通过基础数据匹配修复");
                                visual.ValveSetting = matching.MatchingValveSetting;
                                result = true;
                            }
@@ -2033,6 +2206,7 @@
                        {
                            if (!string.IsNullOrEmpty(matching.MatchingValveSetting))
                            {
                                visual.UpdatePropStatus(nameof(visual.ValveSetting), ePropStatus.Matching, "通过基础数据匹配修复");
                                visual.ValveSetting = matching.MatchingValveSetting;
                                result = true;
                            }
@@ -2042,6 +2216,7 @@
                        {
                            if (!string.IsNullOrEmpty(matching.MatchingValveSetting))
                            {
                                visual.UpdatePropStatus(nameof(visual.ValveSetting), ePropStatus.Matching, "通过基础数据匹配修复");
                                visual.ValveSetting = matching.MatchingValveSetting;
                                result = true;
                            }
@@ -2134,6 +2309,16 @@
        #endregion
        #region 换热器
        /// <summary>
        /// 应用
        /// </summary>
        public static bool Apply(HydroExchangerViewModel visualViewModel, HydroExchangerMatchingViewModel matching)
        {
            var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching);
            visualViewModel.UpdateProperty();
            return bol;
        }
        /// <summary>
        /// 应用
@@ -2232,6 +2417,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)
@@ -2260,26 +2455,31 @@
                if (!string.IsNullOrEmpty(matching.MatchingModelType))
                {
                    visual.ModelType = matching.MatchingModelType;
                    visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Matching, "通过基础数据匹配修复");
                    result = true;
                }
                if (!string.IsNullOrEmpty(matching.MatchingDbId))
                {
                    visual.DbId = matching.MatchingDbId;
                    visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Matching, "通过基础数据匹配修复");
                    result = true;
                }
                if (!string.IsNullOrEmpty(matching.MatchingMaterial))
                {
                    visual.Material = matching.MatchingMaterial;
                    visual.UpdatePropStatus(nameof(visual.Material), ePropStatus.Matching, "通过基础数据匹配修复");
                    result = true;
                }
                if (matching.MatchingDiameter.HasValue)
                {
                    visual.Diameter = matching.MatchingDiameter.Value;
                    visual.UpdatePropStatus(nameof(visual.Diameter), ePropStatus.Matching, "通过基础数据匹配修复");
                    result = true;
                }
                if (matching.MatchingMinorLoss.HasValue)
                {
                    visual.MinorLoss = matching.MatchingMinorLoss.Value;
                    visual.UpdatePropStatus(nameof(visual.MinorLoss), ePropStatus.Matching, "通过基础数据匹配修复");
                    result = true;
                }