From db26311246d1c1cecadf4a22dc44ffa570ee40f2 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期二, 07 一月 2025 11:35:55 +0800 Subject: [PATCH] 批量修改数据同步修改 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/SimulationPropertyCtrl.cs | 131 +++++++++++++++++++++++++++++-------------- 1 files changed, 87 insertions(+), 44 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/SimulationPropertyCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/SimulationPropertyCtrl.cs index c6ee66b..90e6d3f 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/SimulationPropertyCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/SimulationPropertyCtrl.cs @@ -2,6 +2,7 @@ using HStation.WinFrmUI.PhartRelation; using HStation.WinFrmUI.Xhs; using Yw.Model; +using Yw.WinFrmUI.HydroW3d; namespace HStation.WinFrmUI { @@ -21,10 +22,9 @@ this.hydroVisualPropertyCtrl1.PropertyValueChangedEvent += HydroVisualPropertyCtrl1_PropertyValueChangedEvent; this.hydroVisualPropertyCtrl1.MarkPropertyValueChangedEvent += HydroVisualPropertyCtrl1_MarkPropertyValueChangedEvent; this.hydroVisualPropertyCtrl1.GradingPropertyValueChangedEvent += HydroPVisualPropertyCtrl1_GradingPropertyValueChangedEvent; - this.hydroVisualPropertyCtrl1.FlowEffectPropertyValueChangedEvent += HydroVisualPropertyCtrl1_FlowEffectPropertyValueChangedEvent; } - #region 浜嬩欢闆� + #region 浜嬩欢闆嗗悎 /// <summary> /// 鏋勪欢鏌ョ湅浜嬩欢 @@ -53,12 +53,19 @@ /// </summary> public event Action<HydroVisualInfo> GradingPropertyValueChangedEvent; - /// <summary> - /// 姘存祦鍔ㄧ敾灞炴�у�兼敼鍙樹簨浠� - /// </summary> - public event Action<HydroVisualInfo> FlowEffectPropertyValueChangedEvent; + #endregion - #endregion 浜嬩欢闆� + /// <summary> + /// 鍒濆鍖栨暟鎹� + /// </summary> + public void InitialData + ( + HydroChangeHelper changeHelper, + HydroPropStatusHelper propStatusHelper + ) + { + this.hydroVisualPropertyCtrl1.InitialData(changeHelper, propStatusHelper); + } #region 灞炴�ц祴鍊� @@ -80,7 +87,12 @@ set { this.hydroVisualPropertyCtrl1.SelectedObject = value; } } - #endregion 灞炴�ц祴鍊� + /// <summary> + /// 璁$畻缁撴灉 + /// </summary> + public Func<HydroCalcuResult> CalcuResult { get; set; } + + #endregion #region 灞炴�ф洿鏂� @@ -114,7 +126,7 @@ this.hydroVisualPropertyCtrl1.UpdateRows(); } - #endregion 灞炴�ф洿鏂� + #endregion #region 浜嬩欢瀹炵幇 @@ -167,7 +179,7 @@ { var bluntheadViewModel = vm as HydroBluntheadViewModel; var input = HydroMatchingHelper.Create(bluntheadViewModel); - var dlg = new SimulationBluntheadSingleMatchingDlg(); + var dlg = new AssetsBluntheadSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(bluntheadViewModel, output); @@ -185,7 +197,7 @@ { var elbowViewModel = vm as HydroElbowViewModel; var input = HydroMatchingHelper.Create(elbowViewModel); - var dlg = new SimulationElbowSingleMatchingDlg(); + var dlg = new AssetsElbowSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(elbowViewModel, output); @@ -203,7 +215,7 @@ { var threelinkViewModel = vm as HydroThreelinkViewModel; var input = HydroMatchingHelper.Create(threelinkViewModel); - var dlg = new SimulationThreelinkSingleMatchingDlg(); + var dlg = new AssetsThreelinkSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(threelinkViewModel, output); @@ -221,7 +233,7 @@ { var fourlinkViewModel = vm as HydroFourlinkViewModel; var input = HydroMatchingHelper.Create(fourlinkViewModel); - var dlg = new SimulationFourlinkSingleMatchingDlg(); + var dlg = new AssetsFourlinkSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(fourlinkViewModel, output); @@ -293,7 +305,7 @@ { var nozzleViewModel = vm as HydroNozzleViewModel; var input = HydroMatchingHelper.Create(nozzleViewModel); - var dlg = new SimulationSprinklerSingleMatchingDlg(); + var dlg = new AssetsSprinklerSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(nozzleViewModel, output); @@ -311,10 +323,28 @@ { var hydrantViewModel = vm as HydroHydrantViewModel; var input = HydroMatchingHelper.Create(hydrantViewModel); - var dlg = new SimulationHydrantSingleMatchingDlg(); + var dlg = new AssetsHydrantSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(hydrantViewModel, output); + this.hydroVisualPropertyCtrl1.UpdateRows(); + this.PropertyValueChangedEvent?.Invoke(vm.Vmo); + this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); + this.GradingPropertyValueChangedEvent?.Invoke(vm.Vmo); + }; + dlg.SetBindingData(input); + dlg.ShowDialog(); + } + break; + + case Yw.Hydro.ParterCatalog.Cooling: + { + var coolingViewModel = vm as HydroCoolingViewModel; + var input = HydroMatchingHelper.Create(coolingViewModel); + var dlg = new AssetsCoolingSingleMatchingDlg(); + dlg.ReloadDataEvent += (output) => + { + HydroMatchingHelper.Apply(coolingViewModel, output); this.hydroVisualPropertyCtrl1.UpdateRows(); this.PropertyValueChangedEvent?.Invoke(vm.Vmo); this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); @@ -329,7 +359,7 @@ { var pipeViewModel = vm as HydroPipeViewModel; var input = HydroMatchingHelper.Create(pipeViewModel); - var dlg = new SimulationPipeSingleMatchingDlg(); + var dlg = new AssetsPipeSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(pipeViewModel, output); @@ -429,12 +459,16 @@ { case HydroCurve.Tank: { - if (long.TryParse(vm.DbId, out long longDbId)) + var tankViewModel = vm as HydroTankViewModel; + var curveInfo = tankViewModel.HydroInfo.Curves?.Find(x => x.Code == tankViewModel.VolCurve); + if (curveInfo != null) { - var tankViewModel = vm as HydroTankViewModel; - var dlg = new AssetsTankCurveVOLViewDlg(); - dlg.SetBindingData(longDbId); - dlg.ShowDialog(); + if (long.TryParse(curveInfo.DbId, out long longDbId)) + { + var dlg = new AssetsTankCurveVOLViewDlg(); + dlg.SetBindingData(longDbId); + dlg.ShowDialog(); + } } } break; @@ -450,43 +484,55 @@ pumpViewModel.UpdateProperty(); this.hydroVisualPropertyCtrl1.UpdateRows(); }; - dlg.SetBindingData(pumpViewModel); + dlg.SetBindingData(pumpViewModel, this.CalcuResult?.Invoke()); dlg.ShowDialog(); } break; case HydroCurve.Valve: { - if (long.TryParse(vm.DbId, out long longDbId)) + var valveViewModel = vm as HydroValveViewModel; + var curveInfo = valveViewModel.HydroInfo.Curves?.Find(x => x.Code == valveViewModel.ValveSetting); + if (curveInfo != null) { - var valveViewModel = vm as HydroValveViewModel; - var dlg = new AssetsValveCurveViewDlg(); - dlg.SetBindingData(longDbId); - dlg.ShowDialog(); + if (long.TryParse(curveInfo.DbId, out long longDbId)) + { + var dlg = new AssetsValveCurveViewDlg(); + dlg.SetBindingData(longDbId); + dlg.ShowDialog(); + } } } break; case HydroCurve.Exchanger: { - if (long.TryParse(vm.DbId, out long longDbId)) + var exchangerViewModel = vm as HydroExchangerViewModel; + var curveInfo = exchangerViewModel.HydroInfo.Curves?.Find(x => x.Code == exchangerViewModel.CurveQL); + if (curveInfo != null) { - var exchangerViewModel = vm as HydroExchangerViewModel; - var dlg = new AssetsExchangerCurveQLViewDlg(); - dlg.SetBindingData(longDbId); - dlg.ShowDialog(); + if (long.TryParse(curveInfo.DbId, out long longDbId)) + { + var dlg = new AssetsExchangerCurveQLViewDlg(); + dlg.SetBindingData(longDbId); + dlg.ShowDialog(); + } } } break; case HydroCurve.Compressor: { - if (long.TryParse(vm.DbId, out long longDbId)) + var compressorViewModel = vm as HydroCompressorViewModel; + var curveInfo = compressorViewModel.HydroInfo.Curves?.Find(x => x.Code == compressorViewModel.CurveQL); + if (curveInfo != null) { - var compressorViewModel = vm as HydroCompressorViewModel; - var dlg = new AssetsCompressorCurveQLViewDlg(); - dlg.SetBindingData(longDbId); - dlg.ShowDialog(); + if (long.TryParse(curveInfo.DbId, out long longDbId)) + { + var dlg = new AssetsCompressorCurveQLViewDlg(); + dlg.SetBindingData(longDbId); + dlg.ShowDialog(); + } } } break; @@ -495,7 +541,7 @@ } } - #endregion 浜嬩欢瀹炵幇 + #endregion #region 浜嬩欢绌块�� @@ -537,12 +583,9 @@ this.GradingPropertyValueChangedEvent?.Invoke(vm?.Vmo); } - //姘存祦鍔ㄧ敾灞炴�у彂鐢熸敼鍙� - private void HydroVisualPropertyCtrl1_FlowEffectPropertyValueChangedEvent(HydroVisualViewModel vm) - { - this.FlowEffectPropertyValueChangedEvent?.Invoke(vm?.Vmo); - } - #endregion 浜嬩欢绌块�� + #endregion + + } } \ No newline at end of file -- Gitblit v1.9.3