From 48527dff9c5adda9881cad10fa9dbeecf6f07bed Mon Sep 17 00:00:00 2001 From: ningshuxia <ningshuxia0927@outlook.com> Date: 星期三, 19 三月 2025 11:58:52 +0800 Subject: [PATCH] 模型模板修改 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs | 258 +++++++++++++++++++------------------------------- 1 files changed, 99 insertions(+), 159 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs index 9781b8a..94c7f81 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs @@ -124,8 +124,7 @@ private void InitialSvgImages() { //鐩戞祴 - this.barBtnDockingMonitor.ImageOptions.SvgImage = HydroMonitorSvgImageHelper.Docking; - this.barBtnAnalyseMonitor.ImageOptions.SvgImage = HydroMonitorSvgImageHelper.Analyse; + this.barBtnSetMonitorList.ImageOptions.SvgImage = HydroMonitorSvgImageHelper.Docking; //姘村簱 this.barBtnSetReservoirList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Tank; @@ -144,6 +143,12 @@ this.barBtnSetWaterboxList.ImageOptions.SvgImageSize = new Size(32, 32); this.barBtnSetWaterboxList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); this.barBtnSetWaterboxList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; + + //杩炴帴鑺傜偣 + this.barBtnSetJunctionList.ImageOptions.SvgImage = HydroMainSvgImageHelper.Junction; + this.barBtnSetJunctionList.ImageOptions.SvgImageSize = new Size(32, 32); + this.barBtnSetJunctionList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); + this.barBtnSetJunctionList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; //闂峰ご this.barBtnSetBluntheadList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Blunthead; @@ -553,16 +558,14 @@ case eSimulationVisualSource.None: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; case eSimulationVisualSource.Bimface: { - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -570,8 +573,7 @@ case eSimulationVisualSource.Q3d: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -579,16 +581,14 @@ case eSimulationVisualSource.Property: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; } break; case eSimulationVisualSource.List: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -596,8 +596,7 @@ case eSimulationVisualSource.Set: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -605,8 +604,7 @@ case eSimulationVisualSource.Search: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -614,8 +612,7 @@ case eSimulationVisualSource.Monitor: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -623,8 +620,7 @@ case eSimulationVisualSource.Check: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -632,8 +628,7 @@ case eSimulationVisualSource.Calcu: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -641,8 +636,7 @@ case eSimulationVisualSource.Warning: { _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); - this.barBtnDockingMonitor.Enabled = visual != null; - this.barBtnAnalyseMonitor.Enabled = visual != null; + this.barBtnSetMonitorList.Enabled = visual != null; SetPropertyCtrl(visual); } break; @@ -990,8 +984,18 @@ WaitFormHelper.ShowWaitForm("姝e湪淇濆瓨锛岃绋嶅悗..."); - var bol = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance + bool bol = false; + + try + { + bol = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance .Update(_hydroInfo, addParterList, updateParterList, removeParters); + } + catch (Exception ex) + { + XtraMessageBox.Show(ex.Message); + _isSaving = false; + } if (!bol) { @@ -1839,7 +1843,7 @@ gradingHelper.Set(); } - #endregion 棰滆壊鍒嗙骇 + #endregion #region 浜哄伐鍒锋柊 @@ -1891,21 +1895,7 @@ return await helper.GetAll(); } - //鑾峰彇鐩戞祴瀵规帴鍒楄〃 - private async Task<List<HydroMonitorVmo>> GetMonitorDockingList() - { - var helper = GetMonitorHelper(); - return await helper.GetDockingList(); - } - - //鑾峰彇鐩戞祴鍒嗘瀽鍒楄〃 - private async Task<List<HydroMonitorVmo>> GetMonitorAnalyseList() - { - var helper = GetMonitorHelper(); - return await helper.GetAnalyseList(); - } - - #endregion 鐩戞祴鐐� + #endregion #region 鐩戞祴鍊� @@ -1919,8 +1909,7 @@ { var visualListHelper = GetVisualListHelper(); var monitorHelper = GetMonitorHelper(); - var calcuResultHelper = GetCalcuResultHelper(); - _monitorValueHelper = new SimulationMonitorValueHelper(visualListHelper, monitorHelper, calcuResultHelper); + _monitorValueHelper = new SimulationMonitorValueHelper(visualListHelper, monitorHelper); } return _monitorValueHelper; } @@ -1932,21 +1921,7 @@ return await helper.GetAll(); } - //鑾峰彇鐩戞祴瀵规帴鍊煎垪琛� - private async Task<List<HydroMonitorValueViewModel>> GetMonitorDockingValueList() - { - var helper = GetMonitorValueHelper(); - return await helper.GetDockingList(); - } - - //鑾峰彇鐩戞祴鍒嗘瀽鍊煎垪琛� - private async Task<List<HydroMonitorValueViewModel>> GetMonitorAnalyseValueList() - { - var helper = GetMonitorValueHelper(); - return await helper.GetAnalyseList(); - } - - //閲嶇疆 + //閲嶇疆鐩戞祴鍊� private void ResetMonitorValue() { var allWorkingList = GetWorkingList(); @@ -1958,12 +1933,12 @@ } } - #endregion 鐩戞祴鍊� + #endregion - #region 浼犳劅鍣ㄦ祴鐐� + #region 璁剧疆娴嬬偣 - //璁剧疆鍙鏋勪欢瀵规帴娴嬬偣鍒楄〃 - private async void SetMonitorDockingList(HydroVisualInfo visual) + //璁剧疆娴嬬偣鍒楄〃 + private async void SetMonitorList(HydroVisualInfo visual) { if (_hydroInfo == null) { @@ -1977,33 +1952,33 @@ var allMonitorList = await monitorHelper.GetAll(); var monitorValueHelper = GetMonitorValueHelper(); var allMonitorValueList = await monitorValueHelper.GetAll(); - var calcuResult = GetCalcuResult(); - var dlg = new SetHydroMonitorDockingListDlg(); + var dlg = new SetHydroMonitorListDlg(); dlg.ReloadDataEvent += async (list) => { var monitorList = list?.Select(x => x.Vmo).ToList(); - await monitorHelper.Update(visual.Code, eSourceType.Docking, monitorList); - await monitorValueHelper.Update(visual.Code, eSourceType.Docking, list); + await monitorHelper.Update(visual.Code, monitorList); + await monitorValueHelper.Update(visual.Code, list); var monitorMarkerHelper = await GetMonitorMarkerHelper(); monitorMarkerHelper.Set(); }; - dlg.SetBindingData(_hydroInfo, visual, allMonitorList, allMonitorValueList, calcuResult); + dlg.SetBindingData(_hydroInfo, visual, allMonitorList, allMonitorValueList); dlg.ShowDialog(); } - //璁剧疆浼犳劅鍣ㄦ祴鐐� - private void barBtnDockingMonitor_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + //璁剧疆娴嬬偣鍒楄〃 + private void barBtnSetMonitorList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (_visual == null) { + TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒"); return; } - SetMonitorDockingList(_visual); + SetMonitorList(_visual); } - #endregion 浼犳劅鍣ㄦ祴鐐� + #endregion - #region 浼犳劅鍣ㄦ祴鍊� + #region 璁剧疆娴嬪�� //鐩戞祴鍊煎垪琛ㄦ帶浠� private HydroMonitorValueListCtrl _monitorValueListCtrl = null; @@ -2043,8 +2018,8 @@ } } - //鏄剧ず鐩戞祴瀵规帴鍊煎垪琛ㄦ帶浠� - private async void ShowMonitorDockingValueListCtrl() + //鏄剧ず鐩戞祴鍊煎垪琛ㄦ帶浠� + private async void ShowMonitorValueListCtrl() { var monitorValueListCtrl = GetMonitorValueListCtrl(); if (!IsMonitorValueListCtrlVisible) @@ -2052,60 +2027,20 @@ this.controlContainerBottom.Controls.Clear(); this.controlContainerBottom.Controls.Add(monitorValueListCtrl); this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; - this.docPnlBottom.Text = "浼犳劅鍣ㄦ祴鍊�"; + this.docPnlBottom.Text = "璁剧疆娴嬪��"; this.docPnlBottom.Height = 350; } - var allValueList = await GetMonitorDockingValueList(); - var calcuResult = GetCalcuResult(); + var allValueList = await GetMonitorValueList(); monitorValueListCtrl.SetBindingData(allValueList); } - //璁剧疆浼犳劅鍣ㄦ祴鍊� - private void barBtnDockingMonitorValue_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + //璁剧疆娴嬪�� + private void barBtnSetMonitorValueList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { - ShowMonitorDockingValueListCtrl(); + ShowMonitorValueListCtrl(); } - #endregion 浼犳劅鍣ㄦ祴鍊� - - #region 鍒嗘瀽娴嬬偣 - - //璁剧疆鍙鏋勪欢鍒嗘瀽娴嬬偣鍒楄〃 - private async void SetMonitorAnalyseList(HydroVisualInfo visual) - { - if (_hydroInfo == null) - { - return; - } - if (visual == null) - { - return; - } - var monitorHelper = GetMonitorHelper(); - var allMonitorList = await monitorHelper.GetAnalyseList(); - var dlg = new SetHydroMonitorAnalyseListDlg(); - dlg.ReloadDataEvent += async (list) => - { - await monitorHelper.Update(visual.Code, eSourceType.Analyse, list); - //var monitorMarkerHelper = await GetMonitorMarkerHelper(); - //monitorMarkerHelper.Update(visual.Code, monitorList); - //monitorMarkerHelper.Set(); - }; - dlg.SetBindingData(_hydroInfo, visual, allMonitorList); - dlg.ShowDialog(); - } - - //璁剧疆鍒嗘瀽娴嬬偣 - private void barBtnAnalyseMonitor_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) - { - if (_visual == null) - { - return; - } - SetMonitorAnalyseList(_visual); - } - - #endregion 鍒嗘瀽娴嬬偣 + #endregion #region 娴嬬偣鏍囪 @@ -2132,7 +2067,7 @@ monitorMarkerHelper.Set(); } - #endregion 娴嬬偣鏍囪 + #endregion #region 妯″瀷妫�鏌� @@ -2236,7 +2171,7 @@ return _calcuResultHelper; } - #endregion 璁$畻缁撴灉 + #endregion #region 璁$畻澶辫触 @@ -2401,7 +2336,7 @@ #endregion 璁$畻鏍囩 - #endregion 妯″瀷璁$畻 + #endregion #region 瀵煎嚭INP @@ -2572,7 +2507,7 @@ ShowEvaluationDlg(); } - #endregion 璇勪环瑙勫垯 + #endregion #region 姘村姏璁$畻 @@ -2623,9 +2558,12 @@ return; } + var isHead = _calcuPressModeIsHead; + var allEvaluationList = await GetEvaluationList(); + WaitFormHelper.ShowWaitForm(this, "姝e湪璁$畻鍒嗘瀽涓紝璇风◢鍊�..."); await Task.Delay(3000); - var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, _calcuPressModeIsHead); + var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, isHead, allEvaluationList); WaitFormHelper.HideWaitForm(); workingHelper.InitialData(hydroInfo, working, checkResult, calcuResult); if (calcuResult.Succeed) @@ -3026,6 +2964,8 @@ var monitorValueHelper = GetMonitorValueHelper(); var allMonitorValueList = await monitorValueHelper.GetAll(); allMonitorValueList.UpdateMonitorValue(rhs.MonitorInfo); + var gradingHelper = await GetGradingHelper(); + gradingHelper.Set(); }; dlg.DeleteDataEvent += (rhs) => { @@ -3105,7 +3045,7 @@ this.docPnlBottom.Height = 350; } - var allMonitorList = await GetMonitorAnalyseList(); + var allMonitorList = await GetMonitorList(); var isHead = _calcuPressModeIsHead; var allEvaluationList = await GetEvaluationList(); @@ -3126,7 +3066,7 @@ ShowMonitorAnalyListCtrl(); } - #endregion 鐩戞祴鍒嗘瀽 + #endregion #region 宸ュ喌鍒嗘瀽 @@ -3179,10 +3119,11 @@ { return; } - var allMonitorList = await GetMonitorDockingList(); + + var allMonitorList = await GetMonitorList(); if (allMonitorList == null || allMonitorList.Count < 1) { - TipFormHelper.ShowWarn("璇烽厤缃紶鎰熷櫒娴嬬偣鍚庨噸璇曪紒"); + TipFormHelper.ShowWarn("璇疯缃洃娴嬬偣鍚庨噸璇曪紒"); return; } @@ -3192,6 +3133,14 @@ var workingList = GetCheckedWorkingList(); if (workingList == null || workingList.Count < 1) { + var allMonitorValueList = await GetMonitorValueList(); + allMonitorValueList = allMonitorValueList?.Where(x => x.PropValue.HasValue).ToList(); + if (allMonitorValueList == null || allMonitorValueList.Count < 1) + { + TipFormHelper.ShowWarn("璇疯缃洃娴嬪�煎悗锛岄噸鏂拌绠楋紒"); + return; + } + var workingHelper = GetWorkingHelper(); if (!workingHelper.Initialized) { @@ -3303,31 +3252,23 @@ //缁煎悎鍒嗘瀽 private async void barBtnWorkingAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { - if (_visual == null) + if (_hydroInfo == null) { - if (_visual == null) - { - SelectInputSource(); - if (_visual == null) - { - TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒"); - return; - } - } - } - HydroVisualInfo visual = _visual; - if (_visual is HydroLinkInfo linkInfo) - { - var visualListHelper = GetVisualListHelper(); - visual = visualListHelper.GetVisual(linkInfo.StartCode); + return; } - var monitorHelper = GetMonitorHelper(); - var allMonitorList = await monitorHelper.GetAll(); + var selectNode = GetSelectNode(); + if (selectNode == null) + { + return; + } - var workingCheckedListHelper = GetWorkingCheckedListHelper(); - var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); - if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) + var allMonitorList = await GetMonitorList(); + var isHead = _calcuPressModeIsHead; + var allEvaluationList = await GetEvaluationList(); + + var workingList = GetCheckedWorkingList(); + if (workingList == null || workingList.Count < 1) { var workingHelper = GetWorkingHelper(); if (!workingHelper.Initialized) @@ -3335,19 +3276,18 @@ TipFormHelper.ShowWarn("璇疯绠楀悗閲嶈瘯锛�"); return; } - var dlg = new SimulationSingleWorkingAnalyDlg(); - dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult, visual); + var dlg = new SimulationMultiAnalyDlg(); + dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, selectNode, workingHelper.CalcuResult, isHead, allEvaluationList); dlg.ShowDialog(); + return; } - else - { - var dlg = new SimulationMultiWorkingAnalyDlg(); - dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList, visual); - dlg.ShowDialog(); - } + + var workingDlg = new SimulationMultiAnalyWorkingDlg(); + workingDlg.SetBindingData(_hydroInfo, allMonitorList, workingList, selectNode, isHead, allEvaluationList); + workingDlg.ShowDialog(); } - #endregion 宸ュ喌鍒嗘瀽 + #endregion #region 鎹熷け鏇茬嚎 -- Gitblit v1.9.3