From 4a5989c23c468d376a8abe72abe1a534708dbfe2 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期三, 27 十一月 2024 20:18:51 +0800 Subject: [PATCH] 增加方案工况 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionCtrl.cs | 45 ++++++++++++++++++++++++++++----------------- 1 files changed, 28 insertions(+), 17 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionCtrl.cs index 4a02b2f..b0a80ae 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionCtrl.cs @@ -32,11 +32,11 @@ /// <summary> /// 鏄剧ず椤圭洰绔欐柟妗堜簨浠� /// </summary> - public event Action<XhsProjectVmo, XhsProjectSiteVmo, XhsSchemeVmo, SvgImage> ShowProjectSiteSchemeEvent; + public event Action<XhsProjectVmo, XhsProjectSiteVmo, XhsSchemeVmo, Yw.Model.HydroModelInfo, Dictionary<HydroWorkingVmo, bool>, SvgImage> ShowProjectSiteSchemeEvent; /// <summary> /// 鏄剧ず椤圭洰绔欐柟妗堝伐鍐典簨浠� /// </summary> - public event Action<XhsProjectVmo, XhsProjectSiteVmo, XhsSchemeVmo, Yw.Model.HydroModelInfo, HydroWorkingVmo> ShowProjectSiteSchemeWorkingEvent; + public event Action<XhsProjectVmo, XhsProjectSiteVmo, XhsSchemeVmo, Yw.Model.HydroModelInfo, HydroWorkingVmo, SvgImage> ShowProjectSiteSchemeWorkingEvent; /// <summary> /// 椤圭洰绔欐柟妗堝伐鍐甸�夋嫨宸ュ喌浜嬩欢 /// </summary> @@ -47,7 +47,7 @@ /// <summary> /// 鍒涘缓椤圭洰绔欐柟妗堜簨浠� /// </summary> - public event Action<XhsProjectVmo, XhsProjectSiteVmo, SvgImage> CreateProjectSiteSchemeEvent; + public event Action<XhsProjectVmo, XhsProjectSiteVmo, Yw.Model.HydroModelInfo, SvgImage> CreateProjectSiteSchemeEvent; /// <summary> /// 姣斿椤圭洰宸ュ喌浜嬩欢 @@ -311,7 +311,7 @@ elementScheme.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; elementScheme.ImageOptions.ImageIndex = 3; elementScheme.Tag = scheme; - elementScheme.Click += (sender, e) => + elementScheme.Click += async (sender, e) => { if (_project == null) { @@ -321,7 +321,20 @@ { return; } - this.ShowProjectSiteSchemeEvent?.Invoke(_project, _projectSite, scheme, this.svgImg32[3]); + var hydroInfo = await GetSchemeHydroInfo(scheme); + if (hydroInfo == null) + { + return; + } + Dictionary<HydroWorkingVmo, bool> dict = null; + if (_allSchemeWorkingCheckedListDict != null) + { + if (_allSchemeWorkingCheckedListDict.ContainsKey(scheme)) + { + dict = _allSchemeWorkingCheckedListDict[scheme]; + } + } + this.ShowProjectSiteSchemeEvent?.Invoke(_project, _projectSite, scheme, hydroInfo, dict, this.svgImg32[3]); }; this.elementSchemeList.Elements.Add(elementScheme); } @@ -366,17 +379,10 @@ elementWorking.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; elementWorking.Text = working.Name; elementWorking.Tag = working; - elementWorking.Click += (sender, e) => + elementWorking.Click += async (sender, e) => { - if (_project == null) - { - return; - } - if (_projectSite == null) - { - return; - } - + var hydroInfo = await GetSchemeHydroInfo(scheme, true); + this.ShowProjectSiteSchemeWorkingEvent?.Invoke(_project, _projectSite, scheme, hydroInfo, working, this.svgImg32[4]); }; elementScheme.Elements.Add(elementWorking); } @@ -426,7 +432,7 @@ } //鍒涘缓椤圭洰绔欐柟妗� - private void btnCreateProjectSiteScheme_Click(object sender, EventArgs e) + private async void btnCreateProjectSiteScheme_Click(object sender, EventArgs e) { if (_project == null) { @@ -436,7 +442,12 @@ { return; } - this.CreateProjectSiteSchemeEvent?.Invoke(_project, _projectSite, this.svgImg32[3]); + var hydroInfo = await GetHydroInfo(true); + if (hydroInfo == null) + { + return; + } + this.CreateProjectSiteSchemeEvent?.Invoke(_project, _projectSite, hydroInfo, this.svgImg32[3]); } //宸ュ喌瀵规瘮 -- Gitblit v1.9.3