From 25dd33f23a5e3f8386e25d9298743288a1b4c9f6 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期四, 20 二月 2025 00:23:40 +0800 Subject: [PATCH] 水泵分析整理 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs | 373 +++++++++++++++++++++++++++------------------------- 1 files changed, 194 insertions(+), 179 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 c1ddfc3..414812c 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 @@ -20,20 +20,19 @@ RegistBulkSetEvents(); } - - #region 妯″瀷浜嬩欢 /// <summary> /// 鑾峰彇妯″瀷浜嬩欢 /// </summary> public event Func<XhsSchemeVmo, Task<Yw.Model.HydroModelInfo>> GetModelEvent; + /// <summary> /// 鍒锋柊妯″瀷浜嬩欢 /// </summary> public event Func<Task<Yw.Model.HydroModelInfo>> RefreshModelEvent; - #endregion + #endregion 妯″瀷浜嬩欢 #region 鏂规浜嬩欢 @@ -41,12 +40,13 @@ /// 鏇存柊鏂规浜嬩欢 /// </summary> public event Action<XhsSchemeVmo> UpdateSchemeEvent; + /// <summary> /// 绉婚櫎鏂规浜嬩欢 /// </summary> public event Action<XhsSchemeVmo> RemoveSchemeEvent; - #endregion + #endregion 鏂规浜嬩欢 #region 宸ュ喌浜嬩欢 @@ -54,20 +54,23 @@ /// 鏂板宸ュ喌浜嬩欢 /// </summary> public event Action<HydroWorkingVmo> AppendWorkingEvent; + /// <summary> /// 鏇存柊宸ュ喌浜嬩欢 /// </summary> public event Action<HydroWorkingVmo> UpdateWorkingEvent; + /// <summary> /// 绉婚櫎宸ュ喌浜嬩欢 /// </summary> public event Action<HydroWorkingVmo> RemoveWorkingEvent; + /// <summary> /// 閲嶈浇宸ュ喌浜嬩欢 /// </summary> public event Action<Dictionary<HydroWorkingVmo, bool>> ReloadWorkingEvent; - #endregion + #endregion 宸ュ喌浜嬩欢 private HStation.Vmo.XhsProjectVmo _project = null;//椤圭洰 private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//椤圭洰绔� @@ -262,7 +265,7 @@ return helper.GetPropStatusDbList(); } - #endregion + #endregion 灞炴�х姸鎬� #region 鏇存敼鐘舵�� @@ -311,7 +314,7 @@ return helper.GetRemoveParters(); } - #endregion + #endregion 鏇存敼鐘舵�� #region BIM鎺т欢 @@ -355,7 +358,7 @@ this.tabPageBimface.Controls.Add(bimfaceCtrl); } - #endregion + #endregion BIM鎺т欢 #region Q3d鎺т欢 @@ -392,7 +395,7 @@ this.tabPageQ3d.Controls.Add(q3dCtrl); } - #endregion + #endregion Q3d鎺т欢 #region 灞炴�ф帶浠� @@ -534,7 +537,7 @@ _propertyCtrl?.UpdateRows(); } - #endregion + #endregion 灞炴�ф帶浠� #region 閫夋嫨鏋勪欢 @@ -704,7 +707,7 @@ return helper.GetSourceList(); } - #endregion + #endregion 鍙鍒楄〃 #region 瑙嗗浘鍒楄〃 @@ -741,7 +744,7 @@ return helper.GetVisual(code); } - #endregion + #endregion 瑙嗗浘鍒楄〃 #region 鏄庣粏鎺т欢 @@ -843,7 +846,7 @@ ShowVisualListCtrl(); } - #endregion + #endregion 鏄庣粏鎺т欢 #region 鏋勪欢鏄剧ず @@ -894,7 +897,7 @@ #endregion 鏋勪欢鏄剧ず - #endregion + #endregion 鏋勪欢鏄庣粏 #region 涓�閿樉闅� @@ -944,6 +947,7 @@ //淇濆瓨閿佸畾瀵硅薄 private object _locker_save = new(); + private bool _isSaving = false;//姝e湪淇濆瓨 //淇濆瓨 @@ -986,10 +990,8 @@ WaitFormHelper.ShowWaitForm("姝e湪淇濆瓨锛岃绋嶅悗..."); - var bol = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance .Update(_hydroInfo, addParterList, updateParterList, removeParters); - if (!bol) { @@ -1612,7 +1614,7 @@ } } - #endregion + #endregion 鎵归噺閰嶇疆 #region 鏋勪欢鏌ヨ @@ -1755,7 +1757,7 @@ markHelper.Set(); } - #endregion + #endregion 妯″瀷鏍囨敞 #region 棰滆壊鍒嗙骇 @@ -1837,7 +1839,7 @@ gradingHelper.Set(); } - #endregion + #endregion 棰滆壊鍒嗙骇 #region 浜哄伐鍒锋柊 @@ -1864,7 +1866,7 @@ } } - #endregion + #endregion 浜哄伐鍒锋柊 #region 鐩戞祴鐐� @@ -1903,7 +1905,7 @@ return await helper.GetAnalyseList(); } - #endregion + #endregion 鐩戞祴鐐� #region 鐩戞祴鍊� @@ -2517,8 +2519,7 @@ UpdatePropertyCtrl(); } - - #endregion + #endregion 鍘嬪姏鍒囨崲 #region 璇勪环瑙勫垯 @@ -2571,7 +2572,7 @@ ShowEvaluationDlg(); } - #endregion + #endregion 璇勪环瑙勫垯 #region 姘村姏璁$畻 @@ -2685,7 +2686,7 @@ Calcu(); } - #endregion + #endregion 姘村姏璁$畻 #region 瀵煎嚭鎶ュ憡 @@ -2715,7 +2716,7 @@ allWorkingList = new List<HydroWorkingVmo>() { working }; } - #endregion + #endregion 宸ュ喌鍒楄〃 #region 閫夋嫨鑺傜偣 @@ -2725,7 +2726,7 @@ return default; } - #endregion + #endregion 閫夋嫨鑺傜偣 var vm = new SimulationPrintViewModel(); @@ -2737,7 +2738,7 @@ return vm; } - #endregion + #endregion 椤圭洰 #region 姘存车鍒楄〃 @@ -2747,14 +2748,14 @@ return pump; }).ToList(); - #endregion + #endregion 姘存车鍒楄〃 #region 闄勫姞淇℃伅 var allMonitorList = await GetMonitorList(); var allEvaluationList = await GetEvaluationList(); - #endregion + #endregion 闄勫姞淇℃伅 #region 鍩虹妯″瀷 @@ -2765,7 +2766,7 @@ } var baseHydroInfoRhs = baseHydroInfo.Adapt<Yw.Model.HydroModelInfo>(); - #endregion + #endregion 鍩虹妯″瀷 #region 閬嶅巻宸ュ喌 @@ -2779,20 +2780,20 @@ vm.WorkingList.Add(printWorking); //绮惧害璇勪及 - printWorking.Accuracy = SimulationPrintAccuracyHelper.Create(baseHydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.Accuracy = HydroAccuracyHelper.Create(baseHydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //姘存车鍒嗘瀽 - printWorking.PumpAnaly = SimulationPrintPumpAnalyHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.PumpAnaly = HydroPumpAnalyHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //鐩戞祴鍒嗘瀽 - printWorking.MonitorAnaly = SimulationPrintMonitorAnalyHelper.Create(baseHydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.MonitorAnaly = HydroMonitorAnalyHelper.Create(baseHydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //鑳借�楀垎鏋� - printWorking.EnergyAnaly = SimulationPrintEnergyAnalyHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.EnergyAnaly = HydroEnergyAnalyHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //鎹熷け缁熻 printWorking.LossStatistics = HydroLossStatisticsHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //鎹熷け鏇茬嚎 - printWorking.LossCurve = SimulationPrintLossCurveHelper.Create(baseHydroInfoRhs, working, selectedNode, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.LossCurve = HydroLossCurveHelper.Create(baseHydroInfoRhs, working, selectedNode, calcuResult, _calcuPressModeIsHead, allEvaluationList); } - #endregion + #endregion 閬嶅巻宸ュ喌 #region 鏂规澶勭悊 @@ -2810,22 +2811,21 @@ vm.Scheme.WorkingList.Add(printWorking); //绮惧害璇勪及 - printWorking.Accuracy = SimulationPrintAccuracyHelper.Create(hydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.Accuracy = HydroAccuracyHelper.Create(hydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //姘存车鍒嗘瀽 - printWorking.PumpAnaly = SimulationPrintPumpAnalyHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.PumpAnaly = HydroPumpAnalyHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //鐩戞祴鍒嗘瀽 - printWorking.MonitorAnaly = SimulationPrintMonitorAnalyHelper.Create(hydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.MonitorAnaly = HydroMonitorAnalyHelper.Create(hydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //鑳借�楀垎鏋� - printWorking.EnergyAnaly = SimulationPrintEnergyAnalyHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.EnergyAnaly = HydroEnergyAnalyHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //鎹熷け缁熻 printWorking.LossStatistics = HydroLossStatisticsHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); //鎹熷け鏇茬嚎 - printWorking.LossCurve = SimulationPrintLossCurveHelper.Create(hydroInfoRhs, working, selectedNode, calcuResult, _calcuPressModeIsHead, allEvaluationList); + printWorking.LossCurve = HydroLossCurveHelper.Create(hydroInfoRhs, working, selectedNode, calcuResult, _calcuPressModeIsHead, allEvaluationList); } } - #endregion - + #endregion 鏂规澶勭悊 return vm; } @@ -2834,46 +2834,46 @@ private async void barBtnExportWord_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var printInfo = await CreatePrintInfo(); - var printDlg = new SimulationCommonReportDlg(); + var printDlg = new HStation.WinFrmUI.XtraForm1(); printDlg.SetBindingData(printInfo); printDlg.ShowDialog(); - if (_visual == null) - { - SelectInputSource(); - if (_visual == null) + /* if (_visual == null) { - TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒"); - return; + SelectInputSource(); + if (_visual == null) + { + TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒"); + return; + } } - } - HydroVisualInfo visual = _visual; - if (_visual is HydroLinkInfo linkInfo) - { - var visualListHelper = GetVisualListHelper(); - visual = visualListHelper.GetVisual(linkInfo.StartCode); - } - - var allMonitorList = await GetMonitorList(); - var working = GetWorking(); - var calcuResult = GetCalcuResult(); - - var dlg = new SimulationWorkingReportDlg(); - dlg.ReloadDataEvent += (vm) => - { - var fileName = FileDialogHelper.SaveWordDoc("瀵煎嚭Word鎶ュ憡"); - if (string.IsNullOrEmpty(fileName)) + HydroVisualInfo visual = _visual; + if (_visual is HydroLinkInfo linkInfo) { - return; + var visualListHelper = GetVisualListHelper(); + visual = visualListHelper.GetVisual(linkInfo.StartCode); } - var reportHelper = new HStation.ReportFile.SimulationWorkingReportHelper(); - reportHelper.Create(fileName, vm); - TipFormHelper.ShowInfo("瀵煎嚭鎴愬姛锛�"); - }; - dlg.SetBindingData(_project, _hydroInfo, allMonitorList, working, calcuResult, visual); - dlg.ShowDialog(); + + var allMonitorList = await GetMonitorList(); + var working = GetWorking(); + var calcuResult = GetCalcuResult(); + + var dlg = new SimulationWorkingReportDlg(); + dlg.ReloadDataEvent += (vm) => + { + var fileName = FileDialogHelper.SaveWordDoc("瀵煎嚭Word鎶ュ憡"); + if (string.IsNullOrEmpty(fileName)) + { + return; + } + var reportHelper = new HStation.ReportFile.SimulationWorkingReportHelper(); + reportHelper.Create(fileName, vm); + TipFormHelper.ShowInfo("瀵煎嚭鎴愬姛锛�"); + }; + dlg.SetBindingData(_project, _hydroInfo, allMonitorList, working, calcuResult, visual); + dlg.ShowDialog();*/ } - #endregion + #endregion 瀵煎嚭鎶ュ憡 #region 褰撳墠宸ュ喌 @@ -2938,7 +2938,7 @@ AddWorking(); } - #endregion + #endregion 褰撳墠宸ュ喌 #region 閫夋嫨宸ュ喌 @@ -3035,19 +3035,19 @@ dlg.ShowDialog(); } - #endregion + #endregion 閫夋嫨宸ュ喌 #region 鐩戞祴鍒嗘瀽 //鐩戞祴鍒嗘瀽鍒楄〃鎺т欢 - private HydroWorkingMonitorAnalyListCtrl _monitorAnalyListCtrl = null; + private HydroMonitorAnalyListCtrl _monitorAnalyListCtrl = null; //鑾峰彇鐩戞祴鍒嗘瀽鍒楄〃鎺т欢 - private HydroWorkingMonitorAnalyListCtrl GetMonitorAnalyListCtrl() + private HydroMonitorAnalyListCtrl GetMonitorAnalyListCtrl() { if (_monitorAnalyListCtrl == null) { - _monitorAnalyListCtrl = new HydroWorkingMonitorAnalyListCtrl(); + _monitorAnalyListCtrl = new HydroMonitorAnalyListCtrl(); _monitorAnalyListCtrl.Dock = DockStyle.Fill; _monitorAnalyListCtrl.HydroViewEvent += (code) => { @@ -3067,7 +3067,7 @@ { if (this.controlContainerBottom.Controls.Count > 0) { - if (this.controlContainerBottom.Controls[0] is HydroWorkingMonitorAnalyListCtrl) + if (this.controlContainerBottom.Controls[0] is HydroMonitorAnalyListCtrl) { return true; } @@ -3077,7 +3077,7 @@ } } - //鏄剧ず鐩戞祴鍊煎垪琛ㄦ帶浠� + //鏄剧ず鐩戞祴鍒嗘瀽鍒楄〃鎺т欢 private async void ShowMonitorAnalyListCtrl() { if (_hydroInfo == null) @@ -3094,6 +3094,7 @@ return; } } + var monitorAnalyListCtrl = GetMonitorAnalyListCtrl(); if (!IsMonitorAnalyListCtrlVisible) { @@ -3103,14 +3104,19 @@ this.docPnlBottom.Text = "鐩戞祴鍒嗘瀽"; this.docPnlBottom.Height = 350; } - var allMontorList = await GetMonitorAnalyseList(); + + var allMonitorList = await GetMonitorAnalyseList(); + var isHead = _calcuPressModeIsHead; + var allEvaluationList = await GetEvaluationList(); + if (allWorkingList == null || allWorkingList.Count < 1) { - monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, GetCalcuResult()); + var workingHelper = GetWorkingHelper(); + monitorAnalyListCtrl.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); } else { - monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allWorkingList); + monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMonitorList, allWorkingList, isHead, allEvaluationList); } } @@ -3120,7 +3126,7 @@ ShowMonitorAnalyListCtrl(); } - #endregion + #endregion 鐩戞祴鍒嗘瀽 #region 宸ュ喌鍒嗘瀽 @@ -3167,13 +3173,24 @@ } //绮惧害璇勪及 - private async void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + private async void barBtnAccuracy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { + if (_hydroInfo == null) + { + return; + } var allMonitorList = await GetMonitorDockingList(); + if (allMonitorList == null || allMonitorList.Count < 1) + { + TipFormHelper.ShowWarn("璇烽厤缃紶鎰熷櫒娴嬬偣鍚庨噸璇曪紒"); + return; + } - var workingCheckedListHelper = GetWorkingCheckedListHelper(); - var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); - if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) + var isHead = _calcuPressModeIsHead; + var allEvaluationList = await GetEvaluationList(); + + var workingList = GetCheckedWorkingList(); + if (workingList == null || workingList.Count < 1) { var workingHelper = GetWorkingHelper(); if (!workingHelper.Initialized) @@ -3181,24 +3198,29 @@ TipFormHelper.ShowWarn("璇疯绠楀悗閲嶈瘯锛�"); return; } - var dlg = new HydroSingleWorkingEvaluationDlg(); - dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult); + var dlg = new HydroAccuracyDlg(); + dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); dlg.ShowDialog(); + return; } - else - { - var dlg = new HydroMultiWorkingEvaluationDlg(); - dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList); - dlg.ShowDialog(); - } + + var workingDlg = new HydroAccuracyWorkingDlg(); + workingDlg.SetBindingData(_hydroInfo, allMonitorList, workingList, isHead, allEvaluationList); + workingDlg.ShowDialog(); } //姘存车鍒嗘瀽 - private void barBtnPumpAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + private async void barBtnPumpAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { - var workingCheckedListHelper = GetWorkingCheckedListHelper(); - var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); - if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) + if (_hydroInfo == null) + { + return; + } + var isHead = _calcuPressModeIsHead; + var allEvaluationList = await GetEvaluationList(); + + var workingList = GetCheckedWorkingList(); + if (workingList == null || workingList.Count < 1) { var workingHelper = GetWorkingHelper(); if (!workingHelper.Initialized) @@ -3206,25 +3228,30 @@ TipFormHelper.ShowWarn("璇疯绠楀悗閲嶈瘯锛�"); return; } - var dlg = new SimulationSingleWorkingPumpAnalyDlg(); - dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult); + var dlg = new SimulationPumpAnalyDlg(); + dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); dlg.ShowDialog(); + return; } - else - { - var dlg = new SimulationMultiWorkingPumpAnalyDlg(); - dlg.SetBindingData(_hydroInfo, allCheckedWorkingList); - dlg.ShowDialog(); - } + + var workingDlg = new SimulationPumpAnalyWorkingDlg(); + workingDlg.SetBindingData(_hydroInfo, workingList, isHead, allEvaluationList); + workingDlg.ShowDialog(); } //鑳芥晥鍒嗘瀽 - private async void barBtnWorkingPower_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + private async void barBtnEnergyAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { - var allMonitorList = await GetMonitorList(); - var workingCheckedListHelper = GetWorkingCheckedListHelper(); - var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); - if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) + if (_hydroInfo == null) + { + return; + } + + var isHead = _calcuPressModeIsHead; + var allEvaluationList = await GetEvaluationList(); + + var workingList = GetCheckedWorkingList(); + if (workingList == null || workingList.Count < 1) { var workingHelper = GetWorkingHelper(); if (!workingHelper.Initialized) @@ -3232,16 +3259,14 @@ TipFormHelper.ShowWarn("璇疯绠楀悗閲嶈瘯锛�"); return; } - var dlg = new SimulationSingleWorkingEnergyDlg(); - dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, allMonitorList, workingHelper.CalcuResult); + var dlg = new SimulationEnergyAnalyDlg(); + dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); dlg.ShowDialog(); + return; } - else - { - var dlg = new SimulationMultiWorkingEnergyDlg(); - dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList); - dlg.ShowDialog(); - } + var workingDlg = new SimulationEnergyAnalyWorkingDlg(); + workingDlg.SetBindingData(_hydroInfo, workingList, isHead, allEvaluationList); + workingDlg.ShowDialog(); } //鎹熷け缁熻 @@ -3322,39 +3347,39 @@ } } - #endregion + #endregion 宸ュ喌鍒嗘瀽 #region 鎹熷け鏇茬嚎 - //鍗曞伐鍐垫崯澶辨洸绾挎帶浠� - private HydroSingleWorkingLossCurveInteropCtrl _singleWorkingLossCurveCtrl = null; + //鎹熷け鏇茬嚎浜や簰鎺т欢 + private HydroLossCurveInteropCtrl _lossCurveInteropCtrl = null; - //鑾峰彇鍗曞伐鍐垫崯澶辨洸绾挎帶浠� - private HydroSingleWorkingLossCurveInteropCtrl GetSingleWorkingLossCurveCtrl() + //鑾峰彇鎹熷け鏇茬嚎浜や簰鎺т欢 + private HydroLossCurveInteropCtrl GetLossCurveInteropCtrl() { - if (_singleWorkingLossCurveCtrl == null) + if (_lossCurveInteropCtrl == null) { - _singleWorkingLossCurveCtrl = new HydroSingleWorkingLossCurveInteropCtrl(); - _singleWorkingLossCurveCtrl.Dock = DockStyle.Fill; - _singleWorkingLossCurveCtrl.HydroClickEvent += (code) => + _lossCurveInteropCtrl = new HydroLossCurveInteropCtrl(); + _lossCurveInteropCtrl.Dock = DockStyle.Fill; + _lossCurveInteropCtrl.HydroClickEvent += (code) => { var visual = GetVisual(code); SelectVisual(visual, eSimulationVisualSource.None); }; - _singleWorkingLossCurveCtrl.HydroSpecialDisplayEvent += (list) => + _lossCurveInteropCtrl.HydroSpecialDisplayEvent += (list) => { _bimfaceCtrl?.SetLogicOutlineGlowEffect(list); }; - _singleWorkingLossCurveCtrl.HydroCancelSpecialDisplayEvent += () => + _lossCurveInteropCtrl.HydroCancelSpecialDisplayEvent += () => { _bimfaceCtrl?.RemoveLogicOutlineGlowEffect(); }; } - return _singleWorkingLossCurveCtrl; + return _lossCurveInteropCtrl; } - //鍗曞伐鍐垫崯澶辨洸绾挎帶浠舵槸鍚﹀彲瑙� - private bool IsSingleWorkingLossCurveCtrlVisible + //鎹熷け鏇茬嚎鎺т欢鏄惁鍙 + private bool IsLossCurveInteropCtrlVisible { get { @@ -3362,7 +3387,7 @@ { if (this.controlContainerBottom.Controls.Count > 0) { - if (this.controlContainerBottom.Controls[0] is HydroSingleWorkingLossCurveInteropCtrl) + if (this.controlContainerBottom.Controls[0] is HydroLossCurveInteropCtrl) { return true; } @@ -3372,43 +3397,43 @@ } } - //鏄剧ず鍗曞伐鍐垫崯澶辨洸绾挎帶浠� - private void ShowSingleWorkingLossCurveCtrl(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult, HydroVisualInfo visual) + //鏄剧ず鎹熷け鏇茬嚎鎺т欢 + private void ShowLossCurveInteropCtrl + ( + Yw.Model.HydroModelInfo hydroInfo, + HydroWorkingVmo working, + HydroNodeInfo node, + HydroCalcuResult calcuResult = null, + bool isHead = false, + List<HydroEvaluationVmo> allEvaluationList = null + ) { - var singleWorkingLossCurveCtrl = GetSingleWorkingLossCurveCtrl(); - if (!IsSingleWorkingLossCurveCtrlVisible) + var ctrl = GetLossCurveInteropCtrl(); + if (!IsLossCurveInteropCtrlVisible) { this.controlContainerBottom.Controls.Clear(); - this.controlContainerBottom.Controls.Add(singleWorkingLossCurveCtrl); + this.controlContainerBottom.Controls.Add(ctrl); this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; this.docPnlBottom.Text = "鎹熷け鏇茬嚎"; this.docPnlBottom.Height = 350; } - singleWorkingLossCurveCtrl.SetBindingData(hydroInfo, calcuResult, visual); + ctrl.SetBindingData(hydroInfo, working, node, calcuResult, isHead, allEvaluationList); } //鎹熷け鏇茬嚎 - private void barBtnWorkingLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + private async void barBtnLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { - if (_visual == null) + var node = GetSelectNode(); + if (node == 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 workingCheckedListHelper = GetWorkingCheckedListHelper(); - var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); - if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) + var isHead = _calcuPressModeIsHead; + var allEvaluationList = await GetEvaluationList(); + + var workingList = GetCheckedWorkingList(); + if (workingList == null || workingList.Count < 1) { var workingHelper = GetWorkingHelper(); if (!workingHelper.Initialized) @@ -3416,21 +3441,16 @@ TipFormHelper.ShowWarn("璇疯绠楀悗閲嶈瘯锛�"); return; } - ShowSingleWorkingLossCurveCtrl(workingHelper.HydroInfo, workingHelper.CalcuResult, visual); + ShowLossCurveInteropCtrl(workingHelper.HydroInfo, workingHelper.Working, node, workingHelper.CalcuResult, isHead, allEvaluationList); + return; } - else - { - var dlg = new HydroMultiWorkingLossCurveDlg(); - dlg.HydroClickEvent += (code) => - { - SelectVisual(code, eSimulationVisualSource.None); - }; - dlg.SetBindingData(_hydroInfo, allCheckedWorkingList, visual); - dlg.ShowDialog(); - } + + var dlg = new HydroLossCurveMultiWorkingDlg(); + dlg.SetBindingData(_hydroInfo, workingList, node, _calcuPressModeIsHead, allEvaluationList); + dlg.ShowDialog(); } - #endregion + #endregion 鎹熷け鏇茬嚎 #region 鏂规绠$悊 @@ -3506,10 +3526,5 @@ } #endregion 鏂规绠$悊 - - - - - } } \ No newline at end of file -- Gitblit v1.9.3