From 6e73556d8e2517c7cf4f76efdbff9e3fed01fb5f Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期五, 20 十二月 2024 16:21:28 +0800
Subject: [PATCH] 泵匹配方法修改

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/SimulationPropertyCtrl.cs |  154 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 128 insertions(+), 26 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 ec67a0a..c6ee66b 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
@@ -58,9 +58,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 +80,7 @@
             set { this.hydroVisualPropertyCtrl1.SelectedObject = value; }
         }
 
-        #endregion
+        #endregion 灞炴�ц祴鍊�
 
         #region 灞炴�ф洿鏂�
 
@@ -122,30 +131,38 @@
                     {
                         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);
                             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.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);
                             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.Blunthead:
                     {
                         var bluntheadViewModel = vm as HydroBluntheadViewModel;
@@ -155,11 +172,15 @@
                         {
                             HydroMatchingHelper.Apply(bluntheadViewModel, 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.Elbow:
                     {
                         var elbowViewModel = vm as HydroElbowViewModel;
@@ -169,11 +190,15 @@
                         {
                             HydroMatchingHelper.Apply(elbowViewModel, 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.Threelink:
                     {
                         var threelinkViewModel = vm as HydroThreelinkViewModel;
@@ -183,11 +208,15 @@
                         {
                             HydroMatchingHelper.Apply(threelinkViewModel, 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.Fourlink:
                     {
                         var fourlinkViewModel = vm as HydroFourlinkViewModel;
@@ -197,53 +226,69 @@
                         {
                             HydroMatchingHelper.Apply(fourlinkViewModel, 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.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);
                             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.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);
                             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.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);
                             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.Nozzle:
                     {
                         var nozzleViewModel = vm as HydroNozzleViewModel;
@@ -253,11 +298,15 @@
                         {
                             HydroMatchingHelper.Apply(nozzleViewModel, 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.Hydrant:
                     {
                         var hydrantViewModel = vm as HydroHydrantViewModel;
@@ -267,11 +316,15 @@
                         {
                             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.Pipe:
                     {
                         var pipeViewModel = vm as HydroPipeViewModel;
@@ -281,10 +334,14 @@
                         {
                             HydroMatchingHelper.Apply(pipeViewModel, output);
                             this.hydroVisualPropertyCtrl1.UpdateRows();
+                            this.PropertyValueChangedEvent?.Invoke(vm.Vmo);
+                            this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo);
+                            this.GradingPropertyValueChangedEvent?.Invoke(vm.Vmo);
                         };
                         dlg.ShowDialog();
                     }
                     break;
+
                 case Yw.Hydro.ParterCatalog.Pump:
                     {
                         var pumpViewModel = vm as HydroPumpViewModel;
@@ -294,55 +351,70 @@
                         {
                             HydroMatchingHelper.Apply(pumpViewModel, 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.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);
                             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.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);
                             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.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);
                             this.hydroVisualPropertyCtrl1.UpdateRows();
+                            this.PropertyValueChangedEvent?.Invoke(vm.Vmo);
+                            this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo);
+                            this.GradingPropertyValueChangedEvent?.Invoke(vm.Vmo);
                         };
                         dlg.SetBindingData(input);
                         dlg.ShowDialog();
                     }
                     break;
-                default: break;
 
+                default: break;
             }
         }
 
@@ -357,43 +429,73 @@
             {
                 case HydroCurve.Tank:
                     {
-                        var tankViewModel = vm as HydroTankViewModel;
-                        var dlg = new TankChartShowDlg();
-                        dlg.ShowDialog();
+                        if (long.TryParse(vm.DbId, out long longDbId))
+                        {
+                            var tankViewModel = vm as HydroTankViewModel;
+                            var dlg = new AssetsTankCurveVOLViewDlg();
+                            dlg.SetBindingData(longDbId);
+                            dlg.ShowDialog();
+                        }
                     }
                     break;
+
                 case HydroCurve.Pump:
                     {
                         var pumpViewModel = vm as HydroPumpViewModel;
-                        //var dlg = new PumpChartShowDlg();
+                        var dlg = new SimulationSinglePumpFeatDlg();
+                        dlg.SaveEvent += (working) =>
+                        {
+                            pumpViewModel.Vmo.LinkStatus = working.LinkStatus;
+                            pumpViewModel.Vmo.SpeedRatio = working.CurrentHz / pumpViewModel.Vmo.RatedHz;
+                            pumpViewModel.UpdateProperty();
+                            this.hydroVisualPropertyCtrl1.UpdateRows();
+                        };
+                        dlg.SetBindingData(pumpViewModel);
+                        dlg.ShowDialog();
                     }
                     break;
+
                 case HydroCurve.Valve:
                     {
-                        var valveViewModel = vm as HydroValveViewModel;
-                        var dlg = new ValveChartShowDlg();
-                        dlg.ShowDialog();
+                        if (long.TryParse(vm.DbId, out long longDbId))
+                        {
+                            var valveViewModel = vm as HydroValveViewModel;
+                            var dlg = new AssetsValveCurveViewDlg();
+                            dlg.SetBindingData(longDbId);
+                            dlg.ShowDialog();
+                        }
                     }
                     break;
+
                 case HydroCurve.Exchanger:
                     {
-                        var exchangerViewModel = vm as HydroExchangerViewModel;
-                        var dlg = new ExchangerChartShowDlg();
-                        dlg.ShowDialog();
+                        if (long.TryParse(vm.DbId, out long longDbId))
+                        {
+                            var exchangerViewModel = vm as HydroExchangerViewModel;
+                            var dlg = new AssetsExchangerCurveQLViewDlg();
+                            dlg.SetBindingData(longDbId);
+                            dlg.ShowDialog();
+                        }
                     }
                     break;
+
                 case HydroCurve.Compressor:
                     {
-                        var compressorViewModel = vm as HydroCompressorViewModel;
-                        var dlg = new CompressorChartShowDlg();
-                        dlg.ShowDialog();
+                        if (long.TryParse(vm.DbId, out long longDbId))
+                        {
+                            var compressorViewModel = vm as HydroCompressorViewModel;
+                            var dlg = new AssetsCompressorCurveQLViewDlg();
+                            dlg.SetBindingData(longDbId);
+                            dlg.ShowDialog();
+                        }
                     }
                     break;
+
                 default: break;
             }
         }
 
-        #endregion
+        #endregion 浜嬩欢瀹炵幇
 
         #region 浜嬩欢绌块��
 
@@ -441,6 +543,6 @@
             this.FlowEffectPropertyValueChangedEvent?.Invoke(vm?.Vmo);
         }
 
-        #endregion
+        #endregion 浜嬩欢绌块��
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3