From f34b7d74e30f1c902d87e0cae6bd02a02d991492 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期一, 23 十二月 2024 21:32:29 +0800 Subject: [PATCH] 属性控件bug修复 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/SimulationPropertyCtrl.cs | 118 ++++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 80 insertions(+), 38 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 cba2e61..5cdc0f6 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 { @@ -58,9 +59,18 @@ /// </summary> public event Action<HydroVisualInfo> FlowEffectPropertyValueChangedEvent; - #endregion + #endregion 浜嬩欢闆� #region 灞炴�ц祴鍊� + + /// <summary> + /// 鍏佽缂栬緫 + /// </summary> + public bool AllowEdit + { + get { return this.hydroVisualPropertyCtrl1.AllowEdit; } + set { this.hydroVisualPropertyCtrl1.AllowEdit = value; } + } /// <summary> /// 閫夋嫨瀵硅薄 @@ -71,7 +81,7 @@ set { this.hydroVisualPropertyCtrl1.SelectedObject = value; } } - #endregion + #endregion 灞炴�ц祴鍊� #region 灞炴�ф洿鏂� @@ -105,7 +115,7 @@ this.hydroVisualPropertyCtrl1.UpdateRows(); } - #endregion + #endregion 灞炴�ф洿鏂� #region 浜嬩欢瀹炵幇 @@ -122,7 +132,7 @@ { var tankViewModel = vm as HydroTankViewModel; var input = HydroMatchingHelper.Create(tankViewModel); - var dlg = new SimulationTankSingleMatchingDlg(); + var dlg = new AssetsTankSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(tankViewModel, output); @@ -135,11 +145,12 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Waterbox: { var tankViewModel = vm as HydroTankViewModel; var input = HydroMatchingHelper.Create(tankViewModel); - var dlg = new SimulationTankSingleMatchingDlg(); + var dlg = new AssetsTankSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(tankViewModel, output); @@ -152,6 +163,7 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Blunthead: { var bluntheadViewModel = vm as HydroBluntheadViewModel; @@ -169,6 +181,7 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Elbow: { var elbowViewModel = vm as HydroElbowViewModel; @@ -186,6 +199,7 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Threelink: { var threelinkViewModel = vm as HydroThreelinkViewModel; @@ -203,6 +217,7 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Fourlink: { var fourlinkViewModel = vm as HydroFourlinkViewModel; @@ -220,11 +235,12 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Meter: { var meterViewModel = vm as HydroMeterViewModel; var input = HydroMatchingHelper.Create(meterViewModel); - var dlg = new SimulationMeterSingleMatchingDlg(); + var dlg = new AssetsMeterSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(meterViewModel, output); @@ -237,11 +253,12 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Flowmeter: { var flowmeterViewModel = vm as HydroFlowmeterViewModel; var input = HydroMatchingHelper.Create(flowmeterViewModel); - var dlg = new SimulationFlowmeterSingleMatchingDlg(); + var dlg = new AssetsFlowmeterSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(flowmeterViewModel, output); @@ -254,11 +271,12 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Pressmeter: { var pressmeterViewModel = vm as HydroPressmeterViewModel; var input = HydroMatchingHelper.Create(pressmeterViewModel); - var dlg = new SimulationPressmeterSingleMatchingDlg(); + var dlg = new AssetsPressmeterSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(pressmeterViewModel, output); @@ -271,6 +289,7 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Nozzle: { var nozzleViewModel = vm as HydroNozzleViewModel; @@ -288,6 +307,7 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Hydrant: { var hydrantViewModel = vm as HydroHydrantViewModel; @@ -305,6 +325,7 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Pipe: { var pipeViewModel = vm as HydroPipeViewModel; @@ -321,6 +342,7 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Pump: { var pumpViewModel = vm as HydroPumpViewModel; @@ -338,11 +360,12 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Valve: { var valveViewModel = vm as HydroValveViewModel; var input = HydroMatchingHelper.Create(valveViewModel); - var dlg = new SimulationValveSingleMatchingDlg(); + var dlg = new AssetsValveSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(valveViewModel, output); @@ -355,11 +378,12 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Exchanger: { var exchangerViewModel = vm as HydroExchangerViewModel; var input = HydroMatchingHelper.Create(exchangerViewModel); - var dlg = new SimulationExchangerSingleMatchingDlg(); + var dlg = new AssetsExchangerSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(exchangerViewModel, output); @@ -372,11 +396,12 @@ dlg.ShowDialog(); } break; + case Yw.Hydro.ParterCatalog.Compressor: { var compressorViewModel = vm as HydroCompressorViewModel; var input = HydroMatchingHelper.Create(compressorViewModel); - var dlg = new SimulationCompressorSingleMatchingDlg(); + var dlg = new AssetsCompressorSingleMatchingDlg(); dlg.ReloadDataEvent += (output) => { HydroMatchingHelper.Apply(compressorViewModel, output); @@ -389,8 +414,8 @@ dlg.ShowDialog(); } break; - default: break; + default: break; } } @@ -405,16 +430,20 @@ { 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 TankChartShowDlg(); - dlg.SetBingingData(longDbId); - dlg.ShowDialog(); + if (long.TryParse(curveInfo.DbId, out long longDbId)) + { + var dlg = new AssetsTankCurveVOLViewDlg(); + dlg.SetBindingData(longDbId); + dlg.ShowDialog(); + } } - } break; + case HydroCurve.Pump: { var pumpViewModel = vm as HydroPumpViewModel; @@ -430,45 +459,60 @@ 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 ValveChartShowDlg(); - dlg.SetBingingData(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 ExchangerChartShowDlg(); - dlg.SetBingingData(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 CompressorChartShowDlg(); - dlg.SetBingingData(longDbId); - dlg.ShowDialog(); + if (long.TryParse(curveInfo.DbId, out long longDbId)) + { + var dlg = new AssetsCompressorCurveQLViewDlg(); + dlg.SetBindingData(longDbId); + dlg.ShowDialog(); + } } } break; + default: break; } } - #endregion + #endregion 浜嬩欢瀹炵幇 #region 浜嬩欢绌块�� @@ -516,8 +560,6 @@ this.FlowEffectPropertyValueChangedEvent?.Invoke(vm?.Vmo); } - #endregion - - + #endregion 浜嬩欢绌块�� } } \ No newline at end of file -- Gitblit v1.9.3