using DevExpress.CodeParser;
|
|
namespace Yw.WinFrmUI
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public static class HydroParterInfoUpdateExtensions
|
{
|
/// <summary>
|
/// 更新属性
|
/// </summary>
|
/// <param name="rhs"></param>
|
/// <param name="allPaterList"></param>
|
/// <param name="propertyViewModel"></param>
|
public static void UpdateProperty(this Yw.Model.HydroParterInfo rhs, List<Yw.Model.HydroParterInfo> allPaterList, HydroParterPropertyViewModel propertyViewModel)
|
{
|
if (rhs == null)
|
{
|
return;
|
}
|
if (propertyViewModel == null)
|
{
|
return;
|
}
|
rhs.ID = propertyViewModel.ID;
|
rhs.Catalog = HydroParterCatalogHelper.GetCatalogCode(propertyViewModel.Catalog);
|
rhs.Name = propertyViewModel.Name;
|
rhs.Code = propertyViewModel.Code;
|
rhs.ModelType = propertyViewModel.ModelType;
|
rhs.DbId = propertyViewModel.DbId;
|
rhs.DbLocked = propertyViewModel.DbLocked;
|
rhs.Flags = Yw.Untity.FlagsHelper.ToList(propertyViewModel.Flags);
|
rhs.Description = propertyViewModel.Description;
|
|
//节点
|
if (rhs is Yw.Model.HydroNodeInfo hydroNodeInfo)
|
{
|
if (propertyViewModel is HydroNodePropertyViewModel hydroNodePropertyViewModel)
|
{
|
hydroNodeInfo.Quality = hydroNodePropertyViewModel.Quality;
|
hydroNodeInfo.UpdatePropStatus(nameof(hydroNodeInfo.Quality), hydroNodePropertyViewModel, nameof(hydroNodePropertyViewModel.Quality));
|
}
|
}
|
//水源
|
if (rhs is Yw.Model.HydroSourceInfo hydroSourceInfo)
|
{
|
if (propertyViewModel is HydroSourcePropertyViewModel hydroSourcePropertyViewModel)
|
{
|
|
}
|
}
|
//水库
|
if (rhs is Yw.Model.HydroReservoirInfo hydroReservoirInfo)
|
{
|
if (propertyViewModel is HydroReservoirPropertyViewModel hydroReservoirPropertyViewModel)
|
{
|
hydroReservoirInfo.PoolElev = hydroReservoirPropertyViewModel.PoolElev;
|
hydroReservoirInfo.UpdatePropStatus(nameof(hydroReservoirInfo.PoolElev), hydroReservoirPropertyViewModel, nameof(hydroReservoirPropertyViewModel.PoolElev));
|
hydroReservoirInfo.Head = hydroReservoirPropertyViewModel.Head;
|
hydroReservoirInfo.UpdatePropStatus(nameof(hydroReservoirInfo.Head), hydroReservoirPropertyViewModel, nameof(hydroReservoirPropertyViewModel.Head));
|
hydroReservoirInfo.HeadPattern = hydroReservoirPropertyViewModel.HeadPattern;
|
hydroReservoirInfo.UpdatePropStatus(nameof(hydroReservoirInfo.HeadPattern), hydroReservoirPropertyViewModel, nameof(hydroReservoirPropertyViewModel.HeadPattern));
|
}
|
}
|
//水池
|
if (rhs is Yw.Model.HydroTankInfo hydroTankInfo)
|
{
|
if (propertyViewModel is HydroTankPropertyViewModel hydroTankPropertyViewModel)
|
{
|
hydroTankInfo.PoolElev = hydroTankPropertyViewModel.PoolElev;
|
hydroTankInfo.UpdatePropStatus(nameof(hydroTankInfo.PoolElev), hydroTankPropertyViewModel, nameof(hydroTankPropertyViewModel.PoolElev));
|
hydroTankInfo.InitLevel = hydroTankPropertyViewModel.InitLevel;
|
hydroTankInfo.UpdatePropStatus(nameof(hydroTankInfo.InitLevel), hydroTankPropertyViewModel, nameof(hydroTankPropertyViewModel.InitLevel));
|
hydroTankInfo.MinLevel = hydroTankPropertyViewModel.MinLevel;
|
hydroTankInfo.UpdatePropStatus(nameof(hydroTankInfo.MinLevel), hydroTankPropertyViewModel, nameof(hydroTankPropertyViewModel.MinLevel));
|
hydroTankInfo.MaxLevel = hydroTankPropertyViewModel.MaxLevel;
|
hydroTankInfo.UpdatePropStatus(nameof(hydroTankInfo.MaxLevel), hydroTankPropertyViewModel, nameof(hydroTankPropertyViewModel.MaxLevel));
|
hydroTankInfo.Diameter = hydroTankPropertyViewModel.Diameter;
|
hydroTankInfo.UpdatePropStatus(nameof(hydroTankInfo.Diameter), hydroTankPropertyViewModel, nameof(hydroTankPropertyViewModel.Diameter));
|
hydroTankInfo.MinVol = hydroTankPropertyViewModel.MinVol;
|
hydroTankInfo.UpdatePropStatus(nameof(hydroTankInfo.MinVol), hydroTankPropertyViewModel, nameof(hydroTankPropertyViewModel.MinVol));
|
hydroTankInfo.VolCurve = hydroTankPropertyViewModel.VolCurve;
|
hydroTankInfo.UpdatePropStatus(nameof(hydroTankInfo.VolCurve), hydroTankPropertyViewModel, nameof(hydroTankPropertyViewModel.VolCurve));
|
hydroTankInfo.OverFlow = hydroTankPropertyViewModel.OverFlow;
|
hydroTankInfo.UpdatePropStatus(nameof(hydroTankInfo.OverFlow), hydroTankPropertyViewModel, nameof(hydroTankPropertyViewModel.OverFlow));
|
}
|
}
|
//水箱
|
if (rhs is Yw.Model.HydroWaterboxInfo hydroWaterboxInfo)
|
{
|
if (propertyViewModel is HydroWaterboxPropertyViewModel hydroWaterboxPropertyViewModel)
|
{
|
|
}
|
}
|
//连接节点
|
if (rhs is Yw.Model.HydroJunctionInfo hydroJunctionInfo)
|
{
|
if (propertyViewModel is HydroJunctionPropertyViewModel hydroJunctionPropertyViewModel)
|
{
|
hydroJunctionInfo.Elev = hydroJunctionPropertyViewModel.Elev;
|
hydroJunctionInfo.UpdatePropStatus(nameof(hydroJunctionInfo.Elev), hydroJunctionPropertyViewModel, nameof(hydroJunctionPropertyViewModel.Elev));
|
hydroJunctionInfo.Demand = hydroJunctionPropertyViewModel.Demand;
|
hydroJunctionInfo.UpdatePropStatus(nameof(hydroJunctionInfo.Demand), hydroJunctionPropertyViewModel, nameof(hydroJunctionPropertyViewModel.Demand));
|
hydroJunctionInfo.DemandPattern = hydroJunctionPropertyViewModel.DemandPattern;
|
hydroJunctionInfo.UpdatePropStatus(nameof(hydroJunctionInfo.DemandPattern), hydroJunctionPropertyViewModel, nameof(hydroJunctionPropertyViewModel.DemandPattern));
|
}
|
}
|
//扩散器
|
if (rhs is Yw.Model.HydroEmitterInfo hydroEmitterInfo)
|
{
|
if (propertyViewModel is HydroEmitterPropertyViewModel hydroEmitterPropertyViewModel)
|
{
|
hydroEmitterInfo.Coefficient = hydroEmitterPropertyViewModel.Coefficient;
|
hydroEmitterInfo.UpdatePropStatus(nameof(hydroEmitterInfo.Coefficient), hydroEmitterPropertyViewModel, nameof(hydroEmitterPropertyViewModel.Coefficient));
|
}
|
}
|
//喷嘴
|
if (rhs is Yw.Model.HydroNozzleInfo hydroNozzleInfo)
|
{
|
if (propertyViewModel is HydroNozzlePropertyViewModel hydroNozzlePropertyViewModel)
|
{
|
|
}
|
}
|
//消火栓
|
if (rhs is Yw.Model.HydroHydrantInfo hydroHydrantInfo)
|
{
|
if (propertyViewModel is HydroHydrantPropertyViewModel hydroHydrantPropertyViewModel)
|
{
|
|
}
|
}
|
//连接件
|
if (rhs is Yw.Model.HydroConnectInfo hydroConnectInfo)
|
{
|
if (propertyViewModel is HydroConnectPropertyViewModel hydroConnectPropertyViewModel)
|
{
|
hydroConnectInfo.Material = hydroConnectPropertyViewModel.Material;
|
hydroConnectInfo.UpdatePropStatus(nameof(hydroConnectInfo.Material), hydroConnectPropertyViewModel, nameof(hydroConnectPropertyViewModel.Material));
|
hydroConnectInfo.Caliber = hydroConnectPropertyViewModel.Caliber;
|
hydroConnectInfo.UpdatePropStatus(nameof(hydroConnectInfo.Caliber), hydroConnectPropertyViewModel, nameof(hydroConnectPropertyViewModel.Caliber));
|
hydroConnectInfo.MinorLoss = hydroConnectPropertyViewModel.MinorLoss;
|
hydroConnectInfo.UpdatePropStatus(nameof(hydroConnectInfo.MinorLoss), hydroConnectPropertyViewModel, nameof(hydroConnectPropertyViewModel.MinorLoss));
|
}
|
}
|
//闷头
|
if (rhs is Yw.Model.HydroBluntheadInfo hydroBluntheadInfo)
|
{
|
if (propertyViewModel is HydroBluntheadPropertyViewModel hydroBluntheadPropertyViewModel)
|
{
|
|
}
|
}
|
//弯头
|
if (rhs is Yw.Model.HydroElbowInfo hydroElbowInfo)
|
{
|
if (propertyViewModel is HydroElbowPropertyViewModel hydroElbowPropertyViewModel)
|
{
|
|
}
|
}
|
//三通
|
if (rhs is Yw.Model.HydroThreelinkInfo hydroThreelinkInfo)
|
{
|
if (propertyViewModel is HydroThreelinkPropertyViewModel hydroThreelinkPropertyViewModel)
|
{
|
|
}
|
}
|
//四通
|
if (rhs is Yw.Model.HydroFourlinkInfo hydroFourlinkInfo)
|
{
|
if (propertyViewModel is HydroFourlinkPropertyViewModel hydroFourlinkPropertyViewModel)
|
{
|
|
}
|
}
|
//水表
|
if (rhs is Yw.Model.HydroMeterInfo hydroMeterInfo)
|
{
|
if (propertyViewModel is HydroMeterPropertyViewModel hydroMeterPropertyViewModel)
|
{
|
|
}
|
}
|
//流量计
|
if (rhs is Yw.Model.HydroFlowmeterInfo hydroFlowmeterInfo)
|
{
|
if (propertyViewModel is HydroFlowmeterPropertyViewModel hydroFlowmeterPropertyViewModel)
|
{
|
|
}
|
}
|
//压力表
|
if (rhs is Yw.Model.HydroPressmeterInfo hydroPressmeterInfo)
|
{
|
if (propertyViewModel is HydroPressmeterPropertyViewModel hydroPressmeterPropertyViewModel)
|
{
|
|
}
|
}
|
|
//管段
|
if (rhs is Yw.Model.HydroLinkInfo hydroLinkInfo)
|
{
|
if (propertyViewModel is HydroLinkPropertyViewModel hydroLinkPropertyViewModel)
|
{
|
hydroLinkInfo.StartCode = hydroLinkPropertyViewModel.StartCode;
|
hydroLinkInfo.UpdatePropStatus(nameof(hydroLinkInfo.StartCode), hydroLinkPropertyViewModel, nameof(hydroLinkPropertyViewModel.StartCode));
|
hydroLinkInfo.EndCode = hydroLinkPropertyViewModel.EndCode;
|
hydroLinkInfo.UpdatePropStatus(nameof(hydroLinkInfo.EndCode), hydroLinkPropertyViewModel, nameof(hydroLinkPropertyViewModel.EndCode));
|
hydroLinkInfo.LinkStatus = HydroLinkStatusHelper.GetStatusCode(hydroLinkPropertyViewModel.LinkStatus);
|
hydroLinkInfo.UpdatePropStatus(nameof(hydroLinkInfo.LinkStatus), hydroLinkPropertyViewModel, nameof(hydroLinkPropertyViewModel.LinkStatus));
|
}
|
}
|
//管道
|
if (rhs is Yw.Model.HydroPipeInfo hydroPipeInfo)
|
{
|
if (propertyViewModel is HydroPipePropertyViewModel hydroPipePropertyViewModel)
|
{
|
hydroPipeInfo.Diameter = hydroPipePropertyViewModel.Diameter;
|
hydroPipeInfo.UpdatePropStatus(nameof(hydroPipeInfo.Diameter), hydroPipePropertyViewModel, nameof(hydroPipePropertyViewModel.Diameter));
|
hydroPipeInfo.Length = hydroPipePropertyViewModel.Length;
|
hydroPipeInfo.UpdatePropStatus(nameof(hydroPipeInfo.Length), hydroPipePropertyViewModel, nameof(hydroPipePropertyViewModel.Length));
|
hydroPipeInfo.Roughness = hydroPipePropertyViewModel.Roughness;
|
hydroPipeInfo.UpdatePropStatus(nameof(hydroPipeInfo.Roughness), hydroPipePropertyViewModel, nameof(hydroPipePropertyViewModel.Roughness));
|
hydroPipeInfo.MinorLoss = hydroPipePropertyViewModel.MinorLoss;
|
hydroPipeInfo.UpdatePropStatus(nameof(hydroPipeInfo.MinorLoss), hydroPipePropertyViewModel, nameof(hydroPipePropertyViewModel.MinorLoss));
|
}
|
}
|
//过渡件
|
if (rhs is Yw.Model.HydroTranslationInfo hydroTranslationInfo)
|
{
|
if (propertyViewModel is HydroTranslationPropertyViewModel hydroTranslationPropertyViewModel)
|
{
|
|
}
|
}
|
//换热器
|
if (rhs is Yw.Model.HydroExchangerInfo hydroExchangerInfo)
|
{
|
if (propertyViewModel is HydroExchangerPropertyViewModel hydroExchangerPropertyViewModel)
|
{
|
|
}
|
}
|
//水泵
|
if (rhs is Yw.Model.HydroPumpInfo hydroPumpInfo)
|
{
|
if (propertyViewModel is HydroPumpPropertyViewModel hydroPumpPropertyViewModel)
|
{
|
hydroPumpInfo.RatedP = hydroPumpPropertyViewModel.RatedP;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.RatedP), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.RatedP));
|
hydroPumpInfo.RatedQ = hydroPumpPropertyViewModel.RatedQ;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.RatedQ), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.RatedQ));
|
hydroPumpInfo.RatedH = hydroPumpPropertyViewModel.RatedH;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.RatedH), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.RatedH));
|
hydroPumpInfo.RatedN = hydroPumpPropertyViewModel.RatedN;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.RatedN), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.RatedN));
|
hydroPumpInfo.CurveQH = hydroPumpPropertyViewModel.CurveQH;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.CurveQH), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.CurveQH));
|
hydroPumpInfo.CurveQP = hydroPumpPropertyViewModel.CurveQP;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.CurveQP), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.CurveQP));
|
hydroPumpInfo.CurveQE = hydroPumpPropertyViewModel.CurveQE;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.CurveQE), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.CurveQE));
|
hydroPumpInfo.SpeedRatio = hydroPumpPropertyViewModel.SpeedRatio;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.SpeedRatio), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.SpeedRatio));
|
hydroPumpInfo.SpeedRatioPattern = hydroPumpPropertyViewModel.SpeedRatioPattern;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.SpeedRatioPattern), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.SpeedRatioPattern));
|
hydroPumpInfo.Price = hydroPumpPropertyViewModel.Price;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.Price), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.Price));
|
hydroPumpInfo.PricePattern = hydroPumpPropertyViewModel.PricePattern;
|
hydroPumpInfo.UpdatePropStatus(nameof(hydroPumpInfo.PricePattern), hydroPumpPropertyViewModel, nameof(hydroPumpPropertyViewModel.PricePattern));
|
}
|
}
|
//阀门
|
if (rhs is Yw.Model.HydroValveInfo hydroValveInfo)
|
{
|
if (propertyViewModel is HydroValvePropertyViewModel hydroValvePropertyViewModel)
|
{
|
hydroValveInfo.Diameter = hydroValvePropertyViewModel.Diameter;
|
hydroValveInfo.UpdatePropStatus(nameof(hydroValveInfo.Diameter), hydroValvePropertyViewModel, nameof(hydroValvePropertyViewModel.Diameter));
|
hydroValveInfo.MinorLoss = hydroValvePropertyViewModel.MinorLoss;
|
hydroValveInfo.UpdatePropStatus(nameof(hydroValveInfo.MinorLoss), hydroValvePropertyViewModel, nameof(hydroValvePropertyViewModel.MinorLoss));
|
hydroValveInfo.ValveType = hydroValvePropertyViewModel.ValveType;
|
hydroValveInfo.UpdatePropStatus(nameof(hydroValveInfo.ValveType), hydroValvePropertyViewModel, nameof(hydroValvePropertyViewModel.ValveType));
|
hydroValveInfo.ValveSetting = hydroValvePropertyViewModel.ValveSetting;
|
hydroValveInfo.UpdatePropStatus(nameof(hydroValveInfo.ValveSetting), hydroValvePropertyViewModel, nameof(hydroValvePropertyViewModel.ValveSetting));
|
}
|
}
|
|
}
|
}
|
}
|