From cb3ec7cb8001317857087da706e51e6caa58f591 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期一, 21 十月 2024 12:01:20 +0800 Subject: [PATCH] 错误检查 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs | 60 +++++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 43 insertions(+), 17 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs index ad7b9ac..b7e3e54 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs @@ -18,7 +18,15 @@ this.hydroParterPropertyCtrl1.PropertyValueChangedEvent += HydroParterPropertyCtrl1_PropertyValueChangedEvent; this.hydroParterPropertyCtrl1.PropertyValueChangingEvent += HydroParterPropertyCtrl1_PropertyValueChangingEvent; this.hydroParterPropertyCtrl1.MatchingDbEvent += HydroParterPropertyCtrl1_MatchingDbEvent; + this.hydroParterPropertyCtrl1.BlinkLinkParterEvent += HydroParterPropertyCtrl1_BlinkLinkParterEvent; } + + /// <summary> + /// 寮鸿皟杩炴帴缁勪欢浜嬩欢 + /// 绗竴涓弬鏁颁负缁勪欢Code + /// 绗簩涓弬鏁颁负杩炴帴缁勪欢Code + /// </summary> + public event Action<string, string> BlinkLinkParterEvent; //姘村姏淇℃伅鏂规硶 private Func<Yw.Model.HydroModelInfo> _hydroInfoFunc = null; @@ -109,7 +117,7 @@ } var pumpId = string.IsNullOrEmpty(pumpInfo.DbId) ? 0 : Convert.ToInt64(pumpInfo.DbId); var curveId = string.IsNullOrEmpty(curveqh.DbId) ? 0 : Convert.ToInt64(curveqh.DbId); - var speedRatio = pumpInfo.SpeedRatio ?? 1; + var speedRatio = pumpInfo.SpeedRatio; var dlg = new PumpPerform2dViewDlg(); dlg.SetBindingData(pumpId, curveId, speedRatio); dlg.ShowDialog(); @@ -214,7 +222,7 @@ return false; } - //鍖归厤Db浜嬩欢 + //鍖归厤Db private void HydroParterPropertyCtrl1_MatchingDbEvent(Yw.Model.HydroParterInfo parter) { if (parter == null) @@ -233,28 +241,30 @@ var pumpInfo = hydroInfo.Pumps?.Find(x => x.Code == parter.Code); var input = AssetsMatchingParasHelper.Create(hydroInfo, pumpInfo); - if (input.DbId != string.Empty) + if (!string.IsNullOrEmpty(pumpInfo.DbId)) { var detailDlg = new PumpFullInfoViewDlg(); detailDlg.SetBindindData(input); detailDlg.ShowDialog(); - return; } - var dlg = new PumpSingleMatchingDlg(); - dlg.SetBindingData(input); - dlg.ReloadDataEvent += (rhs) => + else { - var bol = AssetsMatchingParasHelper.Apply(hydroInfo, rhs); - if (bol) + var dlg = new PumpSingleMatchingDlg(); + dlg.SetBindingData(input); + dlg.ReloadDataEvent += (rhs) => { - TipFormHelper.ShowSucceed("鍖归厤鎴愬姛"); - } - else - { - TipFormHelper.ShowWarn("鍖归厤澶辫触"); - } - }; - dlg.ShowDialog(); + var bol = AssetsMatchingParasHelper.Apply(hydroInfo, rhs); + if (bol) + { + TipFormHelper.ShowSucceed("鍖归厤鎴愬姛"); + } + else + { + TipFormHelper.ShowWarn("鍖归厤澶辫触"); + } + }; + dlg.ShowDialog(); + } } break; @@ -318,5 +328,21 @@ break; } } + + //寮鸿皟杩炴帴缁勪欢 + private void HydroParterPropertyCtrl1_BlinkLinkParterEvent(string code, string linkCode) + { + if (string.IsNullOrEmpty(code)) + { + return; + } + if (string.IsNullOrEmpty(linkCode)) + { + return; + } + this.BlinkLinkParterEvent?.Invoke(code, linkCode); + } + + } } \ No newline at end of file -- Gitblit v1.9.3